mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-04 00:04:42 +02:00
end handshake when successful, stop handshake sound if other guy pulls out
This commit is contained in:
parent
34a89e4b9a
commit
020dcca78d
1 changed files with 9 additions and 3 deletions
|
@ -212,6 +212,12 @@ function deleteMakeConnectionParticleEffect() {
|
|||
}
|
||||
}
|
||||
|
||||
function stopHandshakeSound() {
|
||||
if (handshakeInjector) {
|
||||
handshakeInjector.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function calcParticlePos(myHand, otherHand, otherOrientation, reset) {
|
||||
if (reset) {
|
||||
particleRotationAngle = 0.0;
|
||||
|
@ -234,6 +240,7 @@ function updateVisualization() {
|
|||
if (state == STATES.inactive) {
|
||||
deleteParticleEffect();
|
||||
deleteMakeConnectionParticleEffect();
|
||||
stopHandshakeSound();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -255,6 +262,7 @@ function updateVisualization() {
|
|||
// no visualization while waiting
|
||||
deleteParticleEffect();
|
||||
deleteMakeConnectionParticleEffect();
|
||||
stopHandshakeSound();
|
||||
break;
|
||||
case STATES.connecting:
|
||||
var particleProps = {};
|
||||
|
@ -478,15 +486,13 @@ function makeConnection(id) {
|
|||
|
||||
// now that we made connection, reset everything
|
||||
makingFriendsTimeout = Script.setTimeout(function () {
|
||||
connectingId = undefined;
|
||||
connectingHand = undefined;
|
||||
makingConnectionTimeout = undefined;
|
||||
if (!successfulHandshakeInjector) {
|
||||
successfulHandshakeInjector = Audio.playSound(successfulHandshakeSound, {position: getHandPosition(MyAvatar, currentHand), volume: 0.5, localOnly: true});
|
||||
} else {
|
||||
successfulHandshakeInjector.restart();
|
||||
}
|
||||
Controller.triggerHapticPulse(HAPTIC_DATA.success.strength, HAPTIC_DATA.success.duration, handToHaptic(currentHand));
|
||||
endHandshake();
|
||||
}, MAKING_CONNECTION_TIMEOUT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue