Change window close/deallocation to match upstream

This commit is contained in:
Jonathan G Rennison
2023-09-15 23:56:33 +01:00
parent 79cfc3e8bd
commit f5d1b1d8f8
50 changed files with 352 additions and 341 deletions

View File

@@ -91,9 +91,10 @@ public:
this->InitNested(1);
}
~BootstrapErrorWindow()
void Close() override
{
_exit_game = true;
this->Window::Close();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
@@ -148,12 +149,13 @@ public:
{
}
~BootstrapContentDownloadStatusWindow()
void Close() override
{
/* If we are not set to exit the game, it means the bootstrap failed. */
if (!_exit_game) {
new BootstrapErrorWindow();
}
this->BaseNetworkContentDownloadStatusWindow::Close();
}
void OnDownloadComplete(ContentID cid) override
@@ -166,7 +168,7 @@ public:
/* _exit_game is used to break out of the outer video driver's MainLoop. */
_exit_game = true;
delete this;
this->Close();
}
};
@@ -205,9 +207,10 @@ public:
}
/** Stop listening to the content client events. */
~BootstrapAskForDownloadWindow()
void Close() override
{
_network_content_client.RemoveCallback(this);
this->Window::Close();
}
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
@@ -268,7 +271,7 @@ public:
/* And once the meta data is received, start downloading it. */
_network_content_client.Select(ci->id);
new BootstrapContentDownloadStatusWindow();
delete this;
this->Close();
}
};