Rename close window functions to match upstream
This commit is contained in:
@@ -381,8 +381,8 @@ struct BuildRoadToolbarWindow : Window {
|
||||
{
|
||||
if (_game_mode == GM_NORMAL && (this->IsWidgetLowered(WID_ROT_BUS_STATION) || this->IsWidgetLowered(WID_ROT_TRUCK_STATION))) SetViewportCatchmentStation(nullptr, true);
|
||||
if (_game_mode == GM_NORMAL && this->IsWidgetLowered(WID_ROT_BUILD_WAYPOINT)) SetViewportCatchmentWaypoint(nullptr, true);
|
||||
if (_settings_client.gui.link_terraform_toolbar) DeleteWindowById(WC_SCEN_LAND_GEN, 0, false);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
if (_settings_client.gui.link_terraform_toolbar) CloseWindowById(WC_SCEN_LAND_GEN, 0, false);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -403,10 +403,10 @@ 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);
|
||||
DeleteWindowById(WC_BUILD_WAYPOINT, TRANSPORT_ROAD);
|
||||
CloseWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
|
||||
CloseWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
|
||||
CloseWindowById(WC_BUILD_DEPOT, TRANSPORT_ROAD);
|
||||
CloseWindowById(WC_BUILD_WAYPOINT, TRANSPORT_ROAD);
|
||||
}
|
||||
|
||||
if (_game_mode != GM_EDITOR) {
|
||||
@@ -605,7 +605,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;
|
||||
@@ -703,12 +703,12 @@ 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_BUILD_WAYPOINT, 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_BUILD_WAYPOINT, TRANSPORT_ROAD);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowByClass(WC_BUILD_BRIDGE);
|
||||
}
|
||||
|
||||
void OnPlaceDrag(ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) override
|
||||
@@ -1037,7 +1037,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);
|
||||
@@ -1121,7 +1121,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);
|
||||
@@ -1273,7 +1273,7 @@ private:
|
||||
_roadstop_gui_settings.orientation = DIAGDIR_END;
|
||||
this->LowerWidget(_roadstop_gui_settings.orientation + WID_BROS_STATION_NE);
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
this->UpdateBuildingHeight(spec->height);
|
||||
}
|
||||
@@ -1379,7 +1379,7 @@ public:
|
||||
|
||||
virtual ~BuildRoadStationWindow()
|
||||
{
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
/** Sort classes by RoadStopClassID. */
|
||||
@@ -1688,7 +1688,7 @@ public:
|
||||
this->LowerWidget(_roadstop_gui_settings.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:
|
||||
@@ -1708,7 +1708,7 @@ public:
|
||||
this->SelectClass(class_id);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1728,7 +1728,7 @@ public:
|
||||
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
this->CheckSelectedSpec();
|
||||
break;
|
||||
}
|
||||
@@ -2037,7 +2037,7 @@ struct BuildRoadWaypointWindow : PickerWindowBase {
|
||||
|
||||
virtual ~BuildRoadWaypointWindow()
|
||||
{
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
|
||||
|
Reference in New Issue
Block a user