Codechange: Rename window related DeleteXXX to match new behaviour

This commit is contained in:
glx22
2021-05-17 15:46:38 +02:00
committed by Loïc Guilloux
parent 994bf19aef
commit 5799402f7a
63 changed files with 253 additions and 253 deletions

View File

@@ -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<BuildRoadToolbarWindow>(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<BuildRoadToolbarWindow>(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: