summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-10-17 18:14:25 +0100
committerGitHub <noreply@github.com>2021-10-17 18:14:25 +0100
commit3b7daca83207636d84bd0232ce91ed8e9616b12f (patch)
tree9e7986e7ff16ff86871358f3e86c3f37d3c7db68
parent78eece71d9f669057c794f345ff5744145376556 (diff)
downloadopenttd-3b7daca83207636d84bd0232ce91ed8e9616b12f.tar.xz
Change: Don't use 'server address' string in server list when displaying an invite code (#9615)
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/network/network_gui.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index ea8908a5e..a944e9b74 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2257,6 +2257,7 @@ STR_NETWORK_SERVER_LIST_LANDSCAPE :{SILVER}Landsca
STR_NETWORK_SERVER_LIST_MAP_SIZE :{SILVER}Map size: {WHITE}{COMMA}x{COMMA}
STR_NETWORK_SERVER_LIST_SERVER_VERSION :{SILVER}Server version: {WHITE}{RAW_STRING}
STR_NETWORK_SERVER_LIST_SERVER_ADDRESS :{SILVER}Server address: {WHITE}{RAW_STRING}
+STR_NETWORK_SERVER_LIST_INVITE_CODE :{SILVER}Invite code: {WHITE}{RAW_STRING}
STR_NETWORK_SERVER_LIST_START_DATE :{SILVER}Start date: {WHITE}{DATE_SHORT}
STR_NETWORK_SERVER_LIST_CURRENT_DATE :{SILVER}Current date: {WHITE}{DATE_SHORT}
STR_NETWORK_SERVER_LIST_GAMESCRIPT :{SILVER}Game Script: {WHITE}{RAW_STRING} (v{NUM})
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 6bca0c756..76385a087 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -681,7 +681,8 @@ public:
y += FONT_HEIGHT_NORMAL;
SetDParamStr(0, sel->connection_string);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_NETWORK_SERVER_LIST_SERVER_ADDRESS); // server address
+ StringID invite_or_address = StrStartsWith(sel->connection_string, "+") ? STR_NETWORK_SERVER_LIST_INVITE_CODE : STR_NETWORK_SERVER_LIST_SERVER_ADDRESS;
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, invite_or_address); // server address / invite code
y += FONT_HEIGHT_NORMAL;
SetDParam(0, sel->info.start_date);