Differential D2577 Diff 11116 ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/LoadingPage/LoadingPage.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/gamesetup/Pages/LoadingPage/LoadingPage.js
/** | /** | ||||
* The purpose of this page is to display a placeholder in multiplayer until the settings from the server have been received. | * The purpose of this page is to display a placeholder in multiplayer until the settings from the server have been received. | ||||
* This is not technically necessary, but only performed to avoid confusion or irritation when showing the clients first the | * This is not technically necessary, but only performed to avoid confusion or irritation when showing the clients first the | ||||
* default settings and then switching to the server settings quickly thereafter. | * default settings and then switching to the server settings quickly thereafter. | ||||
*/ | */ | ||||
class LoadingPage | SetupWindowPages.LoadingPage = class | ||||
{ | { | ||||
constructor(netMessages) | constructor(setupWindow) | ||||
{ | { | ||||
if (g_IsNetworked) | if (g_IsNetworked) | ||||
netMessages.registerNetMessageHandler("gamesetup", this.hideLoadingPage.bind(this)); | setupWindow.controls.netMessages.registerNetMessageHandler("gamesetup", this.hideLoadingPage.bind(this)); | ||||
else | else | ||||
this.hideLoadingPage(); | this.hideLoadingPage(); | ||||
} | } | ||||
hideLoadingPage() | hideLoadingPage() | ||||
{ | { | ||||
let loadingPage = Engine.GetGUIObjectByName("loadingPage"); | let loadingPage = Engine.GetGUIObjectByName("loadingPage"); | ||||
if (loadingPage.hidden) | if (loadingPage.hidden) | ||||
return; | return; | ||||
loadingPage.hidden = true; | loadingPage.hidden = true; | ||||
Engine.GetGUIObjectByName("setupWindow").hidden = false; | Engine.GetGUIObjectByName("setupWindow").hidden = false; | ||||
} | } | ||||
} | } |
Wildfire Games · Phabricator