Browse Source

take turning on/off sfx into account

Cary Sandvig 24 years ago
parent
commit
adfff753dd
1 changed files with 8 additions and 2 deletions
  1. 8 2
      direct/src/gui/GuiGlobals.py

+ 8 - 2
direct/src/gui/GuiGlobals.py

@@ -40,13 +40,19 @@ def getDefaultRolloverSound():
     global sndRollover
     global sndRollover
     if sndRollover == None:
     if sndRollover == None:
         sndRollover = base.loadSfx("phase_3/audio/sfx/GUI_rollover.mp3")
         sndRollover = base.loadSfx("phase_3/audio/sfx/GUI_rollover.mp3")
-    return sndRollover
+    if base.wantSfx:
+        return sndRollover
+    else:
+        return None
 
 
 def getDefaultClickSound():
 def getDefaultClickSound():
     global sndClick
     global sndClick
     if sndClick == None:
     if sndClick == None:
         sndClick = base.loadSfx("phase_3/audio/sfx/GUI_create_toon_fwd.mp3")
         sndClick = base.loadSfx("phase_3/audio/sfx/GUI_create_toon_fwd.mp3")
-    return sndClick
+    if base.wantSfx:
+        return sndClick
+    else:
+        return None
 
 
 def getNewRolloverFunctor(sound = None):
 def getNewRolloverFunctor(sound = None):
     val = None
     val = None