From 5799402f7a4872d03809838dd7fa01db42bbd282 Mon Sep 17 00:00:00 2001 From: glx22 Date: Mon, 17 May 2021 15:46:38 +0200 Subject: Codechange: Rename window related DeleteXXX to match new behaviour --- src/road_gui.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/road_gui.cpp') diff --git a/src/road_gui.cpp b/src/road_gui.cpp index c12e94c16..f6ddbae41 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -292,7 +292,7 @@ struct BuildRoadToolbarWindow : Window { void Close() override { if (_game_mode == GM_NORMAL && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true); - if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false); + if (_settings_client.gui.link_terraform_toolbar) CloseWindowById(WC_SCEN_LAND_GEN, 0, false); this->Window::Close(); } @@ -313,9 +313,9 @@ struct BuildRoadToolbarWindow : Window { WID_ROT_TRUCK_STATION, WIDGET_LIST_END); if (!can_build) { - DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD); - DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD); - DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD); + CloseWindowById(WC_BUS_STATION, TRANSPORT_ROAD); + CloseWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD); + CloseWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD); } if (_game_mode != GM_EDITOR) { @@ -499,7 +499,7 @@ struct BuildRoadToolbarWindow : Window { case WID_ROT_REMOVE: if (this->IsWidgetDisabled(WID_ROT_REMOVE)) return; - DeleteWindowById(WC_SELECT_STATION, 0); + CloseWindowById(WC_SELECT_STATION, 0); ToggleRoadButton_Remove(this); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; @@ -592,11 +592,11 @@ struct BuildRoadToolbarWindow : Window { this->SetWidgetDirty(WID_ROT_ONE_WAY); } - DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD); - DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD); - DeleteWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD); - DeleteWindowById(WC_SELECT_STATION, 0); - DeleteWindowByClass(WC_BUILD_BRIDGE); + CloseWindowById(WC_BUS_STATION, TRANSPORT_ROAD); + CloseWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD); + CloseWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD); + CloseWindowById(WC_SELECT_STATION, 0); + CloseWindowByClass(WC_BUILD_BRIDGE); } void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override @@ -891,7 +891,7 @@ Window *ShowBuildRoadToolbar(RoadType roadtype) if (!Company::IsValidID(_local_company)) return nullptr; if (!ValParamRoadType(roadtype)) return nullptr; - DeleteWindowByClass(WC_BUILD_TOOLBAR); + CloseWindowByClass(WC_BUILD_TOOLBAR); _cur_roadtype = roadtype; return AllocateWindowDescFront(RoadTypeIsRoad(_cur_roadtype) ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD); @@ -975,7 +975,7 @@ static WindowDesc _build_tramway_scen_desc( */ Window *ShowBuildRoadScenToolbar(RoadType roadtype) { - DeleteWindowById(WC_SCEN_BUILD_TOOLBAR, TRANSPORT_ROAD); + CloseWindowById(WC_SCEN_BUILD_TOOLBAR, TRANSPORT_ROAD); _cur_roadtype = roadtype; return AllocateWindowDescFront(RoadTypeIsRoad(_cur_roadtype) ? &_build_road_scen_desc : &_build_tramway_scen_desc, TRANSPORT_ROAD); @@ -1098,7 +1098,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { void Close() override { - DeleteWindowById(WC_SELECT_STATION, 0); + CloseWindowById(WC_SELECT_STATION, 0); this->PickerWindowBase::Close(); } @@ -1159,7 +1159,7 @@ struct BuildRoadStationWindow : public PickerWindowBase { this->LowerWidget(_road_station_picker_orientation + WID_BROS_STATION_NE); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); - DeleteWindowById(WC_SELECT_STATION, 0); + CloseWindowById(WC_SELECT_STATION, 0); break; case WID_BROS_LT_OFF: -- cgit v1.2.3-54-g00ecf