Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | case "passive": | ||||
return translateWithContext("stance", "Flee if attacked"); | return translateWithContext("stance", "Flee if attacked"); | ||||
case "standground": | case "standground": | ||||
return translateWithContext("stance", "Attack opponents in range, but don't move"); | return translateWithContext("stance", "Attack opponents in range, but don't move"); | ||||
default: | default: | ||||
return ""; | return ""; | ||||
} | } | ||||
} | } | ||||
function getPrefAttackDisplayName(name) | |||||
{ | |||||
switch (name) | |||||
{ | |||||
case "Default": | |||||
return translateWithContext("attack type", "Default"); | |||||
case "Capture": | |||||
return translateWithContext("attack type", "Capture"); | |||||
case "Ranged": | |||||
return translateWithContext("attack type", "Ranged"); | |||||
case "Melee": | |||||
return translateWithContext("attack type", "Melee"); | |||||
default: | |||||
warn("Internationalization: Unexpected attack type found: " + name); | |||||
return name; | |||||
} | |||||
} | |||||
function getPrefAttackTooltip(name) | |||||
{ | |||||
switch (name) | |||||
{ | |||||
case "Default": | |||||
return translateWithContext("attack type", "Let the unit decide."); | |||||
case "Capture": | |||||
return translateWithContext("attack type", "Prefer Capture attack."); | |||||
case "Ranged": | |||||
return translateWithContext("attack type", "Prefer Ranged attack."); | |||||
case "Melee": | |||||
return translateWithContext("attack type", "Prefer Melee attack."); | |||||
default: | |||||
return ""; | |||||
} | |||||
} | |||||
Freagarach: Can be generalised. | |||||
/** | /** | ||||
* Format entity count/limit message for the tooltip | * Format entity count/limit message for the tooltip | ||||
*/ | */ | ||||
function formatLimitString(trainEntLimit, trainEntCount, trainEntLimitChangers) | function formatLimitString(trainEntLimit, trainEntCount, trainEntLimitChangers) | ||||
{ | { | ||||
if (trainEntLimit == undefined) | if (trainEntLimit == undefined) | ||||
return ""; | return ""; | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | function performStance(entities, stanceName) | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "stance", | "type": "stance", | ||||
"entities": entities, | "entities": entities, | ||||
"name": stanceName | "name": stanceName | ||||
}); | }); | ||||
} | } | ||||
function performPrefAttack(entities, prefAttackType) | |||||
{ | |||||
if (!entities) | |||||
return; | |||||
Engine.PostNetworkCommand({ | |||||
"type": "prefAttackType", | |||||
"entities": entities, | |||||
"name": prefAttackType | |||||
}); | |||||
} | |||||
function lockGate(lock) | function lockGate(lock) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "lock-gate", | "type": "lock-gate", | ||||
"entities": g_Selection.toList(), | "entities": g_Selection.toList(), | ||||
"lock": lock | "lock": lock | ||||
}); | }); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Can be generalised.