Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_actions.js
Show First 20 Lines • Show All 1,163 Lines • ▼ Show 20 Lines | "getInfo": function(entStates) | ||||
return { | return { | ||||
"tooltip": colorizeHotkey("%(hotkey)s" + " ", "camera.rallypointfocus") + | "tooltip": colorizeHotkey("%(hotkey)s" + " ", "camera.rallypointfocus") + | ||||
translate("Focus on Rally Point."), | translate("Focus on Rally Point."), | ||||
"icon": "focus-rally.png" | "icon": "focus-rally.png" | ||||
}; | }; | ||||
}, | }, | ||||
"execute": function(entStates) | "execute": function(entStates) | ||||
{ | { | ||||
// TODO: Would be nicer to cycle between the rallypoints of multiple entities instead of just using the first | // TODO: Would be nicer to cycle between the rallypoints of multiple entities instead of just using the first, | ||||
// this would require Keydown event on the hotkey | |||||
elexis: Why should this be done with Keydown rather than Press? | |||||
Not Done Inline ActionsSo we have the same behaviour as the idle unit hotkey and we can cycle through fast, could remove if wanted bb: So we have the same behaviour as the idle unit hotkey and we can cycle through fast, could… | |||||
Not Done Inline ActionsI thought of the primary use case for keydown for idle units as being able to select many of them quickly, but switching quickly might be a usecase too if you will. elexis: I thought of the primary use case for keydown for idle units as being able to select many of… | |||||
Not Done Inline Actions(If half of the hotkeys use Keydown, then we don't need the additional advertizement here, idc though. Feature implementation can be described in tickets or be avoided by actual implementation) elexis: (If half of the hotkeys use Keydown, then we don't need the additional advertizement here, idc… | |||||
let focusTarget; | let focusTarget; | ||||
for (let entState of entStates) | for (let entState of entStates) | ||||
if (entState.rallyPoint && entState.rallyPoint.position) | if (entState.rallyPoint && entState.rallyPoint.position) | ||||
{ | { | ||||
focusTarget = entState.rallyPoint.position; | focusTarget = entState.rallyPoint.position; | ||||
break; | break; | ||||
} | } | ||||
if (!focusTarget) | if (!focusTarget) | ||||
▲ Show 20 Lines • Show All 362 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Why should this be done with Keydown rather than Press?