Change window close/deallocation to match upstream

This commit is contained in:
Jonathan G Rennison
2023-09-15 23:56:33 +01:00
parent 79cfc3e8bd
commit f5d1b1d8f8
50 changed files with 352 additions and 341 deletions

View File

@@ -515,12 +515,13 @@ struct BuildRailToolbarWindow : Window {
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
}
~BuildRailToolbarWindow()
void Close() override
{
if (this->IsWidgetLowered(WID_RAT_BUILD_STATION)) SetViewportCatchmentStation(nullptr, true);
if (this->IsWidgetLowered(WID_RAT_BUILD_WAYPOINT)) SetViewportCatchmentWaypoint(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) CloseWindowById(WC_SCEN_LAND_GEN, 0, false);
CloseWindowById(WC_SELECT_STATION, 0);
this->Window::Close();
}
/**
@@ -1249,9 +1250,10 @@ public:
this->InvalidateData();
}
virtual ~BuildRailStationWindow()
void Close() override
{
CloseWindowById(WC_SELECT_STATION, 0);
this->PickerWindowBase::Close();
}
/** Sort station classes by StationClassID. */
@@ -1979,11 +1981,12 @@ public:
this->OnInvalidateData();
}
~BuildSignalWindow()
void Close() override
{
_convert_signal_button = false;
_trace_restrict_button = false;
_program_signal_button = false;
this->PickerWindowBase::Close();
}
void OnInit() override
@@ -2516,9 +2519,10 @@ struct BuildRailWaypointWindow : PickerWindowBase {
}
}
virtual ~BuildRailWaypointWindow()
void Close() override
{
CloseWindowById(WC_SELECT_STATION, 0);
this->PickerWindowBase::Close();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override