Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels.js
Show First 20 Lines • Show All 925 Lines • ▼ Show 20 Lines | "getItems": function(unitEntStates) | ||||
return unitEntStates[0].unitAI.possibleStances; | return unitEntStates[0].unitAI.possibleStances; | ||||
}, | }, | ||||
"setupButton": function(data) | "setupButton": function(data) | ||||
{ | { | ||||
data.button.onPress = function() { performStance(data.unitEntStates.map(state => state.id), data.item); }; | data.button.onPress = function() { performStance(data.unitEntStates.map(state => state.id), data.item); }; | ||||
data.button.tooltip = getStanceDisplayName(data.item) + "\n" + | data.button.tooltip = getStanceDisplayName(data.item) + "\n" + | ||||
"[font=\"sans-13\"]" + getStanceTooltip(data.item) + "[/font]"; | fontText(getStanceTooltip(data.item), "sans-13"); | ||||
data.guiSelection.hidden = !Engine.GuiInterfaceCall("IsStanceSelected", { | data.guiSelection.hidden = !Engine.GuiInterfaceCall("IsStanceSelected", { | ||||
"ents": data.unitEntStates.map(state => state.id), | "ents": data.unitEntStates.map(state => state.id), | ||||
"stance": data.item | "stance": data.item | ||||
}); | }); | ||||
data.icon.sprite = "stretched:session/icons/stances/" + data.item + ".png"; | data.icon.sprite = "stretched:session/icons/stances/" + data.item + ".png"; | ||||
data.button.enabled = controlsPlayer(data.player); | data.button.enabled = controlsPlayer(data.player); | ||||
Show All 36 Lines | "setupButton": function(data) | ||||
data.button.onPress = function() { | data.button.onPress = function() { | ||||
addTrainingToQueue(data.unitEntStates.map(state => state.id), data.item, data.playerState); | addTrainingToQueue(data.unitEntStates.map(state => state.id), data.item, data.playerState); | ||||
}; | }; | ||||
data.countDisplay.caption = trainNum > 1 ? trainNum : ""; | data.countDisplay.caption = trainNum > 1 ? trainNum : ""; | ||||
let tooltips = [ | let tooltips = [ | ||||
"[font=\"sans-bold-16\"]" + | fontText( | ||||
colorizeHotkey("%(hotkey)s", "session.queueunit." + (data.i + 1)) + | colorizeHotkey("%(hotkey)s", "session.queueunit." + (data.i + 1)), | ||||
"[/font]" + " " + getEntityNamesFormatted(template), | "sans-bold-16") + " " + getEntityNamesFormatted(template), | ||||
getVisibleEntityClassesFormatted(template), | getVisibleEntityClassesFormatted(template), | ||||
getAurasTooltip(template), | getAurasTooltip(template), | ||||
getEntityTooltip(template), | getEntityTooltip(template), | ||||
getEntityCostTooltip(template, data.unitEntStates[0].id, buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch) | getEntityCostTooltip(template, data.unitEntStates[0].id, buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch) | ||||
]; | ]; | ||||
let limits = getEntityLimitAndCount(data.playerState, data.item); | let limits = getEntityLimitAndCount(data.playerState, data.item); | ||||
tooltips.push(formatLimitString(limits.entLimit, limits.entCount, limits.entLimitChangers)); | tooltips.push(formatLimitString(limits.entLimit, limits.entCount, limits.entLimitChangers)); | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator