summaryrefslogtreecommitdiff
path: root/src/toolbar_gui.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-18 09:54:47 +0200
committerPatric Stout <github@truebrain.nl>2021-04-24 21:43:58 +0200
commit526635942451479bee66e9eb61c50f91ae48a7dd (patch)
tree34a757634102f384eb2e70ae1044dd86916243f9 /src/toolbar_gui.cpp
parentaca20092aadd65a764f1ea493c36f0ca507b32ff (diff)
downloadopenttd-526635942451479bee66e9eb61c50f91ae48a7dd.tar.xz
Feature: rework in-game Online Players GUI
The GUI now more clearly shows some basic information about the server you joined, your client name (and the ability to change it), and what players are in which company. It also contains useful buttons to press to join companies, chat with other people, and for admins to kick/ban people. Additionally, renamed "advertised" to "visibility"; this has to do with future additions, but also because it is more clear in wording.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r--src/toolbar_gui.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index ea50661e4..6a65382b4 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -205,8 +205,7 @@ static void PopupMainToolbMenu(Window *w, int widget, StringID string, int count
/** Enum for the Company Toolbar's network related buttons */
static const int CTMN_CLIENT_LIST = -1; ///< Show the client list
static const int CTMN_NEW_COMPANY = -2; ///< Create a new company
-static const int CTMN_SPECTATE = -3; ///< Become spectator
-static const int CTMN_SPECTATOR = -4; ///< Show a company window as spectator
+static const int CTMN_SPECTATOR = -3; ///< Show a company window as spectator
/**
* Pop up a generic company list menu.
@@ -227,8 +226,6 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0)
if (_local_company == COMPANY_SPECTATOR) {
list.emplace_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached()));
- } else {
- list.emplace_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()));
}
break;
@@ -619,15 +616,6 @@ static CallBackFunction MenuClickCompany(int index)
NetworkSendCommand(0, CCA_NEW, 0, CMD_COMPANY_CTRL, nullptr, nullptr, _local_company);
}
return CBF_NONE;
-
- case CTMN_SPECTATE:
- if (_network_server) {
- NetworkServerDoMove(CLIENT_ID_SERVER, COMPANY_SPECTATOR);
- MarkWholeScreenDirty();
- } else {
- NetworkClientRequestMove(COMPANY_SPECTATOR);
- }
- return CBF_NONE;
}
}
ShowCompany((CompanyID)index);