Fix re-opening GRF/script settings windows not closing drop down windows

Causing assertion failure on drop down item selection

See: #527
This commit is contained in:
Jonathan G Rennison
2023-06-01 21:08:12 +01:00
parent e3bd8966fc
commit 58c0aac15f
3 changed files with 11 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ struct GSConfigWindow : public Window {
~GSConfigWindow()
{
HideDropDownMenu(this);
DeleteWindowByClass(WC_SCRIPT_LIST);
}

View File

@@ -183,6 +183,11 @@ struct NewGRFParametersWindow : public Window {
this->InvalidateData();
}
~NewGRFParametersWindow()
{
HideDropDownMenu(this);
}
/**
* Get a dummy parameter-info object with default information.
* @param nr The param number that should be changed.

View File

@@ -325,6 +325,11 @@ struct ScriptSettingsWindow : public Window {
this->RebuildVisibleSettings();
}
~ScriptSettingsWindow()
{
HideDropDownMenu(this);
}
/**
* Rebuilds the list of visible settings. AI settings with the flag
* AICONFIG_AI_DEVELOPER set will only be visible if the game setting