Fix f6d5c01: Delay deletion when closing windows

This commit is contained in:
glx22
2021-05-15 23:12:25 +02:00
committed by Loïc Guilloux
parent ef991b1772
commit 994bf19aef
35 changed files with 231 additions and 166 deletions

View File

@@ -289,10 +289,11 @@ struct BuildRoadToolbarWindow : Window {
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
}
~BuildRoadToolbarWindow()
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);
this->Window::Close();
}
/**
@@ -1095,9 +1096,10 @@ struct BuildRoadStationWindow : public PickerWindowBase {
this->window_class = (rs == ROADSTOP_BUS) ? WC_BUS_STATION : WC_TRUCK_STATION;
}
virtual ~BuildRoadStationWindow()
void Close() override
{
DeleteWindowById(WC_SELECT_STATION, 0);
this->PickerWindowBase::Close();
}
void OnPaint() override