From a7ca92fb9bd64071960094bdf10f7b45f4cd724b Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Wed, 30 Sep 2020 23:58:12 -0400 Subject: [PATCH] Add an audio feedback on Parent/Unparent Add an audio feedback mechanism to play confirmation or rejection sound on specific actions that are not visually detectable. Here for Parent and Unparent (because it not visually detectable in HMD if the action was successful or not) Fix also a bug where the HMD multiselection could stay active after we return in Desktop mode Now it is deactivated when the create window are closed. --- scripts/system/create/edit.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 739db3d411..11d4dead86 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -34,7 +34,8 @@ Script.include([ "../libraries/entityIconOverlayManager.js", "../libraries/gridTool.js", "entityList/entityList.js", - "entitySelectionTool/entitySelectionTool.js" + "entitySelectionTool/entitySelectionTool.js", + "audioFeedback/audioFeedback.js" ]); var CreateWindow = Script.require('./modules/createWindow.js'); @@ -1700,6 +1701,7 @@ function unparentSelectedEntities() { var parentCheck = false; if (selectedEntities.length < 1) { + audioFeedback.rejection(); Window.notifyEditError("You must have an entity selected in order to unparent it."); return; } @@ -1712,12 +1714,14 @@ function unparentSelectedEntities() { return true; }); if (parentCheck) { + audioFeedback.confirmation(); if (selectedEntities.length > 1) { Window.notify("Entities unparented"); } else { Window.notify("Entity unparented"); } } else { + audioFeedback.rejection(); if (selectedEntities.length > 1) { Window.notify("Selected Entities have no parents"); } else { @@ -1725,6 +1729,7 @@ function unparentSelectedEntities() { } } } else { + audioFeedback.rejection(); Window.notifyEditError("You have nothing selected to unparent"); } } @@ -1732,6 +1737,7 @@ function parentSelectedEntities() { if (SelectionManager.hasSelection()) { var selectedEntities = selectionManager.selections; if (selectedEntities.length <= 1) { + audioFeedback.rejection(); Window.notifyEditError("You must have multiple entities selected in order to parent them"); return; } @@ -1748,11 +1754,14 @@ function parentSelectedEntities() { }); if (parentCheck) { + audioFeedback.confirmation(); Window.notify("Entities parented"); } else { + audioFeedback.rejection(); Window.notify("Entities are already parented to last"); } } else { + audioFeedback.rejection(); Window.notifyEditError("You have nothing selected to parent"); } } @@ -2349,6 +2358,7 @@ var PropertiesTool = function (opts) { webView.setLandscape(true); } else { if (!visible) { + hmdMultiSelectMode = false; webView.setLandscape(false); } }