[saco] Implement/match RemoveColorEmbedsFromString(...)

This commit is contained in:
RD42 2024-07-23 18:51:42 +08:00
parent 1f42d8cc6e
commit 07904813b5
3 changed files with 17 additions and 2 deletions

View File

@ -1897,6 +1897,20 @@ DWORD GetColorFromEmbedCode(wchar_t *szString)
return 0xFFFFFFFF;
}
void RemoveColorEmbedsFromString(char *szString)
{
while(*szString)
{
if(GetColorFromEmbedCode(szString) != 0xFFFFFFFF)
{
strcpy(szString, szString + 8);
continue;
}
szString++;
}
*szString = 0;
}
DWORD unnamed_100B6100(char *szString, int nMaxLen)
{
char tmp_buf[2049];

View File

@ -69,3 +69,4 @@ BOOL IsHexChar(char c);
BOOL IsHexChar(wchar_t c);
DWORD GetColorFromEmbedCode(char *szString);
DWORD GetColorFromEmbedCode(wchar_t *szString);
void RemoveColorEmbedsFromString(char *szString);

View File

@ -8,7 +8,7 @@ LRESULT APIENTRY NewWndProc(HWND,UINT,WPARAM,LPARAM);
//----------------------------------------------------
void InstallNewWindowProcedure()
void InstallWindowProcedure()
{
HWND hwndGameWnd = pGame->GetMainWindowHwnd();
@ -31,7 +31,7 @@ BOOL SubclassGameWindow()
DWORD dwStyle = GetClassLong(hwndGameWnd,GCL_STYLE);
SetClassLong(hwndGameWnd,GCL_STYLE,dwStyle|CS_DBLCLKS);
InstallNewWindowProcedure();
InstallWindowProcedure();
SetWindowText(hwndGameWnd,"GTA:SA:MP");