Merge branch upstream/master

This commit is contained in:
Sergii Pylypenko
2021-11-28 03:16:36 +02:00
326 changed files with 9186 additions and 8099 deletions

View File

@@ -217,10 +217,8 @@ 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_SPEAK_ALL = -5; ///< Send message to public chat
static const int CTMN_SPECTATOR = -2; ///< Show a company window as spectator
static const int CTMN_SPEAK_ALL = -3; ///< Send message to public chat
/**
* Pop up a generic company list menu.
@@ -239,12 +237,6 @@ static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0)
/* Add the client list button for the companies menu */
list.emplace_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, CTMN_CLIENT_LIST, false));
list.emplace_back(new DropDownListStringItem(STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL, CTMN_SPEAK_ALL, false));
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;
case WID_TN_STORY:
@@ -631,23 +623,6 @@ static CallBackFunction MenuClickCompany(int index)
ShowClientList();
return CBF_NONE;
case CTMN_NEW_COMPANY:
if (_network_server) {
DoCommandP(0, CCA_NEW, _network_own_client_id, CMD_COMPANY_CTRL);
} else {
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;
case CTMN_SPEAK_ALL:
ShowNetworkChatQueryWindow(DESTTYPE_BROADCAST, 0);
return CBF_NONE;
@@ -2971,7 +2946,9 @@ static NWidgetBase *MakeMainToolbar(int *biggest_index)
hor->Add(new NWidgetSpacer(0, 0));
break;
}
hor->Add(new NWidgetLeaf(i == WID_TN_SAVE ? WWT_IMGBTN_2 : WWT_IMGBTN, COLOUR_GREY, i, toolbar_button_sprites[i], STR_TOOLBAR_TOOLTIP_PAUSE_GAME + i));
NWidgetLeaf *leaf = new NWidgetLeaf(i == WID_TN_SAVE ? WWT_IMGBTN_2 : WWT_IMGBTN, COLOUR_GREY, i, toolbar_button_sprites[i], STR_TOOLBAR_TOOLTIP_PAUSE_GAME + i);
leaf->SetMinimalSize(20, 20);
hor->Add(leaf);
}
hor->Add(new NWidgetSpacer(0, 0));