• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión3147116cf3a27dd3260fcb0c7df8fbbe970788b6 (tree)
Tiempo2021-12-02 14:13:21
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed color codes appearing in the hostname when the server was minimized in the systray.

Cambiar Resumen

Diferencia incremental

diff -r e621cccd7a0e -r 3147116cf3a2 src/win32/serverconsole/serverconsole.cpp
--- a/src/win32/serverconsole/serverconsole.cpp Sat Dec 04 18:05:39 2021 +0100
+++ b/src/win32/serverconsole/serverconsole.cpp Thu Dec 02 00:13:21 2021 -0500
@@ -512,8 +512,7 @@
512512 RECT ThisWindowRect;
513513 ANIMATIONINFO AnimationInfo;
514514 NOTIFYICONDATA NotifyIconData;
515- UCVarValue Val;
516- char szString[64];
515+ FString uncolorizedHostname;
517516
518517 AnimationInfo.cbSize = sizeof( AnimationInfo );
519518 SystemParametersInfo( SPI_GETANIMATION, sizeof( AnimationInfo ), &AnimationInfo, 0 );
@@ -547,10 +546,12 @@
547546 NotifyIconData.uCallbackMessage = UWM_TRAY_TRAYID;
548547 NotifyIconData.hIcon = g_hSmallIcon;
549548
550- Val = sv_hostname.GetGenericRep( CVAR_String );
551- strncpy( szString, Val.String, 63 );
552- szString[63] = 0;
553- lstrcpy( NotifyIconData.szTip, szString );
549+ // [AK] Remove any color codes in the server name before sending it off.
550+ uncolorizedHostname = sv_hostname.GetGenericRep( CVAR_String ).String;
551+ V_ColorizeString( uncolorizedHostname );
552+ V_RemoveColorCodes( uncolorizedHostname );
553+
554+ lstrcpy( NotifyIconData.szTip, uncolorizedHostname.GetChars( ));
554555
555556 Shell_NotifyIcon( NIM_ADD, &NotifyIconData );
556557 break;