fix start/stop music in settings, double ingame menu speed
This was SVN commit r10256.
This commit is contained in:
parent
b50fa144f3
commit
b1247e77cd
@ -67,7 +67,7 @@ Music.prototype.update = function()
|
||||
switch (this.currentState)
|
||||
{
|
||||
case this.states.OFF:
|
||||
if (this.isMusicPlaying())
|
||||
if (this.isPlaying())
|
||||
{
|
||||
this.currentMusic.fade(-1, 0.0, 3.0);
|
||||
this.currentMusic = null;
|
||||
@ -76,7 +76,6 @@ Music.prototype.update = function()
|
||||
|
||||
case this.states.MENU:
|
||||
this.switchMusic(this.tracks.MAIN_MENU_TRACK, 0.0, true);
|
||||
console.write("menu");
|
||||
break;
|
||||
|
||||
case this.states.PEACE:
|
||||
@ -106,7 +105,7 @@ Music.prototype.update = function()
|
||||
break;
|
||||
}
|
||||
}
|
||||
// else if (!this.isMusicPlaying())
|
||||
// else if (!this.isPlaying())
|
||||
// {
|
||||
//
|
||||
// }
|
||||
@ -173,7 +172,7 @@ Music.prototype.switchMusic = function(track, fadeInPeriod, isLooping)
|
||||
}
|
||||
};
|
||||
|
||||
Music.prototype.isMusicPlaying = function()
|
||||
Music.prototype.isPlaying = function()
|
||||
{
|
||||
if (!this.currentMusic)
|
||||
return false;
|
||||
@ -185,12 +184,12 @@ Music.prototype.isMusicPlaying = function()
|
||||
return true;
|
||||
};
|
||||
|
||||
Music.prototype.startMusic = function()
|
||||
Music.prototype.start = function()
|
||||
{
|
||||
this.setState(this.states.PEACE);
|
||||
};
|
||||
|
||||
Music.prototype.stopMusic = function()
|
||||
Music.prototype.stop = function()
|
||||
{
|
||||
this.setState(this.states.OFF);
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ const INITIAL_MENU_POSITION = "100%-164 " + MENU_TOP + " 100% " + MENU_BOTTOM;
|
||||
// distance is the max-initial. The travel distance in this
|
||||
// example is 164-0 = 164. We choose an offset of 10.25 because it
|
||||
// divides into 164 evenly and provided the speed we wanted.
|
||||
const OFFSET = 10.25;
|
||||
const OFFSET = 20.5;
|
||||
|
||||
var isMenuOpen = false;
|
||||
var menu;
|
||||
|
@ -234,7 +234,7 @@
|
||||
<!-- Settings / Music-->
|
||||
<object size="0 85 100%-80 110" type="text" style="RightLabelText" ghost="true">Enable Music</object>
|
||||
<object size="100%-56 90 100%-30 115" type="checkbox" style="StoneCrossBox" checked="true">
|
||||
<action on="Press">if (this.checked) startMusic(); else stopMusic();</action>
|
||||
<action on="Press">if (this.checked) global.music.start(); else global.music.stop();</action>
|
||||
</object>
|
||||
|
||||
<!-- Settings / Dev Overlay -->
|
||||
|
Loading…
Reference in New Issue
Block a user