Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/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(); | ||||
} | } | ||||
/** | |||||
* Returns the nickname without the lobby rating. | |||||
*/ | |||||
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 20 Lines • Show All 92 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator