Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/input.js
Show All 12 Lines | |||||
// case any other code wants to use them too. | // case any other code wants to use them too. | ||||
const ACTION_NONE = 0; | const ACTION_NONE = 0; | ||||
const ACTION_GARRISON = 1; | const ACTION_GARRISON = 1; | ||||
const ACTION_REPAIR = 2; | const ACTION_REPAIR = 2; | ||||
const ACTION_GUARD = 3; | const ACTION_GUARD = 3; | ||||
const ACTION_PATROL = 4; | const ACTION_PATROL = 4; | ||||
const ACTION_OCCUPY_TURRET = 5; | const ACTION_OCCUPY_TURRET = 5; | ||||
const ACTION_CALLTOARMS = 6; | |||||
var preSelectedAction = ACTION_NONE; | var preSelectedAction = ACTION_NONE; | ||||
const INPUT_NORMAL = 0; | const INPUT_NORMAL = 0; | ||||
const INPUT_SELECTING = 1; | const INPUT_SELECTING = 1; | ||||
const INPUT_BANDBOXING = 2; | const INPUT_BANDBOXING = 2; | ||||
const INPUT_BUILDING_PLACEMENT = 3; | const INPUT_BUILDING_PLACEMENT = 3; | ||||
const INPUT_BUILDING_CLICK = 4; | const INPUT_BUILDING_CLICK = 4; | ||||
const INPUT_BUILDING_DRAG = 5; | const INPUT_BUILDING_DRAG = 5; | ||||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | if (!fromMiniMap) | ||||
let ent = Engine.PickEntityAtPoint(x, y); | let ent = Engine.PickEntityAtPoint(x, y); | ||||
if (ent != INVALID_ENTITY) | if (ent != INVALID_ENTITY) | ||||
target = ent; | target = ent; | ||||
} | } | ||||
// Decide between the following ordered actions, | // Decide between the following ordered actions, | ||||
// if two actions are possible, the first one is taken | // if two actions are possible, the first one is taken | ||||
// thus the most specific should appear first. | // thus the most specific should appear first. | ||||
Freagarach: Not in scope to change here. | |||||
if (preSelectedAction != ACTION_NONE) | if (preSelectedAction != ACTION_NONE) | ||||
{ | { | ||||
for (let action of g_UnitActionsSortedKeys) | for (let action of g_UnitActionsSortedKeys) | ||||
if (g_UnitActions[action].preSelectedActionCheck) | if (g_UnitActions[action].preSelectedActionCheck) | ||||
{ | { | ||||
let r = g_UnitActions[action].preSelectedActionCheck(target, selection); | let r = g_UnitActions[action].preSelectedActionCheck(target, selection); | ||||
if (r) | if (r) | ||||
return r; | return r; | ||||
▲ Show 20 Lines • Show All 1,454 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Not in scope to change here.