diff options
-rw-r--r-- | src/lang/english.txt | 3 | ||||
-rw-r--r-- | src/toolbar_gui.cpp | 38 |
2 files changed, 23 insertions, 18 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt index 8f0da8c0c..949851723 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2101,7 +2101,6 @@ STR_NETWORK_CLIENT :Client STR_NETWORK_SPECTATORS :Spectators STR_NETWORK_GIVE_MONEY_CAPTION :{WHITE}Enter the amount of money you want to give -STR_NETWORK_TOOLBAR_LIST_SPECTATOR :{BLACK}Spectator # Network set password STR_COMPANY_PASSWORD_CANCEL :{BLACK}Do not save the entered password @@ -3112,6 +3111,7 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{YELLOW}Bribe t # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Goals STR_GOALS_SPECTATOR_CAPTION :{WHITE}Global Goals +STR_GOALS_SPECTATOR :Global Goals STR_GOALS_GLOBAL_TITLE :{BLACK}Global goals: STR_GOALS_TEXT :{ORANGE}{RAW_STRING} STR_GOALS_NONE :{ORANGE}- None - @@ -3160,6 +3160,7 @@ STR_SUBSIDIES_TOOLTIP_CLICK_ON_SERVICE_TO_CENTER :{BLACK}Click on # Story book window STR_STORY_BOOK_CAPTION :{WHITE}{COMPANY} Story Book STR_STORY_BOOK_SPECTATOR_CAPTION :{WHITE}Global Story Book +STR_STORY_BOOK_SPECTATOR :Global Story Book STR_STORY_BOOK_TITLE :{YELLOW}{RAW_STRING} STR_STORY_BOOK_GENERIC_PAGE_ITEM :Page {NUM} STR_STORY_BOOK_SEL_PAGE_TOOLTIP :{BLACK}Jump to a specific page by selecting it in this drop down list. diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index fbc099f8a..a5bccd41f 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -220,30 +220,34 @@ static const int CTMN_SPECTATOR = -4; ///< Show a company window as spectator * @param grey A bitbask of which items to mark as disabled. * @param include_spectator If true, a spectator option is included in the list. */ -static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0, bool include_spectator = false) +static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0) { DropDownList *list = new DropDownList(); + switch (widget) { + case WID_TN_COMPANIES: #ifdef ENABLE_NETWORK - if (_networking) { - if (widget == WID_TN_COMPANIES) { + if (!_networking) break; + /* Add the client list button for the companies menu */ *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, CTMN_CLIENT_LIST, false); - } - if (include_spectator) { - if (widget == WID_TN_COMPANIES) { - if (_local_company == COMPANY_SPECTATOR) { - *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached()); - } else { - *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()); - } + if (_local_company == COMPANY_SPECTATOR) { + *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached()); } else { - *list->Append() = new DropDownListStringItem(STR_NETWORK_TOOLBAR_LIST_SPECTATOR, CTMN_SPECTATOR, false); + *list->Append() = new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()); } - } - } #endif /* ENABLE_NETWORK */ + break; + + case WID_TN_STORY: + *list->Append() = new DropDownListStringItem(STR_STORY_BOOK_SPECTATOR, CTMN_SPECTATOR, false); + break; + + case WID_TN_GOAL: + *list->Append() = new DropDownListStringItem(STR_GOALS_SPECTATOR, CTMN_SPECTATOR, false); + break; + } for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) { if (!Company::IsValidID(c)) continue; @@ -597,7 +601,7 @@ static CallBackFunction MenuClickFinances(int index) static CallBackFunction ToolbarCompaniesClick(Window *w) { - PopupMainCompanyToolbMenu(w, WID_TN_COMPANIES, 0, true); + PopupMainCompanyToolbMenu(w, WID_TN_COMPANIES, 0); return CBF_NONE; } @@ -643,7 +647,7 @@ static CallBackFunction MenuClickCompany(int index) static CallBackFunction ToolbarStoryClick(Window *w) { - PopupMainCompanyToolbMenu(w, WID_TN_STORY, 0, true); + PopupMainCompanyToolbMenu(w, WID_TN_STORY, 0); return CBF_NONE; } @@ -663,7 +667,7 @@ static CallBackFunction MenuClickStory(int index) static CallBackFunction ToolbarGoalClick(Window *w) { - PopupMainCompanyToolbMenu(w, WID_TN_GOAL, 0, true); + PopupMainCompanyToolbMenu(w, WID_TN_GOAL, 0); return CBF_NONE; } |