mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:09:24 +02:00
sound seems to be working"
This commit is contained in:
parent
68dc5a8251
commit
e5b2483604
1 changed files with 13 additions and 10 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
var baton;
|
var baton;
|
||||||
var iOwn = false;
|
var iOwn = false;
|
||||||
var updateLoopConnected = false;
|
var soundIntervalConnected = false;
|
||||||
|
|
||||||
var _this;
|
var _this;
|
||||||
BatonSoundEntity = function() {
|
BatonSoundEntity = function() {
|
||||||
|
@ -23,18 +23,21 @@
|
||||||
// We already have our injector so just restart it
|
// We already have our injector so just restart it
|
||||||
_this.soundInjector.restart();
|
_this.soundInjector.restart();
|
||||||
}
|
}
|
||||||
|
print("EBL SETTING TIMEOUT")
|
||||||
|
_this.playSoundInterval = Script.setInterval(function() {
|
||||||
|
print("EBL RESTART");
|
||||||
|
_this.soundInjector.restart();
|
||||||
|
}, _this.drumSound.duration * 1000); // Duration is in seconds so convert to ms
|
||||||
iOwn = true;
|
iOwn = true;
|
||||||
updateLoopConnected = true;
|
soundIntervalConnected = true;
|
||||||
print("START UPDATE");
|
|
||||||
Script.update.connect(_this.update);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopUpdateAndReclaim() {
|
function stopUpdateAndReclaim() {
|
||||||
// when the baton is release
|
// when the baton is release
|
||||||
print("CLAIM BATON")
|
print("CLAIM BATON")
|
||||||
if (updateLoopConnected === true) {
|
if (soundIntervalConnected === true) {
|
||||||
updateLoopConnected = false;
|
soundIntervalConnected = false;
|
||||||
Script.update.disconnect(_this.update);
|
Script.clearInterval(_this.playSoundInterval);
|
||||||
}
|
}
|
||||||
iOwn = false;
|
iOwn = false;
|
||||||
|
|
||||||
|
@ -63,9 +66,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
unload: function() {
|
unload: function() {
|
||||||
if (updateLoopConnected === true) {
|
if (soundIntervalConnected === true) {
|
||||||
updateLoopConnected = false;
|
soundIntervalConnected = false;
|
||||||
Script.update.disconnect(_this.update);
|
Script.clearInterval(_this.playSoundInterval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue