diff options
author | Patric Stout <truebrain@openttd.org> | 2021-08-14 10:19:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 10:19:32 +0200 |
commit | 65b8614d2640a0cfa5472689f5ddcb5fbefc06d2 (patch) | |
tree | 37a84b5311dfec3bbbf64fb9cb585cb34ad07229 /src | |
parent | 120d216b0b7e3efe01cbc180e96e1ab11257c304 (diff) | |
download | openttd-65b8614d2640a0cfa5472689f5ddcb5fbefc06d2.tar.xz |
Add: mention you are a spectator in the status bar (if you are, ofc) (#9471)
Diffstat (limited to 'src')
-rw-r--r-- | src/lang/english.txt | 2 | ||||
-rw-r--r-- | src/statusbar_gui.cpp | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt index eb7b7365b..fb8c687e7 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -783,6 +783,8 @@ STR_STATUSBAR_PAUSED_LINK_GRAPH :{ORANGE}* * P STR_STATUSBAR_AUTOSAVE :{RED}AUTOSAVE STR_STATUSBAR_SAVING_GAME :{RED}* * SAVING GAME * * +STR_STATUSBAR_SPECATOR :{WHITE}(spectator) + # News message history STR_MESSAGE_HISTORY :{WHITE}Message History STR_MESSAGE_HISTORY_TOOLTIP :{BLACK}A list of the recent news messages diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 52b972086..bbae48d64 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -147,11 +147,15 @@ struct StatusBarWindow : Window { break; case WID_S_RIGHT: { - /* Draw company money, if any */ - const Company *c = Company::GetIfValid(_local_company); - if (c != nullptr) { - SetDParam(0, c->money); - DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, text_top, STR_COMPANY_MONEY, TC_FROMSTRING, SA_HOR_CENTER); + if (_local_company == COMPANY_SPECTATOR) { + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, text_top, STR_STATUSBAR_SPECATOR, TC_FROMSTRING, SA_HOR_CENTER); + } else { + /* Draw company money, if any */ + const Company *c = Company::GetIfValid(_local_company); + if (c != nullptr) { + SetDParam(0, c->money); + DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, text_top, STR_COMPANY_MONEY, TC_FROMSTRING, SA_HOR_CENTER); + } } break; } |