Index: ps/trunk/binaries/data/config/default.cfg =================================================================== --- ps/trunk/binaries/data/config/default.cfg +++ ps/trunk/binaries/data/config/default.cfg @@ -383,6 +383,7 @@ respoptooltipsort = 0 ; Sorting players in the resources and population tooltip by value (0 - no sort, -1 - ascending, 1 - descending) snaptoedges = "disabled" ; Possible values: disabled, enabled. snaptoedgesdistancethreshold = 15 ; On which distance we don't snap to edges +disjointcontrolgroups = "true" ; Whether control groups are disjoint sets or entities can be in multiple control groups at the same time. [gui.session.minimap] blinkduration = 1.7 ; The blink duration while pinging Index: ps/trunk/binaries/data/mods/public/gui/options/options.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/options/options.json +++ ps/trunk/binaries/data/mods/public/gui/options/options.json @@ -562,6 +562,24 @@ "tooltip": "New structures are aligned with nearby structures unless the hotkey is pressed." } ] + }, + { + "type": "dropdown", + "label": "Control Group Membership", + "tooltip": "Decide whether units can be part of multiple control groups.", + "config": "gui.session.disjointcontrolgroups", + "list": [ + { + "value": "true", + "label": "Single", + "tooltip": "When adding a Unit or Structure to a control group, they are removed from other control groups. Use this choice if you want control groups to refer to distinct armies." + }, + { + "value": "false", + "label": "Multiple", + "tooltip": "Units and Structures can be part of multiple control groups. This is useful to keep control groups for distinct armies and a control group for the entire army simultaneously." + } + ] } ] } Index: ps/trunk/binaries/data/mods/public/gui/session/selection.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection.js +++ ps/trunk/binaries/data/mods/public/gui/session/selection.js @@ -474,12 +474,18 @@ this.groups[i] = new EntityGroups(); } +/** + * Add entities to a group. + * @param {string} groupName - The number of the group to add the entities to. + * @param {number[]} ents - The entities to add to the group. + */ EntityGroupsContainer.prototype.addEntities = function(groupName, ents) { - for (let ent of ents) - for (let group of this.groups) - if (ent in group.ents) - group.removeEnt(ent); + if (Engine.ConfigDB_GetValue("user", "gui.session.disjointcontrolgroups") == "true") + for (let ent of ents) + for (let group of this.groups) + if (ent in group.ents) + group.removeEnt(ent); this.groups[groupName].add(ents); };