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

Function MenuClickTown

src/toolbar_gui.cpp:499–511  ·  view source on GitHub ↗

* Handle click on one of the entries in the Town menu. * * @param index Index being clicked. * @return #CBF_NONE */

Source from the content-addressed store, hash-verified

497 * @return #CBF_NONE
498 */
499static CallBackFunction MenuClickTown(int index)
500{
501 switch (index) {
502 case TME_SHOW_DIRECTORY: ShowTownDirectory(); break;
503 case TME_SHOW_FOUND_TOWN: // Setting could be changed when the dropdown was open
504 if (_settings_game.economy.found_town != TF_FORBIDDEN) ShowFoundTownWindow();
505 break;
506 case TME_SHOW_PLACE_HOUSES: // Setting could be changed when the dropdown was open
507 if (_settings_game.economy.place_houses != PH_FORBIDDEN) ShowBuildHousePicker(nullptr);
508 break;
509 }
510 return CBF_NONE;
511}
512
513/* --- Subidies button menu --- */
514

Callers

nothing calls this directly

Calls 3

ShowTownDirectoryFunction · 0.85
ShowFoundTownWindowFunction · 0.85
ShowBuildHousePickerFunction · 0.85

Tested by

no test coverage detected