From fb60f8f2f54525d8f17b5125253fc4aa5547fe38 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 9 Dec 2023 20:57:26 +0000 Subject: [PATCH] Codechange: Simplify BuildRailStationWindow initialization. --- src/rail_gui.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 224eb51643..13620db689 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -974,14 +974,10 @@ public: _railstation.newstations = newstation; this->CreateNestedTree(); - NWidgetStacked *newst_additions = this->GetWidget(WID_BRAS_SHOW_NEWST_ADDITIONS); - newst_additions->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); - newst_additions = this->GetWidget(WID_BRAS_SHOW_NEWST_MATRIX); - newst_additions->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); - newst_additions = this->GetWidget(WID_BRAS_SHOW_NEWST_DEFSIZE); - newst_additions->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); - newst_additions = this->GetWidget(WID_BRAS_SHOW_NEWST_RESIZE); - newst_additions->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); + this->GetWidget(WID_BRAS_SHOW_NEWST_ADDITIONS)->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); + this->GetWidget(WID_BRAS_SHOW_NEWST_MATRIX)->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); + this->GetWidget(WID_BRAS_SHOW_NEWST_DEFSIZE)->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); + this->GetWidget(WID_BRAS_SHOW_NEWST_RESIZE)->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); /* Hide the station class filter if no stations other than the default one are available. */ this->GetWidget(WID_BRAS_FILTER_CONTAINER)->SetDisplayedPlane(newstation ? 0 : SZSP_NONE); if (newstation) {