Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/selection_panels_helpers.js
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | function changePrimarySelectionGroup(templateName, deselectGroup) | ||||
g_Selection.makePrimarySelection(templateName, | g_Selection.makePrimarySelection(templateName, | ||||
Engine.HotkeyIsPressed("session.deselectgroup") || deselectGroup); | Engine.HotkeyIsPressed("session.deselectgroup") || deselectGroup); | ||||
} | } | ||||
function performCommand(entStates, commandName) | function performCommand(entStates, commandName) | ||||
{ | { | ||||
if (!entStates.length) | if (!entStates.length) | ||||
return; | return; | ||||
// Don't check all entities, because we assume a player cannot | if (g_EntityCommands[commandName] && g_EntityCommands[commandName].getInfo(entStates)) | ||||
Silier: !g_IsObserver || ... | |||||
Done Inline Actionslooking again, actually second part should be negated because behaviour is switched for not observer with rally point and without that command Silier: looking again, actually second part should be negated because behaviour is switched for not… | |||||
// select entities from more than one player | |||||
if (!controlsPlayer(entStates[0].player) && | |||||
!(g_IsObserver && commandName == "focus-rally")) | |||||
return; | |||||
if (g_EntityCommands[commandName]) | |||||
g_EntityCommands[commandName].execute(entStates); | g_EntityCommands[commandName].execute(entStates); | ||||
} | } | ||||
function performAllyCommand(entity, commandName) | |||||
{ | |||||
if (!entity) | |||||
return; | |||||
let entState = GetEntityState(entity); | |||||
let playerState = GetSimState().players[Engine.GetPlayerID()]; | |||||
if (!playerState.isMutualAlly[entState.player] || g_IsObserver) | |||||
return; | |||||
if (g_AllyEntityCommands[commandName]) | |||||
g_AllyEntityCommands[commandName].execute(entState); | |||||
} | |||||
function performFormation(entities, formationTemplate) | function performFormation(entities, formationTemplate) | ||||
{ | { | ||||
if (!entities) | if (!entities) | ||||
return; | return; | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "formation", | "type": "formation", | ||||
"entities": entities, | "entities": entities, | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
!g_IsObserver || ...