Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/input.js
Show First 20 Lines • Show All 1,690 Lines • ▼ Show 20 Lines | if (selectall) | ||||
return; | return; | ||||
lastIdleUnit = idleUnits[0]; | lastIdleUnit = idleUnits[0]; | ||||
var entityState = GetEntityState(lastIdleUnit); | var entityState = GetEntityState(lastIdleUnit); | ||||
var position = entityState.position; | var position = entityState.position; | ||||
if (position) | if (position) | ||||
Engine.CameraMoveTo(position.x, position.z); | Engine.CameraMoveTo(position.x, position.z); | ||||
// Move the idle class index to the first class an idle unit was found for. | // Move the idle class index to the first class an idle unit was found for. | ||||
var indexChange = data.idleClasses.findIndex(elem => hasClass(entityState, elem)); | var indexChange = data.idleClasses.findIndex(elem => MatchesClassList(entityState.identity.classes, elem)); | ||||
currIdleClassIndex = (currIdleClassIndex + indexChange) % classes.length; | currIdleClassIndex = (currIdleClassIndex + indexChange) % classes.length; | ||||
} | } | ||||
function stopUnits(entities) | function stopUnits(entities) | ||||
{ | { | ||||
Engine.PostNetworkCommand({ "type": "stop", "entities": entities, "queued": false }); | Engine.PostNetworkCommand({ "type": "stop", "entities": entities, "queued": false }); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator