mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:42:58 +02:00
PR feedback - flag for setting color
This commit is contained in:
parent
e2dfbf1b02
commit
632af18c1d
1 changed files with 11 additions and 2 deletions
|
@ -35,6 +35,10 @@
|
||||||
var checkTimer = false;
|
var checkTimer = false;
|
||||||
var _this;
|
var _this;
|
||||||
|
|
||||||
|
var WANT_COLOR_CHANGE = true;
|
||||||
|
var COLOR_OFF = { red: 128, green: 128, blue: 128 };
|
||||||
|
var COLOR_ON = { red: 255, green: 0, blue: 0 };
|
||||||
|
|
||||||
var WANT_DEBUG = true;
|
var WANT_DEBUG = true;
|
||||||
function debugPrint(string) {
|
function debugPrint(string) {
|
||||||
if (WANT_DEBUG) {
|
if (WANT_DEBUG) {
|
||||||
|
@ -69,7 +73,9 @@
|
||||||
if (soundPlaying && soundPlaying.playing) {
|
if (soundPlaying && soundPlaying.playing) {
|
||||||
soundPlaying.stop();
|
soundPlaying.stop();
|
||||||
soundPlaying = false;
|
soundPlaying = false;
|
||||||
Entities.editEntity(entity, { color: { red: 128, green: 128, blue: 128 }});
|
if (WANT_COLOR_CHANGE) {
|
||||||
|
Entities.editEntity(entity, { color: COLOR_OFF });
|
||||||
|
}
|
||||||
debugPrint("Restarting ambient sound");
|
debugPrint("Restarting ambient sound");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +102,10 @@
|
||||||
if (!soundPlaying && ambientSound.downloaded) {
|
if (!soundPlaying && ambientSound.downloaded) {
|
||||||
soundPlaying = Audio.playSound(ambientSound, { loop: true, localOnly: true, volume: volume });
|
soundPlaying = Audio.playSound(ambientSound, { loop: true, localOnly: true, volume: volume });
|
||||||
debugPrint("Starting ambient sound, volume: " + volume);
|
debugPrint("Starting ambient sound, volume: " + volume);
|
||||||
Entities.editEntity(entity, { color: { red: 255, green: 0, blue: 0 }});
|
if (WANT_COLOR_CHANGE) {
|
||||||
|
Entities.editEntity(entity, { color: COLOR_ON });
|
||||||
|
}
|
||||||
|
|
||||||
} else if (soundPlaying && soundPlaying.playing) {
|
} else if (soundPlaying && soundPlaying.playing) {
|
||||||
soundPlaying.setOptions( { volume: volume } );
|
soundPlaying.setOptions( { volume: volume } );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue