1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 18:02:37 +01:00

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

View File

@@ -2323,7 +2323,7 @@ struct NetworkAskSurveyWindow : public Window {
{
switch (widget) {
case WID_NAS_PREVIEW:
ShowSurveyResultTextfileWindow();
ShowSurveyResultTextfileWindow(this);
break;
case WID_NAS_LINK:
@@ -2388,7 +2388,7 @@ void ShowNetworkAskSurvey()
struct SurveyResultTextfileWindow : public TextfileWindow {
const GRFConfig *grf_config; ///< View the textfile of this GRFConfig.
SurveyResultTextfileWindow(TextfileType file_type) : TextfileWindow(file_type)
SurveyResultTextfileWindow(Window *parent, TextfileType file_type) : TextfileWindow(parent, file_type)
{
this->ConstructWindow();
@@ -2398,8 +2398,8 @@ struct SurveyResultTextfileWindow : public TextfileWindow {
}
};
void ShowSurveyResultTextfileWindow()
void ShowSurveyResultTextfileWindow(Window *parent)
{
CloseWindowById(WC_TEXTFILE, TFT_SURVEY_RESULT);
new SurveyResultTextfileWindow(TFT_SURVEY_RESULT);
parent->CloseChildWindowById(WC_TEXTFILE, TFT_SURVEY_RESULT);
new SurveyResultTextfileWindow(parent, TFT_SURVEY_RESULT);
}