Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | function unloadAllTurrets() | ||||
if (ownedHolders.length) | if (ownedHolders.length) | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "unload-turrets", | "type": "unload-turrets", | ||||
"entities": ownedHolders | "entities": ownedHolders | ||||
}); | }); | ||||
} | } | ||||
function leaveTurretPoints() | |||||
{ | |||||
let entities = g_Selection.toList().filter(entity => { | |||||
let entState = GetEntityState(entity); | |||||
return entState && entState.turretable && | |||||
entState.turretable.holder != INVALID_ENTITY; | |||||
}); | |||||
Engine.PostNetworkCommand({ | |||||
"type": "leave-turret", | |||||
"entities": entities | |||||
}); | |||||
} | |||||
function backToWork() | function backToWork() | ||||
{ | { | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "back-to-work", | "type": "back-to-work", | ||||
// Filter out all entities that can't go back to work. | // Filter out all entities that can't go back to work. | ||||
"entities": g_Selection.toList().filter(ent => { | "entities": g_Selection.toList().filter(ent => { | ||||
let state = GetEntityState(ent); | let state = GetEntityState(ent); | ||||
return state && state.unitAI && state.unitAI.hasWorkOrders; | return state && state.unitAI && state.unitAI.hasWorkOrders; | ||||
Show All 37 Lines |
Wildfire Games · Phabricator