Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_details.js
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | else | |||||||||
resourceCarryingText.hidden = true; | resourceCarryingText.hidden = true; | |||||||||
} | } | |||||||||
Engine.GetGUIObjectByName("player").caption = playerName; | Engine.GetGUIObjectByName("player").caption = playerName; | |||||||||
Engine.GetGUIObjectByName("playerColorBackground").sprite = | Engine.GetGUIObjectByName("playerColorBackground").sprite = | |||||||||
"color:" + g_DiplomacyColors.getPlayerColor(entState.player, 128); | "color:" + g_DiplomacyColors.getPlayerColor(entState.player, 128); | |||||||||
Engine.GetGUIObjectByName("primary").caption = primaryName; | const primaryObject = Engine.GetGUIObjectByName("primary"); | |||||||||
primaryObject.caption = primaryName; | ||||||||||
Freagarach: I guess this info should be left out of the XML then?
Maybe two separate elements, one when… | ||||||||||
Not Done Inline ActionsWe can get rid of the magic numbers here, by storing the 2 in the xml (make some object containing the texts with has the 2 pixel spacing) and compute the height of the text by with .getTextSize().height. bb: We can get rid of the magic numbers here, by storing the 2 in the xml (make some object… | ||||||||||
const primaryObjectSize = primaryObject.size; | ||||||||||
Not Done Inline ActionsSame, we should compute the middle from the given box available. Again use some .getTextSize().height. bb: Same, we should compute the middle from the given box available. Again use some `.getTextSize(). | ||||||||||
Not Done Inline Actions
bb: | ||||||||||
Not Done Inline ActionsIn fact even better maybe, is to just make the box of text be the full space and vAlign the text to centre bb: In fact even better maybe, is to just make the box of text be the full space and vAlign the… | ||||||||||
primaryObjectSize.rbottom = secondaryName ? 50 : 100; | ||||||||||
if (secondaryName == primaryName) | ||||||||||
bbUnsubmitted Not Done Inline Actionsmerge this in the ternary above. Maybe we should store bb: merge this in the ternary above. Maybe we should store
`const hasSecondary = !secondaryName ||… | ||||||||||
{ | ||||||||||
primaryObjectSize.rbottom = 100; | ||||||||||
Lint: indent Expected indentation of 2 tabs but found 1. Lint: indent: Expected indentation of 2 tabs but found 1. | ||||||||||
} | ||||||||||
primaryObject.size = primaryObjectSize; | ||||||||||
Not Done Inline Actions
(Yes const looks weird but is correct) bb: (Yes const looks weird but is correct) | ||||||||||
Engine.GetGUIObjectByName("secondary").caption = !secondaryName || primaryName == secondaryName ? "" : | Engine.GetGUIObjectByName("secondary").caption = !secondaryName || primaryName == secondaryName ? "" : | |||||||||
sprintf(translate("(%(secondaryName)s)"), { | sprintf(translate("(%(secondaryName)s)"), { | |||||||||
"secondaryName": secondaryName | "secondaryName": secondaryName | |||||||||
}); | }); | |||||||||
Not Done Inline Actionsmy bad, this naming is awful... bb: my bad, this naming is awful... | ||||||||||
let isGaia = playerState.civ == "gaia"; | let isGaia = playerState.civ == "gaia"; | |||||||||
Engine.GetGUIObjectByName("playerCivIcon").sprite = isGaia ? "" : "cropped:1.0, 0.15625 center:grayscale:" + civEmblem; | Engine.GetGUIObjectByName("playerCivIcon").sprite = isGaia ? "" : "cropped:1.0, 0.15625 center:grayscale:" + civEmblem; | |||||||||
Engine.GetGUIObjectByName("player").tooltip = isGaia ? "" : civName; | Engine.GetGUIObjectByName("player").tooltip = isGaia ? "" : civName; | |||||||||
// TODO: we should require all entities to have icons | // TODO: we should require all entities to have icons | |||||||||
Engine.GetGUIObjectByName("icon").sprite = template.icon ? ("stretched:session/portraits/" + template.icon) : "BackgroundBlack"; | Engine.GetGUIObjectByName("icon").sprite = template.icon ? ("stretched:session/portraits/" + template.icon) : "BackgroundBlack"; | |||||||||
if (template.icon) | if (template.icon) | |||||||||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I guess this info should be left out of the XML then?
Maybe two separate elements, one when both are present and one when only is present?