Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/common/gamedescription.js
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | for (let playerData of playerDataArray) | ||||
let playerDescription; | let playerDescription; | ||||
if (isAI) | if (isAI) | ||||
{ | { | ||||
if (playerData.Civ) | if (playerData.Civ) | ||||
{ | { | ||||
if (isActive) | if (isActive) | ||||
// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | // Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | ||||
playerDescription = translate("%(playerName)s (%(civ)s, %(AIdifficulty)s %(AIname)s)"); | playerDescription = translate("%(playerName)s (%(civ)s, %(AIdifficulty)s %(AIbehavior)s %(AIname)s)"); | ||||
else | else | ||||
// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | // Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | ||||
playerDescription = translate("%(playerName)s (%(civ)s, %(AIdifficulty)s %(AIname)s, %(state)s)"); | playerDescription = translate("%(playerName)s (%(civ)s, %(AIdifficulty)s %(AIbehavior)s %(AIname)s, %(state)s)"); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (isActive) | if (isActive) | ||||
// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | // Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | ||||
playerDescription = translate("%(playerName)s (%(AIdifficulty)s %(AIname)s)"); | playerDescription = translate("%(playerName)s (%(AIdifficulty)s %(AIbehavior)s %(AIname)s)"); | ||||
else | else | ||||
// Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | // Translation: Describe a player in a selected game, f.e. in the replay- or savegame menu | ||||
playerDescription = translate("%(playerName)s (%(AIdifficulty)s %(AIname)s, %(state)s)"); | playerDescription = translate("%(playerName)s (%(AIdifficulty)s %(AIbehavior)s %(AIname)s, %(state)s)"); | ||||
} | } | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
if (playerData.Offline) | if (playerData.Offline) | ||||
{ | { | ||||
// Can only occur in the lobby for now, so no strings with civ needed | // Can only occur in the lobby for now, so no strings with civ needed | ||||
if (isActive) | if (isActive) | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | playerDescriptions[teamIdx].push(sprintf(playerDescription, { | ||||
playerData.Civ, | playerData.Civ, | ||||
"state": | "state": | ||||
playerState == "defeated" ? | playerState == "defeated" ? | ||||
translateWithContext("playerstate", "defeated") : | translateWithContext("playerstate", "defeated") : | ||||
translateWithContext("playerstate", "won"), | translateWithContext("playerstate", "won"), | ||||
"AIname": isAI ? translateAIName(playerData.AI) : "", | "AIname": isAI ? translateAIName(playerData.AI) : "", | ||||
"AIdifficulty": isAI ? translateAIDifficulty(playerData.AIDiff) : "" | "AIdifficulty": isAI ? translateAIDifficulty(playerData.AIDiff) : "", | ||||
"AIbehavior": isAI ? translateAIBehavior(playerData.AIBehavior) : "" | |||||
})); | })); | ||||
} | } | ||||
let teams = Object.keys(playerDescriptions); | let teams = Object.keys(playerDescriptions); | ||||
if (teams.indexOf("observer") > -1) | if (teams.indexOf("observer") > -1) | ||||
teams.splice(teams.indexOf("observer"), 1); | teams.splice(teams.indexOf("observer"), 1); | ||||
let teamDescription = []; | let teamDescription = []; | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator