From 0a3df8b2ea6c72aebacca14f0d1e40d88734a0ba Mon Sep 17 00:00:00 2001 From: John Date: Tue, 7 Jul 2015 13:27:23 +0300 Subject: [PATCH] Fix music and sfx toggle --- toontown/shtiker/OptionsPage.py | 14 ++------------ toontown/toonbase/ClientStart.py | 6 ------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index a8fd7ebe..fb345afe 100755 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -396,12 +396,7 @@ class OptionsTabPage(DirectFrame): vol = float(vol) / 100 settings['musicVol'] = vol base.musicManager.setVolume(vol) - if vol == 0.0: - settings['music'] = False - base.musicActive = False - else: - settings['music'] = True - base.musicActive = True + base.musicActive = vol > 0.0 def __doSfxLevel(self): vol = self.SoundFX_toggleSlider['value'] @@ -409,12 +404,7 @@ class OptionsTabPage(DirectFrame): settings['sfxVol'] = vol for sfm in base.sfxManagerList: sfm.setVolume(vol) - if vol == 0.0: - settings['sfx'] = False - base.sfxActive = False - else: - settings['sfx'] = True - base.sfxActive = True + base.sfxActive = vol > 0.0 self.__setToonChatSoundsButton() def __doToggleToonChatSounds(self): diff --git a/toontown/toonbase/ClientStart.py b/toontown/toonbase/ClientStart.py index 0857cc3a..882e030d 100755 --- a/toontown/toonbase/ClientStart.py +++ b/toontown/toonbase/ClientStart.py @@ -76,10 +76,6 @@ if 'res' not in settings: settings['res'] = (1280, 720) if 'fullscreen' not in settings: settings['fullscreen'] = False -if 'music' not in settings: - settings['music'] = True -if 'sfx' not in settings: - settings['sfx'] = True if 'musicVol' not in settings: settings['musicVol'] = 1.0 if 'sfxVol' not in settings: @@ -101,8 +97,6 @@ if 'fov' not in settings: loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings['res'])) loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen']) -loadPrcFileData('Settings: music', 'audio-music-active %s' % settings['music']) -loadPrcFileData('Settings: sfx', 'audio-sfx-active %s' % settings['sfx']) loadPrcFileData('Settings: musicVol', 'audio-master-music-volume %s' % settings['musicVol']) loadPrcFileData('Settings: sfxVol', 'audio-master-sfx-volume %s' % settings['sfxVol']) loadPrcFileData('Settings: loadDisplay', 'load-display %s' % settings['loadDisplay'])