Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/unit_commands.js
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | function updateUnitCommands(entStates, supplementalDetailsPanel, commandsPanel) | ||||
// If the selection is friendly units, add the command panels | // If the selection is friendly units, add the command panels | ||||
// Get player state to check some constraints | // Get player state to check some constraints | ||||
// e.g. presence of a hero or build limits | // e.g. presence of a hero or build limits | ||||
let playerStates = GetSimState().players; | let playerStates = GetSimState().players; | ||||
let playerState = playerStates[Engine.GetPlayerID()]; | let playerState = playerStates[Engine.GetPlayerID()]; | ||||
if (g_IsObserver || entStates.every(entState => controlsPlayer(entState.player))) | // Always show selection. | ||||
setupUnitPanel("Selection", entStates, playerStates[entStates[0].player]); | |||||
if (g_IsObserver || entStates.every(entState => controlsPlayer(entState.player) && (!entState.unitAI || entState.unitAI.isControllable))) | |||||
{ | { | ||||
for (let guiName of g_PanelsOrder) | for (let guiName of g_PanelsOrder) | ||||
{ | { | ||||
if (g_SelectionPanels[guiName].conflictsWith && | if (g_SelectionPanels[guiName].conflictsWith && | ||||
g_SelectionPanels[guiName].conflictsWith.some(p => g_SelectionPanels[p].used)) | g_SelectionPanels[guiName].conflictsWith.some(p => g_SelectionPanels[p].used)) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator