Index: binaries/data/mods/public/gui/session/selection.js =================================================================== --- binaries/data/mods/public/gui/session/selection.js +++ binaries/data/mods/public/gui/session/selection.js @@ -180,11 +180,11 @@ /** * Deselect everything but entities of the chosen type. */ -EntitySelection.prototype.makePrimarySelection = function(key) +EntitySelection.prototype.makePrimarySelection = function(key, ignoreFormations = false) { const ents = this.groups.getEntsByKey(key); this.reset(); - this.addList(ents); + this.addList(ents, false, false, ignoreFormations); }; /** @@ -282,7 +282,7 @@ /** * Add entities to selection. Play selection sound unless quiet is true */ -EntitySelection.prototype.addList = function(ents, quiet, force = false) +EntitySelection.prototype.addList = function(ents, quiet, force = false, dontAddFormationMembers = false) { // If someone else's player is the sole selected unit, don't allow adding to the selection. const firstEntState = this.selected.size == 1 && GetEntityState(this.getFirstSelected()); @@ -291,7 +291,7 @@ const added = []; - for (const ent of this.addFormationMembers(ents)) + for (const ent of dontAddFormationMembers ? ents : this.addFormationMembers(ents)) { if (this.selected.size >= g_MaxSelectionSize) break; 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 @@ -905,7 +905,7 @@ if (Engine.HotkeyIsPressed("session.deselectgroup")) removeFromSelectionGroup(data.item.key); else - makePrimarySelectionGroup(data.item.key); + makePrimarySelectionGroup(data.item.key, true); }; data.button.onPressRight = function() { removeFromSelectionGroup(data.item.key); };