server list colors, unicode parse bug

fixes bug in parsing names from the server file, double s letters wouldnt parse correctly
attempted to add color parsing to server list text but it appears that buttons dont accept color? i left the code in for anyone who is interested to take a look
This commit is contained in:
DrPerkyLegit
2026-06-28 15:18:10 -04:00
parent 606d09a4e8
commit 2eb55af875
3 changed files with 32 additions and 8 deletions
@@ -13,6 +13,9 @@
#include <iostream>
#endif
#include <codecvt>
#include <string>
CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
@@ -910,14 +913,13 @@ void CPlatformNetworkManagerStub::SearchForGames()
if (std::fread(&nameLen, sizeof(uint16_t), 1, file) != 1) break;
if (nameLen > 256) break;
char nameBuf[257] = {};
if (nameLen > 0)
{
if (std::fread(nameBuf, 1, nameLen, file) != nameLen) break;
wstring wName = L"";
for (int l = 0; l < nameLen; l++) {
uint16_t _char = 0;
if (std::fread(&_char, 1, 1, file) != 1) break;
wName += _char;
}
wstring wName = convStringToWstring(nameBuf);
FriendSessionInfo* info = new FriendSessionInfo();
size_t nLen = wName.length();
info->displayLabel = new wchar_t[nLen + 1];
@@ -4675,7 +4675,7 @@ void UIScene_LoadCreateJoinMenu::RebuildJoinGamesListVisual(bool syncFocus)
m_buttonListGames.getItemCount() - 1,
L"lceheadwer.png",
L"lceheadwer");
RefreshServerListHtmlPatch();
#endif
if (m_currentSessions == nullptr || m_currentSessions->empty())
@@ -4756,7 +4756,10 @@ void UIScene_LoadCreateJoinMenu::RebuildJoinGamesListVisual(bool syncFocus)
}
}
m_buttonListGames.addItem(sessionInfo->displayLabel, modeIconName, tpIconName);
wstring htmlLabel = app.EscapeHTMLString(sessionInfo->displayLabel);
htmlLabel = app.FormatColoredString(htmlLabel);
m_buttonListGames.addItem(htmlLabel, modeIconName, tpIconName);
if (memcmp(&selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID)) == 0)
@@ -4778,6 +4781,8 @@ void UIScene_LoadCreateJoinMenu::RebuildJoinGamesListVisual(bool syncFocus)
}
RefreshServerListHtmlPatch();
if(syncFocus)
m_buttonListGames.updateChildFocus(m_buttonListGames.getCurrentSelection());
@@ -9208,6 +9213,21 @@ int UIScene_LoadCreateJoinMenu::AddServerKeyboardCallback(LPVOID lpParam, bool b
}
void UIScene_LoadCreateJoinMenu::RefreshServerListHtmlPatch() {
S32 arrayItems = 0;
IggyValueGetArrayLengthRS(m_buttonListGames.getIggyValuePath(), 0, "m_aItems", &arrayItems);
IggyValuePath listPath;
IggyValuePathMakeNameRef(&listPath, m_buttonListGames.getIggyValuePath(), "m_aItems");
for (int i = 0; i < arrayItems; i++) {
IggyValuePath listItem;
IggyValuePathMakeArrayRef(&listItem, &listPath, i);
IggyValueSetBooleanRS(&listItem, 0, "m_bUseHtmlText", true);
}
}
void UIScene_LoadCreateJoinMenu::AppendServerToFile(const wstring& ip, const wstring& port, const wstring& name)
@@ -270,6 +270,8 @@ private:
void BeginAddServer();
void AppendServerToFile(const wstring& ip, const wstring& port, const wstring& name);
static int AddServerKeyboardCallback(LPVOID lpParam, bool bRes);
void RefreshServerListHtmlPatch();
#endif
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)