| 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 | { |
nothing calls this directly
no test coverage detected