Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/gamedescription.js
Show First 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | return titles.map(title => sprintf(translate("%(label)s %(details)s"), { | ||||
"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. | ||||
* @param {string} state - The current in-game state of the player. | |||||
* @param {string} imageID - The name of the XML image object to update. | |||||
*/ | */ | ||||
function setOutcomeIcon(state, imageID) | function setOutcomeIcon(state, image) | ||||
{ | { | ||||
let image = Engine.GetGUIObjectByName(imageID); | |||||
if (state == "won") | if (state == "won") | ||||
{ | { | ||||
image.sprite = "stretched:session/icons/victory.png"; | image.sprite = "stretched:session/icons/victory.png"; | ||||
image.tooltip = translate("Victorious"); | image.tooltip = translate("Victorious"); | ||||
} | } | ||||
else if (state == "defeated") | else if (state == "defeated") | ||||
{ | { | ||||
image.sprite = "stretched:session/icons/defeat.png"; | image.sprite = "stretched:session/icons/defeat.png"; | ||||
Show All 15 Lines |
Wildfire Games · Phabricator