From e21bf78d04b9b696534175458c81ae0e434e1786 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 28 Oct 2014 11:21:26 -0700 Subject: [PATCH] Remove cancel tool functionality --- examples/libraries/entitySelectionTool.js | 69 +++-------------------- examples/newEditEntities.js | 2 - 2 files changed, 7 insertions(+), 64 deletions(-) diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 6ecf18bb00..25342e7f44 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -1091,15 +1091,8 @@ SelectionDisplay = (function () { isConstrained = false; }, onEnd: function(event, reason) { - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(duplicatedEntityIDs); + Overlays.editOverlay(xRailOverlay, { visible: false }); Overlays.editOverlay(zRailOverlay, { visible: false }); }, @@ -1162,15 +1155,7 @@ SelectionDisplay = (function () { SelectionManager.saveProperties(); }, onEnd: function(event, reason) { - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(); }, onMove: function(event) { pickRay = Camera.computePickRay(event.x, event.y); @@ -1321,15 +1306,7 @@ SelectionDisplay = (function () { Overlays.editOverlay(yRailOverlay, { visible: false }); Overlays.editOverlay(zRailOverlay, { visible: false }); - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(); }; var onMove = function(event) { @@ -1425,14 +1402,6 @@ SelectionDisplay = (function () { }; }; - that.cancelTool = function() { - if (activeTool) { - activeTool.onEnd(null, 'cancel'); - activeTool = null; - SelectionManager._update(); - } - }; - function addStretchTool(overlay, mode, pivot, direction) { if (!pivot) { pivot = Vec3.multiply(-1, direction); @@ -1518,15 +1487,7 @@ SelectionDisplay = (function () { Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(); }, onMove: function(event) { var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); @@ -1658,15 +1619,7 @@ SelectionDisplay = (function () { Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(); }, onMove: function(event) { var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); @@ -1796,15 +1749,7 @@ SelectionDisplay = (function () { Overlays.editOverlay(rotateOverlayOuter, { visible: false }); Overlays.editOverlay(rotateOverlayCurrent, { visible: false }); - if (reason == 'cancel') { - for (var i = 0; i < SelectionManager.selections.length; i++) { - var entityID = SelectionManager.selections[i]; - var initialProperties = SelectionManager.savedProperties[entityID.id]; - Entities.editEntity(entityID, initialProperties); - } - } else { - pushCommandForSelections(); - } + pushCommandForSelections(); }, onMove: function(event) { var debug = Menu.isOptionChecked("Debug Ryans Rotation Problems"); diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index 675e33ce90..c53e2e9f2e 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -659,8 +659,6 @@ Controller.keyReleaseEvent.connect(function (event) { handeMenuEvent("Delete"); } else if (event.text == "TAB") { selectionDisplay.toggleSpaceMode(); - } else if (event.text == "ESC") { - selectionDisplay.cancelTool(); } else if (event.text == "f") { if (entitySelected) { // Get latest properties