Index: binaries/data/mods/public/gui/session/selection_panels.js =================================================================== --- binaries/data/mods/public/gui/session/selection_panels.js +++ binaries/data/mods/public/gui/session/selection_panels.js @@ -42,6 +42,9 @@ }, "getItems": function(unitEntStates) { + if (unitEntStates[0]?.player == 0) + return []; + return unitEntStates.some(state => !!state.alertRaiser) ? ["raise", "end"] : []; }, "setupButton": function(data) @@ -379,6 +382,9 @@ "rowLength": 10, "getItems": function(unitEntStates) { + if (unitEntStates[0]?.player == 0) + return []; + let hideLocked = unitEntStates.every(state => !state.gate || !state.gate.locked); let hideUnlocked = unitEntStates.every(state => !state.gate || state.gate.locked); @@ -644,6 +650,9 @@ "rowLength": 10, "getItems": function(unitEntStates) { + if (unitEntStates[0]?.player == 0) + return []; + let ret = []; if (unitEntStates.length == 1) { @@ -1104,6 +1113,9 @@ "rowLength": 10, "getItems": function(unitEntStates) { + if (unitEntStates[0]?.player == 0) + return false; + // Interface becomes complicated with multiple different units and this is meant per-entity, so prevent it if the selection has multiple different units. if (unitEntStates.some(state => state.template != unitEntStates[0].template)) return false; Index: binaries/data/mods/public/gui/session/unit_commands.js =================================================================== --- binaries/data/mods/public/gui/session/unit_commands.js +++ binaries/data/mods/public/gui/session/unit_commands.js @@ -138,10 +138,10 @@ // for which the entity does not need to be owned. setupUnitPanel("Command", entStates, playerState); - if (g_IsObserver || entStates.every(entState => - controlsPlayer(entState.player) && - (!entState.identity || entState.identity.controllable)) || - playerState.controlsAll) + const isObserverOrController = g_IsObserver || entStates.every(entState => controlsPlayer(entState.player) && + (!entState.identity || entState.identity.controllable)) || playerState.controlsAll; + + if (isObserverOrController) { for (let guiName of g_PanelsOrder) { @@ -152,8 +152,11 @@ setupUnitPanel(guiName, entStates, playerStates[entStates[0].player]); } - supplementalDetailsPanel.hidden = false; - commandsPanel.hidden = false; + const panelsAreUnused = !Object.values(g_SelectionPanels).some(panel => panel.used); + const isOwnedByGaia = entStates[0].player == 0; + + supplementalDetailsPanel.hidden = panelsAreUnused; + commandsPanel.hidden = panelsAreUnused || isOwnedByGaia; } else if (playerState.isMutualAlly[entStates[0].player]) { @@ -162,7 +165,6 @@ setupUnitPanel("Garrison", entStates, playerState); supplementalDetailsPanel.hidden = !g_SelectionPanels.Garrison.used; - commandsPanel.hidden = true; } else @@ -191,6 +193,8 @@ for (let ent of selection) { let state = GetEntityState(ent); + if (state?.player == 0) + return []; if (state?.trainer?.entities?.length) { if (!state.production) Index: binaries/data/mods/public/simulation/components/GuiInterface.js =================================================================== --- binaries/data/mods/public/simulation/components/GuiInterface.js +++ binaries/data/mods/public/simulation/components/GuiInterface.js @@ -886,6 +886,9 @@ GuiInterface.prototype.GetAllBuildableEntities = function(player, cmd) { + if (IsOwnedByGaia(cmd.entities[0])) + return []; + let buildableEnts = []; for (let ent of cmd.entities) {