Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels.js
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | data.button.onPress = function() { | ||||
performCommand(data.unitEntStates, data.item.name); | performCommand(data.unitEntStates, data.item.name); | ||||
}; | }; | ||||
data.countDisplay.caption = data.item.count || ""; | data.countDisplay.caption = data.item.count || ""; | ||||
data.button.enabled = | data.button.enabled = | ||||
g_IsObserver && data.item.name == "focus-rally" || | g_IsObserver && data.item.name == "focus-rally" || | ||||
controlsPlayer(data.player) && (data.item.name != "delete" || | controlsPlayer(data.player) && (data.item.name != "delete" || | ||||
data.unitEntStates.some(state => !isUndeletable(state))); | data.unitEntStates.some(state => !isUndeletable(state))) && | ||||
(!data.item.active || data.item.active == "true"); | |||||
Freagarach: Could also be used for "delete"? | |||||
data.icon.sprite = "stretched:session/icons/" + data.item.icon; | data.icon.sprite = "stretched:session/icons/" + data.item.icon; | ||||
let size = data.button.size; | let size = data.button.size; | ||||
// relative to the center ( = 50%) | // relative to the center ( = 50%) | ||||
size.rleft = 50; | size.rleft = 50; | ||||
size.rright = 50; | size.rright = 50; | ||||
// offset from the center calculation, count on square buttons, so size.bottom is the width too | // offset from the center calculation, count on square buttons, so size.bottom is the width too | ||||
▲ Show 20 Lines • Show All 1,040 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Could also be used for "delete"?