From afc77e20a49025d8bf2c03ef8113ab7076e05de4 Mon Sep 17 00:00:00 2001 From: Freagarach Date: Wed, 15 Dec 2021 08:00:49 +0000 Subject: [PATCH] Ignore formation selection when clicking an unit icon. It was deemed unintuitive to select the whole formation when clicking an icon. Differential revision: https://code.wildfiregames.com/D4295 Comments by: @alre, @Langbart, @marder, @wowgetoffyourcellphone This was SVN commit r26075. --- binaries/data/mods/public/gui/session/selection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/gui/session/selection.js b/binaries/data/mods/public/gui/session/selection.js index 9af064f454..ebc40a458c 100644 --- a/binaries/data/mods/public/gui/session/selection.js +++ b/binaries/data/mods/public/gui/session/selection.js @@ -184,7 +184,7 @@ EntitySelection.prototype.makePrimarySelection = function(key) { const ents = this.groups.getEntsByKey(key); this.reset(); - this.addList(ents); + this.addList(ents, false, false, false); }; /** @@ -282,7 +282,7 @@ EntitySelection.prototype.checkRenamedEntities = function() /** * 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, addFormationMembers = true) { // 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 @@ EntitySelection.prototype.addList = function(ents, quiet, force = false) const added = []; - for (const ent of this.addFormationMembers(ents)) + for (const ent of addFormationMembers ? this.addFormationMembers(ents) : ents) { if (this.selected.size >= g_MaxSelectionSize) break;