mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Since #7786, the GUI tick completed normally after calling closePageCallback instead of being cancelled like previously. Since Engine.EndGame deletes the internal g_Game pointer, every Engine call after it that tried to access g_Game caused a segfault. This patch solves it by moving Engine.EndGame to the very end, right before closing the session page.
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/**
|
|
* This class is concerned with opening a message box if the game is in replaymode and that replay ended.
|
|
*/
|
|
class QuitConfirmationReplay extends QuitConfirmation
|
|
{
|
|
constructor(closePageCallback)
|
|
{
|
|
super();
|
|
Engine.GetGUIObjectByName("session").onReplayFinished = this.display.bind(this, closePageCallback);
|
|
}
|
|
}
|
|
|
|
QuitConfirmationReplay.prototype.Title =
|
|
translateWithContext("replayFinished", "Confirmation");
|
|
|
|
QuitConfirmationReplay.prototype.Caption =
|
|
translateWithContext("replayFinished", "The replay has finished. What do you want to do?");
|
|
|
|
QuitConfirmationReplay.prototype.Buttons =
|
|
[
|
|
{
|
|
// Translation: Shown in the Dialog that shows up when a replay finishes
|
|
"caption": translate("Stay"),
|
|
"onPress": resumeGame
|
|
},
|
|
{
|
|
// Translation: Shown in the Dialog that shows up when a replay finishes
|
|
"caption": translate("Quit and View Summary"),
|
|
"onPress": () => getNextPageOpenRequest(true)
|
|
},
|
|
{
|
|
// Translation: Shown in the Dialog that shows up when a replay finishes
|
|
"caption": translate("Quit"),
|
|
"onPress": () => getNextPageOpenRequest(false)
|
|
}
|
|
];
|