add ui click sounds
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -12,6 +12,7 @@ var logoSelect = {
|
||||
'Shadowlands' : './assets/img/ui/logos/Shadowlands.png',
|
||||
}
|
||||
var audio = new Audio();
|
||||
var buttonAudio = new Audio();
|
||||
var audioInitialPlayback = false;
|
||||
var queuePos = null;
|
||||
var disconnected = false;
|
||||
@@ -32,6 +33,7 @@ function waitForInteractionToPlayAudio()
|
||||
{
|
||||
if(!audioInitialPlayback)
|
||||
{
|
||||
buttonAudio.volume = 0.5;
|
||||
audio.volume = 0.1;
|
||||
audio.loop = true;
|
||||
audio.play();
|
||||
@@ -171,3 +173,16 @@ function switchExpansion()
|
||||
}
|
||||
audio.play();
|
||||
}
|
||||
|
||||
function playButtonAudio(index)
|
||||
{
|
||||
buttonAudio.pause();
|
||||
buttonAudio.time = 0;
|
||||
|
||||
if(index === 0)
|
||||
buttonAudio.src = './assets/audio/ui/button_click.ogg';
|
||||
else
|
||||
buttonAudio.src = './assets/audio/ui/button_click_big.ogg';
|
||||
|
||||
buttonAudio.play();
|
||||
}
|
||||
+3
-3
@@ -9,11 +9,11 @@
|
||||
<body onload="init();">
|
||||
|
||||
<!-- LOGO -->
|
||||
<button class="xPacButton" id="logo" onclick="manualChangeExpac();"></button>
|
||||
<button class="xPacButton" id="logo" onclick="manualChangeExpac(); playButtonAudio(1);"></button>
|
||||
|
||||
<!--QUIT BUTTON-->
|
||||
<div id="quitButtonContainer" class="foreground">
|
||||
<button class="button" onclick="location.href='http://www.wowaholics.org/';"> Quit </button>
|
||||
<button class="button" onclick="location.href='www.wowaholics.org/'; playButtonAudio(0);" > Quit </button>
|
||||
</div>
|
||||
|
||||
<!--QUEUE BOX-->
|
||||
@@ -26,7 +26,7 @@
|
||||
<p class="queueText" id="queueTime">Estimated time: 999 min</p>
|
||||
</div>
|
||||
|
||||
<button class="button" id="realmListButton"> Change Realm </button>
|
||||
<button class="button" id="realmListButton" onclick="playButtonAudio(0);"> Change Realm </button>
|
||||
</div>
|
||||
|
||||
<!--COPYRIGHT TEXT-->
|
||||
|
||||
Reference in New Issue
Block a user