mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Remove Engine.SwitchGuiPage from lobby
Since the page now isn't closed immediately, the `onTick` has to be cleared.
This commit is contained in:
parent
3edda64566
commit
340a4d64ca
3 changed files with 10 additions and 4 deletions
|
|
@ -3,8 +3,9 @@
|
|||
*/
|
||||
class JoinButton
|
||||
{
|
||||
constructor(dialog, gameList)
|
||||
constructor(closePageCallback, dialog, gameList)
|
||||
{
|
||||
this.closePageCallback = closePageCallback;
|
||||
this.gameList = gameList;
|
||||
|
||||
this.joinButton = Engine.GetGUIObjectByName("joinButton");
|
||||
|
|
@ -50,7 +51,11 @@ class JoinButton
|
|||
return;
|
||||
|
||||
Engine.StopXmppClient();
|
||||
Engine.SwitchGuiPage("page_modmod.xml", { "cancelbutton": true });
|
||||
delete Engine.GetGUIObjectByName("lobbyPage").onTick;
|
||||
this.closePageCallback({ [Engine.openRequest]: {
|
||||
"page": "page_modmod.xml",
|
||||
"argument": { "cancelbutton": true }
|
||||
} });
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class QuitButton
|
|||
returnToMainMenu()
|
||||
{
|
||||
Engine.StopXmppClient();
|
||||
Engine.SwitchGuiPage("page_pregame.xml");
|
||||
delete Engine.GetGUIObjectByName("lobbyPage").onTick;
|
||||
this.closePageCallback({ [Engine.openRequest]: { "page": "page_pregame.xml" } });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class LobbyPage
|
|||
"buttons": {
|
||||
"buddyButton": buddyButton,
|
||||
"accountSettingsButton": accountSettingsButton,
|
||||
"joinButton": new JoinButton(dialog, gameList),
|
||||
"joinButton": new JoinButton(closePageCallback, dialog, gameList),
|
||||
"hostButton": new HostButton(closePageCallback, dialog, xmppMessages,
|
||||
Engine.GetGUIObjectByName("hostButton"), false),
|
||||
"hostSavedGameButton": new HostButton(closePageCallback, dialog, xmppMessages,
|
||||
|
|
|
|||
Loading…
Reference in a new issue