Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/selection.js
Show First 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
function EntityGroupsContainer() | function EntityGroupsContainer() | ||||
{ | { | ||||
this.groups = []; | this.groups = []; | ||||
for (var i = 0; i < 10; ++i) | for (var i = 0; i < 10; ++i) | ||||
this.groups[i] = new EntityGroups(); | 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) | EntityGroupsContainer.prototype.addEntities = function(groupName, ents) | ||||
{ | { | ||||
if (Engine.ConfigDB_GetValue("user", "gui.session.disjointcontrolgroups") == "true") | |||||
for (let ent of ents) | for (let ent of ents) | ||||
for (let group of this.groups) | for (let group of this.groups) | ||||
if (ent in group.ents) | if (ent in group.ents) | ||||
group.removeEnt(ent); | group.removeEnt(ent); | ||||
this.groups[groupName].add(ents); | this.groups[groupName].add(ents); | ||||
}; | }; | ||||
EntityGroupsContainer.prototype.update = function() | EntityGroupsContainer.prototype.update = function() | ||||
{ | { | ||||
this.checkRenamedEntities(); | this.checkRenamedEntities(); | ||||
for (let group of this.groups) | for (let group of this.groups) | ||||
Show All 34 Lines |
Wildfire Games · Phabricator