Differential D2412 Diff 10357 binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/ProfileButton.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/ProfileButton.js
- This file was added.
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
/** | |||||
* This class deals with the button that opens the profile view page. | |||||
*/ | |||||
class ProfileButton | |||||
{ | |||||
constructor(xmppMessages, profilePage) | |||||
{ | |||||
this.profileButton = Engine.GetGUIObjectByName("profileButton"); | |||||
this.profileButton.caption = translate("Player Profile Lookup"); | |||||
this.profileButton.onPress = profilePage.openPage.bind(profilePage, false); | |||||
let onConnectionStatusChange = this.onConnectionStatusChange.bind(this); | |||||
xmppMessages.registerHandler("system", "connected", onConnectionStatusChange); | |||||
xmppMessages.registerHandler("system", "disconnected", onConnectionStatusChange); | |||||
} | |||||
onConnectionStatusChange() | |||||
{ | |||||
this.profileButton.enabled = Engine.IsXmppClientConnected(); | |||||
} | |||||
} |
Wildfire Games · Phabricator