Fix: Closing the Game Options window closes all textfile windows.

Record the parent window that opens a textfile window so only child windows are closed instead of all.
This commit is contained in:
Peter Nelson
2025-05-04 17:50:31 +01:00
committed by Peter Nelson
parent dabf2ede67
commit ac76212b80
12 changed files with 44 additions and 45 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ struct AIConfigWindow : public Window {
if (widget >= WID_AIC_TEXTFILE && widget < WID_AIC_TEXTFILE + TFT_CONTENT_END) {
if (this->selected_slot == CompanyID::Invalid() || AIConfig::GetConfig(this->selected_slot) == nullptr) return;
ShowScriptTextfileWindow((TextfileType)(widget - WID_AIC_TEXTFILE), this->selected_slot);
ShowScriptTextfileWindow(this, (TextfileType)(widget - WID_AIC_TEXTFILE), this->selected_slot);
return;
}