Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_actions.js
Show First 20 Lines • Show All 641 Lines • ▼ Show 20 Lines | "execute": function(target, action, selection, queued) | ||||
"name": "order_garrison", | "name": "order_garrison", | ||||
"entity": selection[0] | "entity": selection[0] | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
"getActionInfo": function(entState, targetState) | "getActionInfo": function(entState, targetState) | ||||
{ | { | ||||
if (!hasClass(entState, "Unit") || | if (!hasClass(entState, "Unit") || !entState.canGarrison || | ||||
Sandarac: This is needed so that the tooltip is handled properly. | |||||
Not Done Inline ActionsThe first clause is obsolete now right? Thus the hardcoding can be removed. elexis: The first clause is obsolete now right? Thus the hardcoding can be removed. | |||||
Not Done Inline ActionsOkay. Sandarac: Okay. | |||||
!targetState.garrisonHolder || | !targetState.garrisonHolder || | ||||
!playerCheck(entState, targetState, ["Player", "MutualAlly"])) | !playerCheck(entState, targetState, ["Player", "MutualAlly"])) | ||||
return false; | return false; | ||||
let tooltip = sprintf(translate("Current garrison: %(garrisoned)s/%(capacity)s"), { | let tooltip = sprintf(translate("Current garrison: %(garrisoned)s/%(capacity)s"), { | ||||
"garrisoned": targetState.garrisonHolder.garrisonedEntitiesCount, | "garrisoned": targetState.garrisonHolder.garrisonedEntitiesCount, | ||||
"capacity": targetState.garrisonHolder.capacity | "capacity": targetState.garrisonHolder.capacity | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 820 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
This is needed so that the tooltip is handled properly.