| 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 | { |
no test coverage detected