Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels.js
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | "setupButton": function(data) | ||||
data.button.tooltip = (canUngarrison || g_IsObserver ? | data.button.tooltip = (canUngarrison || g_IsObserver ? | ||||
sprintf(translate("Unload %(name)s"), { "name": getEntityNames(template) }) + "\n" + | sprintf(translate("Unload %(name)s"), { "name": getEntityNames(template) }) + "\n" + | ||||
translate("Single-click to unload 1. Shift-click to unload all of this type.") : | translate("Single-click to unload 1. Shift-click to unload all of this type.") : | ||||
getEntityNames(template)) + "\n" + | getEntityNames(template)) + "\n" + | ||||
sprintf(translate("Player: %(playername)s"), { | sprintf(translate("Player: %(playername)s"), { | ||||
"playername": g_Players[entState.player].name | "playername": g_Players[entState.player].name | ||||
}); | }); | ||||
data.guiSelection.sprite = getPlayerHighlightColor(entState.player); | data.guiSelection.sprite = "color:" + g_DiplomacyColors.getPlayerColor(entState.player, 160); | ||||
data.button.sprite_disabled = data.button.sprite; | data.button.sprite_disabled = data.button.sprite; | ||||
// Selection panel buttons only appear disabled if they | // Selection panel buttons only appear disabled if they | ||||
// also appear disabled to the owner of the building. | // also appear disabled to the owner of the building. | ||||
data.icon.sprite = | data.icon.sprite = | ||||
(canUngarrison || g_IsObserver ? "" : "grayscale:") + | (canUngarrison || g_IsObserver ? "" : "grayscale:") + | ||||
"stretched:session/portraits/" + template.icon; | "stretched:session/portraits/" + template.icon; | ||||
▲ Show 20 Lines • Show All 474 Lines • ▼ Show 20 Lines | if (data.carried) | ||||
resourceIcon(res) + data.carried[res] | resourceIcon(res) + data.carried[res] | ||||
).join(" "); | ).join(" "); | ||||
if (g_IsObserver) | if (g_IsObserver) | ||||
tooltip += "\n" + sprintf(translate("Player: %(playername)s"), { | tooltip += "\n" + sprintf(translate("Player: %(playername)s"), { | ||||
"playername": g_Players[unitOwner].name | "playername": g_Players[unitOwner].name | ||||
}); | }); | ||||
data.button.tooltip = tooltip; | data.button.tooltip = tooltip; | ||||
data.guiSelection.sprite = getPlayerHighlightColor(unitOwner); | data.guiSelection.sprite = "color:" + g_DiplomacyColors.getPlayerColor(unitOwner, 160); | ||||
data.guiSelection.hidden = !g_IsObserver; | data.guiSelection.hidden = !g_IsObserver; | ||||
data.countDisplay.caption = data.item.ents.length || ""; | data.countDisplay.caption = data.item.ents.length || ""; | ||||
data.button.onPress = function() { changePrimarySelectionGroup(data.item.key, false); }; | data.button.onPress = function() { changePrimarySelectionGroup(data.item.key, false); }; | ||||
data.button.onPressRight = function() { changePrimarySelectionGroup(data.item.key, true); }; | data.button.onPressRight = function() { changePrimarySelectionGroup(data.item.key, true); }; | ||||
if (template.icon) | if (template.icon) | ||||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator