mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 14:35:44 +02:00
Interim method for disabling controllerDispatcher lasers, grabbing, etc.
This commit is contained in:
parent
299a8078e3
commit
f22e2de525
1 changed files with 12 additions and 9 deletions
|
@ -1389,9 +1389,12 @@
|
|||
updateTimer = Script.setTimeout(update, UPDATE_LOOP_TIMEOUT);
|
||||
}
|
||||
|
||||
function updateHandControllerGrab() {
|
||||
// Communicate app status to handControllerGrab.js.
|
||||
// TODO
|
||||
function updateControllerDispatcher() {
|
||||
// Communicate app status to controllerDispatcher.js.
|
||||
var DISABLE_HANDS = "both",
|
||||
ENABLE_HANDS = "none";
|
||||
// TODO: Proper method to disable specific laser and grabbing functionality.
|
||||
Messages.sendLocalMessage('Hifi-Hand-Disabler', isAppActive ? DISABLE_HANDS : ENABLE_HANDS);
|
||||
}
|
||||
|
||||
function onUICommand(command, parameter) {
|
||||
|
@ -1598,7 +1601,7 @@
|
|||
}
|
||||
|
||||
isAppActive = !isAppActive;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
button.editProperties({ isActive: isAppActive });
|
||||
|
||||
if (isAppActive) {
|
||||
|
@ -1613,7 +1616,7 @@
|
|||
var hasRezPermissions = Entities.canRez() || Entities.canRezTmp();
|
||||
if (isAppActive && !hasRezPermissions) {
|
||||
isAppActive = false;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
stopApp();
|
||||
}
|
||||
button.editProperties({
|
||||
|
@ -1628,7 +1631,7 @@
|
|||
var hasRezPermissions = Entities.canRez() || Entities.canRezTmp();
|
||||
if (isAppActive && !hasRezPermissions) {
|
||||
isAppActive = false;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
stopApp();
|
||||
}
|
||||
button.editProperties({
|
||||
|
@ -1673,7 +1676,7 @@
|
|||
// Close the app because the new avatar may have different joint numbers meaning that the UI would be attached
|
||||
// incorrectly. Let the user reopen the app because it can take some time for the new avatar to load.
|
||||
isAppActive = false;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
button.editProperties({ isActive: false });
|
||||
stopApp();
|
||||
}
|
||||
|
@ -1691,7 +1694,7 @@
|
|||
|
||||
// Application state.
|
||||
isAppActive = false;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
dominantHand = MyAvatar.getDominantHand() === "left" ? LEFT_HAND : RIGHT_HAND;
|
||||
|
||||
// Tablet/toolbar button.
|
||||
|
@ -1751,7 +1754,7 @@
|
|||
MyAvatar.skeletonChanged.disconnect(onSkeletonChanged);
|
||||
|
||||
isAppActive = false;
|
||||
updateHandControllerGrab();
|
||||
updateControllerDispatcher();
|
||||
|
||||
if (button) {
|
||||
button.clicked.disconnect(onAppButtonClicked);
|
||||
|
|
Loading…
Reference in a new issue