From 1d7f9554ce0965246219d4115bada0f51adf6fac Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Wed, 30 Sep 2020 23:55:46 -0400 Subject: [PATCH] Add audio feedback on Duplicate Add an audio feedback mechanism to play confirmation or rejection sound on specific actions that are not visually detectable. here for "Duplicate" (mainly for the HMD use case where the new entity is generated at the exact same position) --- .../create/entitySelectionTool/entitySelectionTool.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index 9b5ba8c495..51608a2d87 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -319,6 +319,7 @@ SelectionManager = (function() { that.addChildrenEntities(originalEntityID, entitiesToDuplicate, entityHostTypes[i].entityHostType); } + var hasItFailed = false; // duplicate entities from above and store their original to new entity mappings and children needing re-parenting for (var i = 0; i < entitiesToDuplicate.length; i++) { var originalEntityID = entitiesToDuplicate[i]; @@ -365,6 +366,8 @@ SelectionManager = (function() { duplicatedChildrenWithOldParents[newEntityID] = properties.parentID; } originalEntityToNewEntityID[originalEntityID] = newEntityID; + } else { + hasItFailed = true; } } @@ -383,6 +386,11 @@ SelectionManager = (function() { } }); + if (!hasItFailed) { + audioFeedback.confirmation(); + } else { + audioFeedback.rejection(); + } return duplicatedEntityIDs; };