Add: data parameter in Window::Close method.

This allows passing data when closing a window, e.g. to indicate how it was closed.
This commit is contained in:
Peter Nelson
2023-10-13 12:59:15 +01:00
committed by Peter Nelson
parent cda6f24fe8
commit f379b31e28
28 changed files with 50 additions and 50 deletions

View File

@@ -90,7 +90,7 @@ struct BuildAirToolbarWindow : Window {
this->last_user_action = INVALID_WID_AT;
}
void Close() override
void Close([[maybe_unused]] int data = 0) override
{
if (this->IsWidgetLowered(WID_AT_AIRPORT)) SetViewportCatchmentStation(nullptr, true);
if (_settings_client.gui.link_terraform_toolbar) CloseWindowById(WC_SCEN_LAND_GEN, 0, false);
@@ -285,7 +285,7 @@ public:
if (selectFirstAirport) this->SelectFirstAvailableAirport(true);
}
void Close() override
void Close([[maybe_unused]] int data = 0) override
{
CloseWindowById(WC_SELECT_STATION, 0);
this->PickerWindowBase::Close();