MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ToolbarTownClick

Function ToolbarTownClick

src/toolbar_gui.cpp:481–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479};
480
481static CallBackFunction ToolbarTownClick(Window *w)
482{
483 DropDownList list;
484 list.push_back(MakeDropDownListStringItem(STR_TOWN_MENU_TOWN_DIRECTORY, TME_SHOW_DIRECTORY));
485 if (_settings_game.economy.found_town != TF_FORBIDDEN) list.push_back(MakeDropDownListStringItem(STR_TOWN_MENU_FOUND_TOWN, TME_SHOW_FOUND_TOWN));
486 if (_settings_game.economy.place_houses != PH_FORBIDDEN) list.push_back(MakeDropDownListStringItem(STR_SCENEDIT_TOWN_MENU_PACE_HOUSE, TME_SHOW_PLACE_HOUSES));
487
488 PopupMainToolbarMenu(w, WID_TN_TOWNS, std::move(list), 0);
489
490 return CBF_NONE;
491}
492
493/**
494 * Handle click on one of the entries in the Town menu.

Callers

nothing calls this directly

Calls 3

PopupMainToolbarMenuFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected