Closed JimRaynor56 closed 9 years ago
The game seem sot use WebStorage to set the sound/music config
function ToggleSound()
{
WebStorage.SetLocal('minigame_mute', !WebStorage.GetLocal('minigame_mute') );
}
CAudioManager.prototype.ToggleMusic = function( )
{
WebStorage.SetLocal('minigame_mutemusic', !WebStorage.GetLocal('minigame_mutemusic') );
if( !this.m_eleMusic )
return;
if( WebStorage.GetLocal('minigame_mutemusic') == true )
{
this.m_eleMusic.pause();
} else {
this.m_eleMusic.play();
}
}
Which means there's no easy way to disable it per-window?
If I have it disabled when they spawn I can re-enable it and nothing is played from the slave windows.
At least until a boss stage happens or new slaves are spawned. Then I run into the same issue of them all playing sound.
If you nuke the g_rgSoundCache
object, then the whole sound cache/object is gone.
Yeah but you get spammed with error messages. I think I pushed as close to a fix as I can. Music pauses correctly on slave pages and doesn't disrupt master, but sfx rely on WebStorage which is shared between the windows, so I disable all.
Github takes a bit to update the raw slaveWindows.js file though so it might take a minute or two to take effect.
That sounds like a good compromise. I imagine the majority of people won't notice this issue anyway because they leave music and SFX off.
So c257f2cd338549216d75adaf585a9c177c957d6a does work, but as soon as you transition from a boss stage to a normal stage, or normal stage to a boss stage music is re-enabled.
Should probably have as well
WebStorage.SetLocal('minigame_mutemusic', true);
There's no good way to keep sound in one but not the other. I've just pushed something to disable all sfx and music as soon as slave windows are created.
If I set minigame_mute, no sfx play anywhere, if I don't, they play everywhere If I set minigame_mutemusic, the rest of the cache plays then the song abruptly ends If I don't set minigame_mutemusic but pause the music on one window, it only works until the song changes. If I delete the audio manager, the user gets spammed with error messages.
Sorry, but unless you find something else disabling everything is all I got. Closing.
Suggested behavior would be to disable music and SFX before spawning slaves and then return them to their previous states.
EDIT: Based on further testing this suggested behavior may not work.