Add Hierarchy display in List and Selection

Add Hierarchy display in List and Selection
This commit is contained in:
Alezia Kurdis 2020-10-21 00:47:10 -04:00 committed by GitHub
parent fdae7877e1
commit 8afa978122
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1720,6 +1720,9 @@ function unparentSelectedEntities() {
} else {
Window.notify("Entity unparented");
}
//Refresh
entityListTool.sendUpdate();
selectionManager._update(false, this);
} else {
audioFeedback.rejection();
if (selectedEntities.length > 1) {
@ -1756,6 +1759,9 @@ function parentSelectedEntities() {
if (parentCheck) {
audioFeedback.confirmation();
Window.notify("Entities parented");
//Refresh
entityListTool.sendUpdate();
selectionManager._update(false, this);
} else {
audioFeedback.rejection();
Window.notify("Entities are already parented to last");
@ -2963,4 +2969,22 @@ function zoneSortOrder(a, b) {
return 0;
}
function getParentState(id) {
var state = "NONE";
var properties = Entities.getEntityProperties(id, ["parentID"]);
var children = Entities.getChildrenIDs(id);
if (properties.parentID !== Uuid.NULL) {
if (children.length > 0) {
state = "PARENT_CHILDREN";
} else {
state = "CHILDREN";
}
} else {
if (children.length > 0) {
state = "PARENT";
}
}
return state;
}
}()); // END LOCAL_SCOPE