Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/NetworkStatusOverlay.js
/** | /** | ||||||||||
* This class shows an overlay if the game is stalled due to some clients not being | * This class shows an overlay if the game is stalled due to some clients not being | ||||||||||
* ready to simulate yet, and in that case provides specifics to that reason. | * ready to simulate yet, and in that case provides specifics to that reason. | ||||||||||
*/ | */ | ||||||||||
class NetworkStatusOverlay | class NetworkStatusOverlay | ||||||||||
{ | { | ||||||||||
constructor() | constructor() | ||||||||||
{ | { | ||||||||||
this.netStatus = Engine.GetGUIObjectByName("netStatus"); | this.netStatus = Engine.GetGUIObjectByName("netStatus"); | ||||||||||
this.loadingClientsText = Engine.GetGUIObjectByName("loadingClientsText"); | this.loadingClientsText = Engine.GetGUIObjectByName("loadingClientsText"); | ||||||||||
Engine.GetGUIObjectByName("disconnectedExitButton").onPress = endGame; | Engine.GetGUIObjectByName("disconnectedExitButton").onPress = () => { endGame(true); }; | ||||||||||
StanUnsubmitted Done Inline Actions
Stan: | |||||||||||
Done Inline Actions
Also works, but it returns the result of endGame(bool), which might not be wanted. Stan: Also works, but it returns the result of endGame(bool), which might not be wanted. | |||||||||||
registerNetworkStatusChangeHandler(this.onNetStatusMessage.bind(this)); | registerNetworkStatusChangeHandler(this.onNetStatusMessage.bind(this)); | ||||||||||
registerClientsLoadingHandler(this.onClientsLoadingMessage.bind(this)); | registerClientsLoadingHandler(this.onClientsLoadingMessage.bind(this)); | ||||||||||
} | } | ||||||||||
onNetStatusMessage(message) | onNetStatusMessage(message) | ||||||||||
{ | { | ||||||||||
if (!this.StatusCaption[message.status]) | if (!this.StatusCaption[message.status]) | ||||||||||
Show All 27 Lines |
Wildfire Games · Phabricator