Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/gamedescription.js
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | for (let playerData of playerDataArray) | ||||
} | } | ||||
// Sort player descriptions by team | // Sort player descriptions by team | ||||
if (!playerDescriptions[teamIdx]) | if (!playerDescriptions[teamIdx]) | ||||
playerDescriptions[teamIdx] = []; | playerDescriptions[teamIdx] = []; | ||||
playerDescriptions[teamIdx].push(sprintf(playerDescription, { | playerDescriptions[teamIdx].push(sprintf(playerDescription, { | ||||
"playerName": | "playerName": | ||||
coloredText( | setColor( | ||||
(g_Buddies.indexOf(splitRatingFromNick(playerData.Name)[0]) != -1 ? g_BuddySymbol + " " : "") + | (g_Buddies.indexOf(splitRatingFromNick(playerData.Name)[0]) != -1 ? g_BuddySymbol + " " : "") + | ||||
escapeText(playerData.Name), | escapeText(playerData.Name), | ||||
(typeof getPlayerColor == 'function' ? | (typeof getPlayerColor == 'function' ? | ||||
(isAI ? "white" : getPlayerColor(splitRatingFromNick(playerData.Name)[0])) : | (isAI ? "white" : getPlayerColor(splitRatingFromNick(playerData.Name)[0])) : | ||||
rgbToGuiColor(playerData.Color || g_Settings.PlayerDefaults[playerIdx].Color))), | rgbToGuiColor(playerData.Color || g_Settings.PlayerDefaults[playerIdx].Color))), | ||||
"civ": | "civ": | ||||
!playerData.Civ ? | !playerData.Civ ? | ||||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | if (extended) | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Cheats"), | "label": translate("Cheats"), | ||||
"value": g_GameAttributes.settings.CheatsEnabled | "value": g_GameAttributes.settings.CheatsEnabled | ||||
}); | }); | ||||
} | } | ||||
return titles.map(title => sprintf(translate("%(label)s %(details)s"), { | return titles.map(title => sprintf(translate("%(label)s %(details)s"), { | ||||
"label": coloredText(title.label, g_DescriptionHighlight), | "label": setColor(title.label, g_DescriptionHighlight), | ||||
"details": | "details": | ||||
title.value === true ? translateWithContext("gamesetup option", "enabled") : | title.value === true ? translateWithContext("gamesetup option", "enabled") : | ||||
title.value || translateWithContext("gamesetup option", "disabled") | title.value || translateWithContext("gamesetup option", "disabled") | ||||
})).join("\n"); | })).join("\n"); | ||||
} | } | ||||
/** | /** | ||||
* Sets the win/defeat icon to indicate current player's state. | * Sets the win/defeat icon to indicate current player's state. | ||||
Show All 18 Lines |
Wildfire Games · Phabricator