mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:58:09 +02:00
play a random musak song in lobby when it is shown
This commit is contained in:
parent
0433586293
commit
7f79f0946d
1 changed files with 35 additions and 3 deletions
|
@ -40,7 +40,11 @@ var ORB_SHIFT = { x: 0, y: -1.4, z: -0.8};
|
||||||
var HELMET_ATTACHMENT_URL = HIFI_PUBLIC_BUCKET + "models/attachments/IronManMaskOnly.fbx"
|
var HELMET_ATTACHMENT_URL = HIFI_PUBLIC_BUCKET + "models/attachments/IronManMaskOnly.fbx"
|
||||||
|
|
||||||
var droneSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Lobby/drone.raw")
|
var droneSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Lobby/drone.raw")
|
||||||
var currentDrone;
|
var currentDrone = null;
|
||||||
|
|
||||||
|
var latinSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Lobby/latin.raw")
|
||||||
|
var elevatorSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Lobby/elevator.raw")
|
||||||
|
var currentMusak = null;
|
||||||
|
|
||||||
function reticlePosition() {
|
function reticlePosition() {
|
||||||
var RETICLE_DISTANCE = 1;
|
var RETICLE_DISTANCE = 1;
|
||||||
|
@ -93,6 +97,9 @@ function drawLobby() {
|
||||||
|
|
||||||
// start the drone sound
|
// start the drone sound
|
||||||
currentDrone = Audio.playSound(droneSound, { stereo: true, loop: true, localOnly: true });
|
currentDrone = Audio.playSound(droneSound, { stereo: true, loop: true, localOnly: true });
|
||||||
|
|
||||||
|
// start one of our musak sounds
|
||||||
|
playRandomMusak();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,13 +125,38 @@ function changeLobbyTextures() {
|
||||||
Overlays.editOverlay(panelWall, textureProp);
|
Overlays.editOverlay(panelWall, textureProp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function playRandomMusak() {
|
||||||
|
chosenSound = null;
|
||||||
|
|
||||||
|
if (latinSound.downloaded && elevatorSound.downloaded) {
|
||||||
|
chosenSound = Math.random < 0.5 ? latinSound : elevatorSound;
|
||||||
|
} else if (latinSound.downloaded) {
|
||||||
|
chosenSound = latinSound;
|
||||||
|
} else if (elevator.downloaded) {
|
||||||
|
chosenSound = elevatorSound;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chosenSound) {
|
||||||
|
currentMusak = Audio.playSound(chosenSound, { stereo: true, localOnly: true })
|
||||||
|
} else {
|
||||||
|
currentMusak = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function cleanupLobby() {
|
function cleanupLobby() {
|
||||||
Overlays.deleteOverlay(panelWall);
|
Overlays.deleteOverlay(panelWall);
|
||||||
Overlays.deleteOverlay(orbShell);
|
Overlays.deleteOverlay(orbShell);
|
||||||
Overlays.deleteOverlay(reticle);
|
Overlays.deleteOverlay(reticle);
|
||||||
|
|
||||||
|
if (currentDrone) {
|
||||||
currentDrone.stop();
|
currentDrone.stop();
|
||||||
currentDrone = null;
|
currentDrone = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentMusak) {
|
||||||
|
currentMusak.stop();
|
||||||
|
currentMusak = null;
|
||||||
|
}
|
||||||
|
|
||||||
panelWall = false;
|
panelWall = false;
|
||||||
orbShell = false;
|
orbShell = false;
|
||||||
|
|
Loading…
Reference in a new issue