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

Method SetTab

src/settings_gui.cpp:774–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772 }
773
774 void SetTab(WidgetID widget)
775 {
776 this->SetWidgetsLoweredState(false, WID_GO_TAB_GENERAL, WID_GO_TAB_GRAPHICS, WID_GO_TAB_SOUND, WID_GO_TAB_ADVANCED, WID_GO_TAB_SOCIAL);
777 this->LowerWidget(widget);
778 GameOptionsWindow::active_tab = widget;
779
780 int plane;
781 switch (widget) {
782 case WID_GO_TAB_GENERAL: plane = 0; break;
783 case WID_GO_TAB_GRAPHICS: plane = 1; break;
784 case WID_GO_TAB_SOUND: plane = 2; break;
785 case WID_GO_TAB_SOCIAL: plane = 3; break;
786 case WID_GO_TAB_ADVANCED: plane = 4; break;
787 default: NOT_REACHED();
788 }
789
790 this->GetWidget<NWidgetStacked>(WID_GO_TAB_SELECTION)->SetDisplayedPlane(plane);
791 if (widget == WID_GO_TAB_ADVANCED) this->SetFocusedWidget(WID_GO_FILTER);
792 this->SetDirty();
793 }
794
795 void OnResize() override
796 {

Callers 2

GameOptionsWindowMethod · 0.95
OnClickMethod · 0.95

Calls 6

NOT_REACHEDFunction · 0.85
LowerWidgetMethod · 0.80
SetDisplayedPlaneMethod · 0.80
SetFocusedWidgetMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected