Differential D1326 Diff 5914 ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | function unloadTemplate(template, owner) | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "unload-template", | "type": "unload-template", | ||||
"all": Engine.HotkeyIsPressed("session.unloadtype"), | "all": Engine.HotkeyIsPressed("session.unloadtype"), | ||||
"template": template, | "template": template, | ||||
"owner": owner, | "owner": owner, | ||||
// Filter out all entities that aren't garrisonable. | // Filter out all entities that aren't garrisonable. | ||||
"garrisonHolders": g_Selection.toList().filter(ent => { | "garrisonHolders": g_Selection.toList().filter(ent => { | ||||
let state = GetEntityState(ent); | let state = GetEntityState(ent); | ||||
return state && state.garrisonHolder; | return state && !!state.garrisonHolder; | ||||
}) | }) | ||||
}); | }); | ||||
} | } | ||||
function unloadSelection() | function unloadSelection() | ||||
{ | { | ||||
let parent = 0; | let parent = 0; | ||||
let ents = []; | let ents = []; | ||||
Show All 17 Lines | Engine.PostNetworkCommand({ | ||||
"garrisonHolder": parent | "garrisonHolder": parent | ||||
}); | }); | ||||
} | } | ||||
function unloadAll() | function unloadAll() | ||||
{ | { | ||||
let garrisonHolders = g_Selection.toList().filter(e => { | let garrisonHolders = g_Selection.toList().filter(e => { | ||||
let state = GetEntityState(e); | let state = GetEntityState(e); | ||||
return state && state.garrisonHolder; | return state && !!state.garrisonHolder; | ||||
}); | }); | ||||
if (!garrisonHolders.length) | if (!garrisonHolders.length) | ||||
return; | return; | ||||
let ownEnts = []; | let ownEnts = []; | ||||
let otherEnts = []; | let otherEnts = []; | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator