Add Parent-Children Selector group

Add Parent-Children Selector group
Prevent action to happen when some entities are Locked in the Selection 
Code Adjustments
This commit is contained in:
Alezia Kurdis 2020-10-23 23:21:32 -04:00 committed by GitHub
parent 6f6e41658c
commit 5b0a00a81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1696,7 +1696,7 @@ function recursiveDelete(entities, childrenList, deletedIDs, entityHostType) {
}
function unparentSelectedEntities() {
if (SelectionManager.hasSelection()) {
if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) {
var selectedEntities = selectionManager.selections;
var parentCheck = false;
@ -1733,11 +1733,11 @@ function unparentSelectedEntities() {
}
} else {
audioFeedback.rejection();
Window.notifyEditError("You have nothing selected to unparent");
Window.notifyEditError("You have nothing selected or the selection has locked entities.");
}
}
function parentSelectedEntities() {
if (SelectionManager.hasSelection()) {
if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) {
var selectedEntities = selectionManager.selections;
if (selectedEntities.length <= 1) {
audioFeedback.rejection();
@ -1768,11 +1768,11 @@ function parentSelectedEntities() {
}
} else {
audioFeedback.rejection();
Window.notifyEditError("You have nothing selected to parent");
Window.notifyEditError("You have nothing selected or the selection has locked entities.");
}
}
function deleteSelectedEntities() {
if (SelectionManager.hasSelection()) {
if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) {
var deletedIDs = [];
SelectionManager.saveProperties();
@ -1803,6 +1803,9 @@ function deleteSelectedEntities() {
pushCommandForSelections([], savedProperties);
entityListTool.deleteEntities(deletedIDs);
}
} else {
audioFeedback.rejection();
Window.notifyEditError("You have nothing selected or the selection has locked entities.");
}
}