Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/functions_utility.js
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | function singleplayerName() | ||||
return Engine.ConfigDB_GetValue("user", "playername.singleplayer") || Engine.GetSystemUsername(); | return Engine.ConfigDB_GetValue("user", "playername.singleplayer") || Engine.GetSystemUsername(); | ||||
} | } | ||||
function multiplayerName() | function multiplayerName() | ||||
{ | { | ||||
return Engine.ConfigDB_GetValue("user", "playername.multiplayer") || Engine.GetSystemUsername(); | return Engine.ConfigDB_GetValue("user", "playername.multiplayer") || Engine.GetSystemUsername(); | ||||
} | } | ||||
function removeRatingFromNick(playerName) | |||||
{ | |||||
let result = /^(\S+)\ \(\d+\)$/g.exec(playerName); | |||||
return result ? result[1] : playerName; | |||||
} | |||||
function tryAutoComplete(text, autoCompleteList) | function tryAutoComplete(text, autoCompleteList) | ||||
{ | { | ||||
if (!text.length) | if (!text.length) | ||||
return text; | return text; | ||||
var wordSplit = text.split(/\s/g); | var wordSplit = text.split(/\s/g); | ||||
if (!wordSplit.length) | if (!wordSplit.length) | ||||
return text; | return text; | ||||
Show All 36 Lines | function clearChatMessages() | ||||
g_ChatMessages.length = 0; | g_ChatMessages.length = 0; | ||||
Engine.GetGUIObjectByName("chatText").caption = ""; | Engine.GetGUIObjectByName("chatText").caption = ""; | ||||
try { | try { | ||||
for (let timer of g_ChatTimers) | for (let timer of g_ChatTimers) | ||||
clearTimeout(timer); | clearTimeout(timer); | ||||
g_ChatTimers.length = 0; | g_ChatTimers.length = 0; | ||||
} catch (e) { | } catch (e) { | ||||
} | } | ||||
elexis: This is only used in lobby/ and I don't see a future usage for this outside of lobby, so ->… | |||||
} | } | ||||
/** | /** | ||||
* Plays a sound if user's nick is mentioned in chat | * Plays a sound if user's nick is mentioned in chat | ||||
*/ | */ | ||||
function notifyUser(userName, msgText) | function notifyUser(userName, msgText) | ||||
{ | { | ||||
if (Engine.ConfigDB_GetValue("user", "sound.notify.nick") != "true" || | if (Engine.ConfigDB_GetValue("user", "sound.notify.nick") != "true" || | ||||
Show All 39 Lines |
Wildfire Games · Phabricator
This is only used in lobby/ and I don't see a future usage for this outside of lobby, so -> lobby.
You have also copied that from another place in the lobby without replacing that copy with a call to this function