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

Function MenuClickSettings

src/toolbar_gui.cpp:310–341  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

308 * @return #CBF_NONE
309 */
310static CallBackFunction MenuClickSettings(int index)
311{
312 switch (index) {
313 case OME_GAMEOPTIONS: ShowGameOptions(); return CBF_NONE;
314 case OME_AI_SETTINGS: ShowAIConfigWindow(); return CBF_NONE;
315 case OME_GAMESCRIPT_SETTINGS: ShowGSConfigWindow(); return CBF_NONE;
316 case OME_NEWGRFSETTINGS: ShowNewGRFSettings(!_networking && _settings_client.gui.UserIsAllowedToChangeNewGRFs(), true, true, _grfconfig); return CBF_NONE;
317 case OME_SANDBOX: ShowCheatWindow(); break;
318 case OME_TRANSPARENCIES: ShowTransparencyToolbar(); break;
319
320 case OME_SHOW_TOWNNAMES: ToggleBit(_display_opt, DO_SHOW_TOWN_NAMES); break;
321 case OME_SHOW_STATIONNAMES: ToggleBit(_display_opt, DO_SHOW_STATION_NAMES); break;
322 case OME_SHOW_STATIONNAMES_TRAIN: _facility_display_opt.Flip(StationFacility::Train); break;
323 case OME_SHOW_STATIONNAMES_LORRY: _facility_display_opt.Flip(StationFacility::TruckStop); break;
324 case OME_SHOW_STATIONNAMES_BUS: _facility_display_opt.Flip(StationFacility::BusStop); break;
325 case OME_SHOW_STATIONNAMES_SHIP: _facility_display_opt.Flip(StationFacility::Dock); break;
326 case OME_SHOW_STATIONNAMES_PLANE: _facility_display_opt.Flip(StationFacility::Airport); break;
327 case OME_SHOW_STATIONNAMES_GHOST: _facility_display_opt.Flip(STATION_FACILITY_GHOST); break;
328 case OME_SHOW_WAYPOINTNAMES: ToggleBit(_display_opt, DO_SHOW_WAYPOINT_NAMES); break;
329 case OME_SHOW_SIGNS: ToggleBit(_display_opt, DO_SHOW_SIGNS); break;
330 case OME_SHOW_COMPETITOR_SIGNS:
331 ToggleBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS);
332 InvalidateWindowClassesData(WC_SIGN_LIST, -1);
333 break;
334 case OME_FULL_ANIMATION: ToggleBit(_display_opt, DO_FULL_ANIMATION); CheckBlitter(); break;
335 case OME_FULL_DETAILS: ToggleBit(_display_opt, DO_FULL_DETAIL); break;
336 case OME_TRANSPARENTBUILDINGS: ToggleTransparency(TO_HOUSES); break;
337 case OME_SHOW_STATIONSIGNS: ToggleTransparency(TO_SIGNS); break;
338 }
339 MarkWholeScreenDirty();
340 return CBF_NONE;
341}
342
343/**
344 * SaveLoad entries in scenario editor mode.

Callers

nothing calls this directly

Calls 12

ShowGameOptionsFunction · 0.85
ShowAIConfigWindowFunction · 0.85
ShowGSConfigWindowFunction · 0.85
ShowNewGRFSettingsFunction · 0.85
ShowCheatWindowFunction · 0.85
ShowTransparencyToolbarFunction · 0.85
ToggleBitFunction · 0.85
CheckBlitterFunction · 0.85
ToggleTransparencyFunction · 0.85
MarkWholeScreenDirtyFunction · 0.85

Tested by

no test coverage detected