Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_actions.js
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | "execute": function(target, action, selection, queued) | ||||
"name": "order_attack", | "name": "order_attack", | ||||
"entity": selection[0] | "entity": selection[0] | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
"getActionInfo": function(entState, targetState) | "getActionInfo": function(entState, targetState) | ||||
{ | { | ||||
if (!entState.attack || !targetState.hitpoints) | if (!entState.attack) | ||||
Freagarach: Check for `entState.capturePoints`. | |||||
Done Inline ActionstargetState.capturePoints rather. Wouldn't hurt to check that entState has a capturing attack, too. wraitii: targetState.capturePoints rather. Wouldn't hurt to check that entState has a capturing attack… | |||||
return false; | return false; | ||||
return { | return { | ||||
"possible": Engine.GuiInterfaceCall("CanAttack", { | "possible": Engine.GuiInterfaceCall("CanAttack", { | ||||
"entity": entState.id, | "entity": entState.id, | ||||
"target": targetState.id, | "target": targetState.id, | ||||
"types": ["Capture"] | "types": ["Capture"] | ||||
}) | }) | ||||
Show All 29 Lines | "execute": function(target, action, selection, queued) | ||||
"name": "order_attack", | "name": "order_attack", | ||||
"entity": selection[0] | "entity": selection[0] | ||||
}); | }); | ||||
return true; | return true; | ||||
}, | }, | ||||
"getActionInfo": function(entState, targetState) | "getActionInfo": function(entState, targetState) | ||||
{ | { | ||||
if (!entState.attack || !targetState.hitpoints) | if (!entState.attack || !targetState.hitpoints) | ||||
Done Inline Actionsthis one might get removed aswell in the secondary attacks, need to see. at least upper one is correct as it will be checked for in CanCapture (called from cmpAttack.CanAttack) bb: this one might get removed aswell in the secondary attacks, need to see. at least upper one is… | |||||
return false; | return false; | ||||
return { | return { | ||||
"possible": Engine.GuiInterfaceCall("CanAttack", { | "possible": Engine.GuiInterfaceCall("CanAttack", { | ||||
"entity": entState.id, | "entity": entState.id, | ||||
"target": targetState.id, | "target": targetState.id, | ||||
"types": ["!Capture"] | "types": ["!Capture"] | ||||
}) | }) | ||||
▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | "actionCheck": function(target, selection) | ||||
"target": target | "target": target | ||||
}; | }; | ||||
}, | }, | ||||
"specificness": 2, | "specificness": 2, | ||||
}, | }, | ||||
"cancel-setup-trade-route": | "cancel-setup-trade-route": | ||||
{ | { | ||||
"execute":function(target, action, selection, queued) | "execute":function(target, action, selection, queued) | ||||
Lint: ESLintBear (key-spacing) Missing space before value for key 'execute'. Lint: ESLintBear (key-spacing): `Missing space before value for key 'execute'.` | |||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "cancel-setup-trade-route", | "type": "cancel-setup-trade-route", | ||||
"entities": selection, | "entities": selection, | ||||
"target": action.target, | "target": action.target, | ||||
"queued": queued | "queued": queued | ||||
}); | }); | ||||
Show All 28 Lines | "actionCheck": function(target, selection) | ||||
if (!actionInfo.possible) | if (!actionInfo.possible) | ||||
return false; | return false; | ||||
return { | return { | ||||
"type": "cancel-setup-trade-route", | "type": "cancel-setup-trade-route", | ||||
"cursor": "action-cancel-setup-trade-route", | "cursor": "action-cancel-setup-trade-route", | ||||
"tooltip": actionInfo.tooltip, | "tooltip": actionInfo.tooltip, | ||||
"target": target | "target": target | ||||
} | } | ||||
Lint: ESLintBear (semi) Missing semicolon. Lint: ESLintBear (semi): `Missing semicolon.` | |||||
Lint: JSHintBear Missing semicolon. Lint: JSHintBear: `Missing semicolon.` | |||||
}, | }, | ||||
"specificness": 2, | "specificness": 2, | ||||
}, | }, | ||||
"setup-trade-route": | "setup-trade-route": | ||||
{ | { | ||||
"execute": function(target, action, selection, queued) | "execute": function(target, action, selection, queued) | ||||
{ | { | ||||
Show All 25 Lines | "getActionInfo": function(entState, targetState) | ||||
"trader": entState.id, | "trader": entState.id, | ||||
"target": targetState.id | "target": targetState.id | ||||
}); | }); | ||||
if (!tradingDetails) | if (!tradingDetails) | ||||
return false; | return false; | ||||
let tooltip; | let tooltip; | ||||
switch (tradingDetails.type) | switch (tradingDetails.type) | ||||
Lint: ESLintBear (default-case) Expected a default case. Lint: ESLintBear (default-case): `Expected a default case.` | |||||
{ | { | ||||
case "is first": | case "is first": | ||||
tooltip = translate("Origin trade market.") + "\n"; | tooltip = translate("Origin trade market.") + "\n"; | ||||
if (tradingDetails.hasBothMarkets) | if (tradingDetails.hasBothMarkets) | ||||
tooltip += sprintf(translate("Gain: %(gain)s"), { | tooltip += sprintf(translate("Gain: %(gain)s"), { | ||||
"gain": getTradingTooltip(tradingDetails.gain) | "gain": getTradingTooltip(tradingDetails.gain) | ||||
}); | }); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 1,020 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Check for entState.capturePoints.