Fix deletion with multi-selection

This commit is contained in:
Ryan Huffman 2014-10-22 10:37:17 -07:00
parent 078d14ae58
commit 5b9806dc0d
2 changed files with 6 additions and 3 deletions

View file

@ -927,7 +927,7 @@ SelectionDisplay = (function () {
};
that.updateHandles = function(entityID) {
if (!entitySelected) {
if (SelectionManager.selections.length == 0) {
that.setOverlaysVisible(false);
return;
}

View file

@ -608,9 +608,12 @@ function handeMenuEvent(menuItem) {
} else if (menuItem == "Delete") {
if (entitySelected) {
print(" Delete Entity.... selectedEntityID="+ selectedEntityID);
Entities.deleteEntity(selectedEntityID);
for (var i = 0; i < selectionManager.selections.length; i++) {
Entities.deleteEntity(selectionManager.selections[i]);
}
selectionDisplay.unselect(selectedEntityID);
entitySelected = false;
selectionManager.clearSelections();
} else {
print(" Delete Entity.... not holding...");
}
@ -653,7 +656,7 @@ Controller.keyReleaseEvent.connect(function (event) {
if (event.text == "`") {
handeMenuEvent("Edit Properties...");
}
if (event.text == "BACKSPACE") {
if (event.text == "BACKSPACE" || event.text == "DELETE") {
handeMenuEvent("Delete");
} else if (event.text == "TAB") {
selectionDisplay.toggleSpaceMode();