Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/input.js
Show First 20 Lines • Show All 854 Lines • ▼ Show 20 Lines | case "hotkeypress": | ||||
if (ev.hotkey.indexOf("selection.group.") == 0) | if (ev.hotkey.indexOf("selection.group.") == 0) | ||||
{ | { | ||||
let now = Date.now(); | let now = Date.now(); | ||||
if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey) | if (now - doublePressTimer < doublePressTime && ev.hotkey == prevHotkey) | ||||
{ | { | ||||
if (ev.hotkey.indexOf("selection.group.select.") == 0) | if (ev.hotkey.indexOf("selection.group.select.") == 0) | ||||
{ | { | ||||
let sptr = ev.hotkey.split("."); | let sptr = ev.hotkey.split("."); | ||||
performGroup("snap", sptr[3]); | performGroup("snap", sptr[3] - 1); | ||||
} | } | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
let sptr = ev.hotkey.split("."); | let sptr = ev.hotkey.split("."); | ||||
performGroup(sptr[2], sptr[3]); | performGroup(sptr[2], sptr[3] - 1); | ||||
doublePressTimer = now; | doublePressTimer = now; | ||||
prevHotkey = ev.hotkey; | prevHotkey = ev.hotkey; | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 724 Lines • ▼ Show 20 Lines | Engine.PostNetworkCommand({ | ||||
"template": g_BatchTrainingType, | "template": g_BatchTrainingType, | ||||
"count": batchedSize, | "count": batchedSize, | ||||
"pushFront": Engine.HotkeyIsPressed("session.pushorderfront") | "pushFront": Engine.HotkeyIsPressed("session.pushorderfront") | ||||
}); | }); | ||||
} | } | ||||
function performGroup(action, groupId) | function performGroup(action, groupId) | ||||
{ | { | ||||
if (g_Groups.groups[groupId] === undefined) | |||||
{ | |||||
warn("Invalid groupId " + groupId); | |||||
return; | |||||
} | |||||
switch (action) | switch (action) | ||||
{ | { | ||||
case "snap": | case "snap": | ||||
case "select": | case "select": | ||||
case "add": | case "add": | ||||
let toSelect = []; | let toSelect = []; | ||||
g_Groups.update(); | g_Groups.update(); | ||||
for (let ent in g_Groups.groups[groupId].ents) | for (let ent in g_Groups.groups[groupId].ents) | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator