Changeset - r23325:4a341df798c8
[Not reviewed]
master
0 1 0
glx - 5 years ago 2019-02-17 00:16:24
glx@openttd.org
Fix 1585eb1a3: wrong default selection for goals and story book
1 file changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/toolbar_gui.cpp
Show inline comments
 
@@ -209,25 +209,24 @@ static void PopupMainToolbMenu(Window *w
 

	
 
/** 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
 

	
 
/**
 
 * Pop up a generic company list menu.
 
 * @param w The toolbar window.
 
 * @param widget The button widget id.
 
 * @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)
 
{
 
	DropDownList *list = new DropDownList();
 

	
 
	switch (widget) {
 
		case WID_TN_COMPANIES:
 
#ifdef ENABLE_NETWORK
 
			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);
 
@@ -245,25 +244,25 @@ static void PopupMainCompanyToolbMenu(Wi
 
			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;
 
		*list->Append() = new DropDownListCompanyItem(c, false, HasBit(grey, c));
 
	}
 

	
 
	PopupMainToolbMenu(w, widget, list, _local_company == COMPANY_SPECTATOR ? CTMN_CLIENT_LIST : (int)_local_company);
 
	PopupMainToolbMenu(w, widget, list, _local_company == COMPANY_SPECTATOR ? (widget == WID_TN_COMPANIES ? CTMN_CLIENT_LIST : CTMN_SPECTATOR) : (int)_local_company);
 
}
 

	
 

	
 
static ToolbarMode _toolbar_mode;
 

	
 
static CallBackFunction SelectSignTool()
 
{
 
	if (_last_started_action == CBF_PLACE_SIGN) {
 
		ResetObjectToPlace();
 
		return CBF_NONE;
 
	} else {
 
		SetObjectToPlace(SPR_CURSOR_SIGN, PAL_NONE, HT_RECT, WC_MAIN_TOOLBAR, 0);
0 comments (0 inline, 0 general)