1
0
forked from mirrors/0ad
Files
0ad/binaries/data/mods/public/gui/prelobby/entrance/entrance.js
T
phosit bf0034f694 Close register-page before opening login-page
The `onTick` of the register-page was still running when connecting to
the lobby. This lead to an error when the `connect` message was
received.
With this commit returning from the login-page will always return to the
entrance-page. Previously it returned to the register-page when it was
opened by through that page.

(cherry picked from commit 0b83e24065)
Signed-off-by: phosit <phosit@autistici.org>
2026-01-01 16:08:46 +01:00

21 lines
436 B
JavaScript

function init()
{
if (Engine.ConfigDB_GetValue("user", "lobby.login"))
loginButton();
return new Promise(closePageCallback => {
Engine.GetGUIObjectByName("cancel").onPress = closePageCallback;
});
}
function loginButton()
{
Engine.OpenChildPage("page_prelobby_login.xml");
}
async function registerButton()
{
if (await Engine.OpenChildPage("page_prelobby_register.xml"))
Engine.OpenChildPage("page_prelobby_login.xml");
}