mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:43:49 +02:00
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.
This commit is contained in:
parent
1d7f9554ce
commit
a7ca92fb9b
1 changed files with 11 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue