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) { that.updateHandles = function(entityID) {
if (!entitySelected) { if (SelectionManager.selections.length == 0) {
that.setOverlaysVisible(false); that.setOverlaysVisible(false);
return; return;
} }

View file

@ -608,9 +608,12 @@ function handeMenuEvent(menuItem) {
} else if (menuItem == "Delete") { } else if (menuItem == "Delete") {
if (entitySelected) { if (entitySelected) {
print(" Delete Entity.... selectedEntityID="+ selectedEntityID); 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); selectionDisplay.unselect(selectedEntityID);
entitySelected = false; entitySelected = false;
selectionManager.clearSelections();
} else { } else {
print(" Delete Entity.... not holding..."); print(" Delete Entity.... not holding...");
} }
@ -653,7 +656,7 @@ Controller.keyReleaseEvent.connect(function (event) {
if (event.text == "`") { if (event.text == "`") {
handeMenuEvent("Edit Properties..."); handeMenuEvent("Edit Properties...");
} }
if (event.text == "BACKSPACE") { if (event.text == "BACKSPACE" || event.text == "DELETE") {
handeMenuEvent("Delete"); handeMenuEvent("Delete");
} else if (event.text == "TAB") { } else if (event.text == "TAB") {
selectionDisplay.toggleSpaceMode(); selectionDisplay.toggleSpaceMode();