Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/gamedescription.js
/** | /** | ||||
* Color for indicating the user in the playerlist and the game where he is listed. | |||||
*/ | |||||
var g_UserColor = "blue"; | |||||
/** | |||||
* Highlights the victory condition in the game-description. | * Highlights the victory condition in the game-description. | ||||
*/ | */ | ||||
var g_DescriptionHighlight = "orange"; | var g_DescriptionHighlight = "orange"; | ||||
/** | /** | ||||
* The rating assigned to lobby players who didn't complete a ranked 1v1 yet. | * The rating assigned to lobby players who didn't complete a ranked 1v1 yet. | ||||
*/ | */ | ||||
var g_DefaultLobbyRating = 1200; | var g_DefaultLobbyRating = 1200; | ||||
/** | /** | ||||
* XEP-0172 doesn't restrict nicknames, but our lobby policy does. | * XEP-0172 doesn't restrict nicknames, but our lobby policy does. | ||||
* So use this human readable delimiter to separate buddy names in the config file. | * So use this human readable delimiter to separate buddy names in the config file. | ||||
*/ | */ | ||||
var g_BuddyListDelimiter = ","; | var g_BuddyListDelimiter = ","; | ||||
/** | /** | ||||
* Returns the nickname without the lobby rating. | * Returns the nickname without the lobby rating. | ||||
*/ | */ | ||||
function splitRatingFromNick(playerName) | function splitRatingFromNick(playerName) | ||||
{ | { | ||||
let result = /^(\S+)\ \((\d+)\)$/g.exec(playerName); | let result = /^(\S+)\ \((\d+)\)$/g.exec(playerName); | ||||
if (!result) | if (!result) | ||||
return [playerName, ""]; | return [playerName, ""]; | ||||
return [result[1], +result[2]]; | return [result[1], +result[2]]; | ||||
} | } | ||||
/** | /** | ||||
* Array of playernames that the current user has marked as buddies. | * Array of playernames that the current user has marked as buddies. | ||||
*/ | */ | ||||
var g_Buddies = Engine.ConfigDB_GetValue("user", "lobby.buddies").split(g_BuddyListDelimiter); | var g_Buddies = Engine.ConfigDB_GetValue("user", "lobby.buddies").split(g_BuddyListDelimiter); | ||||
/** | /** | ||||
* Denotes which players are a lobby buddy of the current user. | * Denotes which players are a lobby buddy of the current user. | ||||
*/ | */ | ||||
var g_BuddySymbol = '•'; | var g_BuddySymbol = '•'; | ||||
/** | /** | ||||
* Denotes which player are a lobby is the current user. | |||||
*/ | |||||
var g_UserSymbol = '‣'; | |||||
/** | |||||
* Returns map description and preview image or placeholder. | * Returns map description and preview image or placeholder. | ||||
*/ | */ | ||||
function getMapDescriptionAndPreview(mapType, mapName) | function getMapDescriptionAndPreview(mapType, mapName) | ||||
{ | { | ||||
let mapData; | let mapData; | ||||
if (mapType == "random" && mapName == "random") | if (mapType == "random" && mapName == "random") | ||||
mapData = { "settings": { "Description": translate("A randomly selected map.") } }; | mapData = { "settings": { "Description": translate("A randomly selected map.") } }; | ||||
else if (mapType == "random" && Engine.FileExists(mapName + ".json")) | else if (mapType == "random" && Engine.FileExists(mapName + ".json")) | ||||
▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator