Fix music and sfx toggle

This commit is contained in:
John 2015-07-07 13:27:23 +03:00
parent ec8ee69769
commit 0a3df8b2ea
2 changed files with 2 additions and 18 deletions

View file

@ -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):

View file

@ -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'])