Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup/Chat/ChatInputPanel.js
- This file was moved from binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/Panels/Chat/ChatInputPanel.js.
class ChatInputPanel | class ChatInputPanel | ||||
{ | { | ||||
constructor(netMessages, chatInputAutocomplete) | constructor(chatInputAutocomplete) | ||||
{ | { | ||||
this.chatInputAutocomplete = chatInputAutocomplete; | this.chatInputAutocomplete = chatInputAutocomplete; | ||||
this.chatInput = Engine.GetGUIObjectByName("chatInput"); | this.chatInput = Engine.GetGUIObjectByName("chatInput"); | ||||
this.chatInput.tooltip = colorizeAutocompleteHotkey(this.Tooltip); | this.chatInput.tooltip = colorizeAutocompleteHotkey(this.Tooltip); | ||||
this.chatInput.onPress = this.onPress.bind(this); | this.chatInput.onPress = this.onPress.bind(this); | ||||
this.chatInput.onTab = this.onTab.bind(this); | this.chatInput.onTab = this.onTab.bind(this); | ||||
this.chatInput.focus(); | this.chatInput.focus(); | ||||
this.chatSubmitButton = Engine.GetGUIObjectByName("chatSubmitButton"); | this.chatSubmitButton = Engine.GetGUIObjectByName("chatSubmitButton"); | ||||
this.chatSubmitButton.onPress = this.onPress.bind(this); | this.chatSubmitButton.onPress = this.onPress.bind(this); | ||||
netMessages.registerNetMessageHandler("netstatus", this.onNetStatusMessage.bind(this)); | |||||
} | } | ||||
onNetStatusMessage(message) | setEnabled(enabled) | ||||
{ | |||||
if (message.status == "disconnected") | |||||
{ | { | ||||
reportDisconnect(message.reason, true); | this.chatInput.hidden = !enabled; | ||||
this.chatInput.hidden = true; | this.chatSubmitButton.hidden = !enabled; | ||||
this.chatSubmitButton.hidden = true; | |||||
} | |||||
} | } | ||||
onTab() | onTab() | ||||
{ | { | ||||
autoCompleteText( | autoCompleteText( | ||||
this.chatInput, | this.chatInput, | ||||
this.chatInputAutocomplete.getAutocompleteEntries()); | this.chatInputAutocomplete.getAutocompleteEntries()); | ||||
} | } | ||||
Show All 21 Lines |
Wildfire Games · Phabricator