Changeset View
Standalone View
binaries/data/mods/public/gui/session/menu.js
Context not available. | |||||
}); | }); | ||||
} | } | ||||
function openChat(teamChat = false) | function openChat(command) | ||||
{ | { | ||||
if (g_Disconnected) | if (g_Disconnected) | ||||
return; | return; | ||||
Sandarac: There shouldn't be a space after `teamChat = false` | |||||
Not Done Inline ActionsIf this were a string argument having the possible balues "team", "public" and "private" would exclude argument combinations that don't make sense (true, true for example). Hypothetically we might want to extend this in the future (observer hotkey for players), then that problem would increase. elexis: If this were a string argument having the possible balues "team", "public" and "private" would… | |||||
Context not available. | |||||
closeOpenDialogs(); | closeOpenDialogs(); | ||||
let chatAddressee = Engine.GetGUIObjectByName("chatAddressee"); | let chatAddressee = Engine.GetGUIObjectByName("chatAddressee"); | ||||
let command = teamChat ? (g_IsObserver ? "/observers" : "/allies") : ""; | |||||
chatAddressee.selected = chatAddressee.list_data.indexOf(command); | chatAddressee.selected = chatAddressee.list_data.indexOf(command); | ||||
Engine.GetGUIObjectByName("chatInput").focus(); | Engine.GetGUIObjectByName("chatInput").focus(); | ||||
Context not available. | |||||
Not Done Inline ActionsOpening braces should start on a new line: http://trac.wildfiregames.com/wiki/Coding_Conventions#Formatting Sandarac: Opening braces should start on a new line: http://trac.wildfiregames. | |||||
Not Done Inline ActionsWe have { on a separate line and no pair of braces if there is only one statement in the scope elexis: We have { on a separate line and no pair of braces if there is only one statement in the scope | |||||
Not Done Inline ActionsThis persistance can be done in updateChatAddressees then I guess. Also the "3" check is suboptimal as that manifests an assumption which could change in the future (rather had a check for a human readable string, or better avoid it altogether as far as possible) By removing the check, pressing the hotkey would mean the previously selected addresse will be reselected, so if public was selected public will be selected again, if observers are selected, observers will be selected again, if Imarok was selected, Imarok will be selected again. Sounds even more useful than the original ticket description. If you change person to addressee, then it's not only more consistent with the phrasing otherwise, but also describes this function correctly, right? elexis: This persistance can be done in `updateChatAddressees` then I guess. Also the "3" check is… | |||||
Not Done Inline Actionsnope Imarok: nope |
There shouldn't be a space after teamChat = false