Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void NetworkLog(ELogVerbosity logVerbosity, const char* fmt, ...);
std::string to_utf8(const std::wstring& wstr);
std::wstring from_utf8(const std::string& utf8_str);
std::wstring NormalizeSingleLineText(const std::wstring& text);
std::wstring WidenFormatSpecifiers(const std::wstring& format);

int RoundUpLatencyToFrameInterval(int latency, int frameInterval);
int ConvertMSLatencyToFrames(int ms);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ void updateBuddyInfo( void )
if (!pSocialInterface->IsUserFriend(profileID) && !pSocialInterface->IsUserPendingRequest(profileID))
{
UnicodeString strName;
strName.format(L"%hs", friendsEntry.display_name.c_str());
strName.format(L"%s", from_utf8(friendsEntry.display_name).c_str());

// insert name into box
int index = GadgetListBoxAddEntryText(buddyControls.listboxBuddies, strName, GameSpyColor[GSCOLOR_CHAT_EMOTE], -1, -1);
Expand All @@ -591,11 +591,8 @@ void updateBuddyInfo( void )
{
FriendsEntry friendsEntry = kvPair.second;
int64_t profileID = friendsEntry.user_id;
AsciiString strName = AsciiString(friendsEntry.display_name.c_str());

// insert name into box
UnicodeString formatStr;
formatStr.translate(strName.str());
UnicodeString formatStr(from_utf8(friendsEntry.display_name).c_str());
int index = GadgetListBoxAddEntryText(buddyControls.listboxBuddies, formatStr, GameSpyColor[GSCOLOR_DEFAULT], -1, -1);
GadgetListBoxSetItemData(buddyControls.listboxBuddies, (void*)(profileID), index, 0);

Expand Down Expand Up @@ -637,11 +634,11 @@ void updateBuddyInfo( void )
UnicodeString strName;
if (friendsEntry.online)
{
strName.format(L"\u25CF %hs", friendsEntry.display_name.c_str());
strName.format(L"\u25CF %s", from_utf8(friendsEntry.display_name).c_str());
}
else
{
strName.format(L"\u25CC %hs", friendsEntry.display_name.c_str());
strName.format(L"\u25CC %s", from_utf8(friendsEntry.display_name).c_str());
}

if (numUnreadMessages > 0)
Expand All @@ -668,7 +665,7 @@ void updateBuddyInfo( void )
if (friendsEntry.online)
{
UnicodeString strGameState = TheGameText->fetch("Buddy:Online");
formatStr.format(L"%s - %hs", strGameState.str(), friendsEntry.presence.c_str());
formatStr.format(L"%s - %s", strGameState.str(), from_utf8(friendsEntry.presence).c_str());
}
else
{
Expand Down Expand Up @@ -994,7 +991,14 @@ void showNotificationBox(AsciiString nick, UnicodeString message)
}

if (nick.isNotEmpty())
{
#if defined(GENERALS_ONLINE)
// Generals Online nicks are UTF-8 display names
message.format(WidenFormatSpecifiers(message.str()).c_str(), from_utf8(nick.str()).c_str());
#else
message.format(message, nick.str());
#endif
}
GadgetButtonSetText(win, message);
//GadgetStaticTextSetText(win, message);
noticeExpires = timeGetTime() + NOTIFICATION_EXPIRES;
Expand Down Expand Up @@ -1126,7 +1130,7 @@ void WOLBuddyOverlayInit( WindowLayout *layout, void *userData )
listboxIgnore = TheWindowManager->winGetWindowFromId( parent, listboxIgnoreID);

if (radioButtonIgnore)
GadgetRadioSetText(radioButtonIgnore, UnicodeString(L"Block"));
GadgetRadioSetText(radioButtonIgnore, UnicodeString(L"Blocked"));

InitBuddyControls(BUDDY_WINDOW_BUDDIES);

Expand Down Expand Up @@ -2049,10 +2053,7 @@ void refreshIgnoreList()

for (FriendsEntry& blockedEntry : blockResult.vecBlocked)
{
AsciiString strName = AsciiString(blockedEntry.display_name.c_str());

UnicodeString name;
name.translate(strName);
UnicodeString name(from_utf8(blockedEntry.display_name).c_str());
Int index = GadgetListBoxAddEntryText(listboxIgnore, name, GameMakeColor(255, 100, 100, 255), -1);
GadgetListBoxSetItemData(listboxIgnore, (void*)(blockedEntry.user_id), index, 0);
}
Expand Down
Loading
Loading