Revisión | 3147116cf3a27dd3260fcb0c7df8fbbe970788b6 (tree) |
---|---|
Tiempo | 2021-12-02 14:13:21 |
Autor | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Fixed color codes appearing in the hostname when the server was minimized in the systray.
@@ -512,8 +512,7 @@ | ||
512 | 512 | RECT ThisWindowRect; |
513 | 513 | ANIMATIONINFO AnimationInfo; |
514 | 514 | NOTIFYICONDATA NotifyIconData; |
515 | - UCVarValue Val; | |
516 | - char szString[64]; | |
515 | + FString uncolorizedHostname; | |
517 | 516 | |
518 | 517 | AnimationInfo.cbSize = sizeof( AnimationInfo ); |
519 | 518 | SystemParametersInfo( SPI_GETANIMATION, sizeof( AnimationInfo ), &AnimationInfo, 0 ); |
@@ -547,10 +546,12 @@ | ||
547 | 546 | NotifyIconData.uCallbackMessage = UWM_TRAY_TRAYID; |
548 | 547 | NotifyIconData.hIcon = g_hSmallIcon; |
549 | 548 | |
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( )); | |
554 | 555 | |
555 | 556 | Shell_NotifyIcon( NIM_ADD, &NotifyIconData ); |
556 | 557 | break; |