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.
This commit is contained in:
Patric Stout
2021-04-18 09:54:47 +02:00
committed by Patric Stout
parent aca20092aa
commit 5266359424
12 changed files with 573 additions and 175 deletions

View File

@@ -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);