mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Replace game options' style-breaking if-condition with switch.
parent
341d022024
commit
8ca867ef63
|
@ -390,9 +390,14 @@ struct GameOptionsWindow : Window {
|
||||||
this->LowerWidget(widget);
|
this->LowerWidget(widget);
|
||||||
GameOptionsWindow::active_tab = widget;
|
GameOptionsWindow::active_tab = widget;
|
||||||
|
|
||||||
int pane = 0;
|
int pane;
|
||||||
if (widget == WID_GO_TAB_GRAPHICS) pane = 1;
|
switch (widget) {
|
||||||
else if (widget == WID_GO_TAB_SOUND) pane = 2;
|
case WID_GO_TAB_GENERAL: pane = 0; break;
|
||||||
|
case WID_GO_TAB_GRAPHICS: pane = 1; break;
|
||||||
|
case WID_GO_TAB_SOUND: pane = 2; break;
|
||||||
|
default: NOT_REACHED();
|
||||||
|
}
|
||||||
|
|
||||||
this->GetWidget<NWidgetStacked>(WID_GO_TAB_SELECTION)->SetDisplayedPlane(pane);
|
this->GetWidget<NWidgetStacked>(WID_GO_TAB_SELECTION)->SetDisplayedPlane(pane);
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue