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 @@ -134,10 +134,7 @@ data.countDisplay.caption = data.item.count || ""; - data.button.enabled = - g_IsObserver && data.item.name == "focus-rally" || - controlsPlayer(data.player) && (data.item.name != "delete" || - data.unitEntStates.some(state => !isUndeletable(state))); + data.button.enabled = data.item.enabled == true; data.icon.sprite = "stretched:session/icons/" + data.item.icon; @@ -153,59 +150,6 @@ } }; -g_SelectionPanels.AllyCommand = { - "getMaxNumberOfItems": function() - { - return 2; - }, - "conflictsWith": ["Command"], - "getItems": function(unitEntStates) - { - let commands = []; - for (let command in g_AllyEntityCommands) - for (let state of unitEntStates) - { - let info = g_AllyEntityCommands[command].getInfo(state); - if (info) - { - info.name = command; - commands.push(info); - break; - } - } - return commands; - }, - "setupButton": function(data) - { - data.button.tooltip = data.item.tooltip; - - data.button.onPress = function() { - if (data.item.callback) - data.item.callback(data.item); - else - performAllyCommand(data.unitEntStates[0].id, data.item.name); - }; - - data.countDisplay.caption = data.item.count || ""; - - data.button.enabled = !!data.item.count; - - let grayscale = data.button.enabled ? "" : "grayscale:"; - data.icon.sprite = "stretched:" + grayscale + "session/icons/" + data.item.icon; - - let size = data.button.size; - // relative to the center ( = 50%) - size.rleft = 50; - size.rright = 50; - // offset from the center calculation, count on square buttons, so size.bottom is the width too - size.left = (data.i - data.numberOfItems / 2) * (size.bottom + 1); - size.right = size.left + size.bottom; - data.button.size = size; - - return true; - } -}; - g_SelectionPanels.Construction = { "getMaxNumberOfItems": function() { @@ -1181,7 +1125,6 @@ // UNIQUE PANES (importance doesn't matter) "Command", - "AllyCommand", "Queue", "Selection", ]; Index: binaries/data/mods/public/gui/session/selection_panels_helpers.js =================================================================== --- binaries/data/mods/public/gui/session/selection_panels_helpers.js +++ binaries/data/mods/public/gui/session/selection_panels_helpers.js @@ -240,30 +240,10 @@ if (!entStates.length) return; - // Don't check all entities, because we assume a player cannot - // select entities from more than one player - if (!controlsPlayer(entStates[0].player) && - !(g_IsObserver && commandName == "focus-rally")) - return; - - if (g_EntityCommands[commandName]) + if (g_EntityCommands[commandName] && g_EntityCommands[commandName].getInfo(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) { if (!entities) Index: binaries/data/mods/public/gui/session/selection_panels_middle/unit_ally_commands.xml =================================================================== --- binaries/data/mods/public/gui/session/selection_panels_middle/unit_ally_commands.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -