forked from mirrors/0ad
Remove Engine.SwitchGuiPage from lobby
Since the page now isn't closed immediately, the `onTick` has to be cleared.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user