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

Method GameOptionsWindow

src/settings_gui.cpp:421–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419 static inline WidgetID active_tab = WID_GO_TAB_GENERAL;
420
421 GameOptionsWindow(WindowDesc &desc) : Window(desc), filter_editbox(50)
422 {
423 this->opt = &GetGameSettings();
424
425 AddCustomRefreshRates();
426
427 this->filter.mode = (RestrictionMode)_settings_client.gui.settings_restriction_mode;
428 this->filter.min_cat = RM_ALL;
429 this->filter.type = ST_ALL;
430 this->filter.type_hides = false;
431 this->settings_ptr = &GetGameSettings();
432
433 GetSettingsTree().FoldAll(); // Close all sub-pages
434
435 this->CreateNestedTree();
436 this->vscroll = this->GetScrollbar(WID_GO_SCROLLBAR);
437 this->vscroll_description = this->GetScrollbar(WID_GO_HELP_TEXT_SCROLL);
438 this->vscroll_description->SetCapacity(NUM_DESCRIPTION_LINES);
439 this->FinishInitNested(WN_GAME_OPTIONS_GAME_OPTIONS);
440
441 this->querystrings[WID_GO_FILTER] = &this->filter_editbox;
442 this->filter_editbox.cancel_button = QueryString::ACTION_CLEAR;
443
444 this->OnInvalidateData(0);
445
446 this->SetTab(GameOptionsWindow::active_tab);
447
448 if constexpr (!NetworkSurveyHandler::IsSurveyPossible()) this->GetWidget<NWidgetStacked>(WID_GO_SURVEY_SEL)->SetDisplayedPlane(SZSP_NONE);
449 }
450
451 void OnInit() override
452 {

Callers

nothing calls this directly

Calls 9

OnInvalidateDataMethod · 0.95
SetTabMethod · 0.95
AddCustomRefreshRatesFunction · 0.85
CreateNestedTreeMethod · 0.80
GetScrollbarMethod · 0.80
SetCapacityMethod · 0.80
FinishInitNestedMethod · 0.80
SetDisplayedPlaneMethod · 0.80
FoldAllMethod · 0.45

Tested by

no test coverage detected