Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_actions.js
Show First 20 Lines • Show All 1,103 Lines • ▼ Show 20 Lines | "getInfo": function(entStates) | ||||
return { | return { | ||||
"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.garrison") + | "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.garrison") + | ||||
translate("Order the selected units to garrison in a building or unit."), | translate("Order the selected units to garrison in a building or unit."), | ||||
"icon": "garrison.png" | "icon": "garrison.png" | ||||
}; | }; | ||||
}, | }, | ||||
"execute": function() | "execute": function() | ||||
{ | { | ||||
inputState = INPUT_PRESELECTEDACTION; | g_InputEvents.SwitchToNextState("PRESELECTEDACTION"); | ||||
preSelectedAction = ACTION_GARRISON; | preSelectedAction = ACTION_GARRISON; | ||||
}, | }, | ||||
}, | }, | ||||
"unload": { | "unload": { | ||||
"getInfo": function(entStates) | "getInfo": function(entStates) | ||||
{ | { | ||||
if (entStates.every(entState => { | if (entStates.every(entState => { | ||||
Show All 24 Lines | "getInfo": function(entStates) | ||||
return { | return { | ||||
"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.repair") + | "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.repair") + | ||||
translate("Order the selected units to repair a building or mechanical unit."), | translate("Order the selected units to repair a building or mechanical unit."), | ||||
"icon": "repair.png" | "icon": "repair.png" | ||||
}; | }; | ||||
}, | }, | ||||
"execute": function() | "execute": function() | ||||
{ | { | ||||
inputState = INPUT_PRESELECTEDACTION; | g_InputEvents.SwitchToNextState("PRESELECTEDACTION"); | ||||
preSelectedAction = ACTION_REPAIR; | preSelectedAction = ACTION_REPAIR; | ||||
}, | }, | ||||
}, | }, | ||||
"focus-rally": { | "focus-rally": { | ||||
"getInfo": function(entStates) | "getInfo": function(entStates) | ||||
{ | { | ||||
if (entStates.every(entState => !entState.rallyPoint)) | if (entStates.every(entState => !entState.rallyPoint)) | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | "getInfo": function(entStates) | ||||
return { | return { | ||||
"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.guard") + | "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.guard") + | ||||
translate("Order the selected units to guard a building or unit."), | translate("Order the selected units to guard a building or unit."), | ||||
"icon": "add-guard.png" | "icon": "add-guard.png" | ||||
}; | }; | ||||
}, | }, | ||||
"execute": function() | "execute": function() | ||||
{ | { | ||||
inputState = INPUT_PRESELECTEDACTION; | g_InputEvents.SwitchToNextState("PRESELECTEDACTION"); | ||||
preSelectedAction = ACTION_GUARD; | preSelectedAction = ACTION_GUARD; | ||||
}, | }, | ||||
}, | }, | ||||
"remove-guard": { | "remove-guard": { | ||||
"getInfo": function(entStates) | "getInfo": function(entStates) | ||||
{ | { | ||||
if (entStates.every(entState => !entState.unitAI || !entState.unitAI.isGuarding)) | if (entStates.every(entState => !entState.unitAI || !entState.unitAI.isGuarding)) | ||||
Show All 37 Lines | "getInfo": function(entStates) | ||||
"tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.patrol") + | "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.patrol") + | ||||
translate("Patrol") + "\n" + | translate("Patrol") + "\n" + | ||||
translate("Attack all encountered enemy units while avoiding buildings."), | translate("Attack all encountered enemy units while avoiding buildings."), | ||||
"icon": "patrol.png" | "icon": "patrol.png" | ||||
}; | }; | ||||
}, | }, | ||||
"execute": function() | "execute": function() | ||||
{ | { | ||||
inputState = INPUT_PRESELECTEDACTION; | g_InputEvents.SwitchToNextState("PRESELECTEDACTION"); | ||||
preSelectedAction = ACTION_PATROL; | preSelectedAction = ACTION_PATROL; | ||||
}, | }, | ||||
}, | }, | ||||
"share-dropsite": { | "share-dropsite": { | ||||
"getInfo": function(entStates) | "getInfo": function(entStates) | ||||
{ | { | ||||
let sharableEntities = entStates.filter( | let sharableEntities = entStates.filter( | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator