1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 02:42:42 +01:00

Codechange: Use parameterised GetString() in network-related windows. (#13635)

This commit is contained in:
Peter Nelson
2025-02-22 13:16:47 +00:00
committed by GitHub
parent 847fbe3348
commit 2b80812922
6 changed files with 82 additions and 118 deletions

View File

@@ -217,8 +217,7 @@ void NetworkDrawChatMessage()
int string_height = 0;
for (auto &cmsg : _chatmsg_list) {
if (!show_all && cmsg.remove_time < now) continue;
SetDParamStr(0, cmsg.message);
string_height += GetStringLineCount(STR_JUST_RAW_STRING, width - 1) * GetCharacterHeight(FS_NORMAL) + NETWORK_CHAT_LINE_SPACING;
string_height += GetStringLineCount(GetString(STR_JUST_RAW_STRING, cmsg.message), width - 1) * GetCharacterHeight(FS_NORMAL) + NETWORK_CHAT_LINE_SPACING;
}
string_height = std::min<uint>(string_height, MAX_CHAT_MESSAGES * (GetCharacterHeight(FS_NORMAL) + NETWORK_CHAT_LINE_SPACING));