From 20ee51972cbdbafeeacba9b2a4d19ea7feb7cd26 Mon Sep 17 00:00:00 2001 From: John Cote Date: Tue, 6 Jul 2021 15:34:43 -0400 Subject: [PATCH] battle: Fix battle sounds search path --- toontown/battle/BattleSounds.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/toontown/battle/BattleSounds.py b/toontown/battle/BattleSounds.py index 2a61838..2acff8e 100644 --- a/toontown/battle/BattleSounds.py +++ b/toontown/battle/BattleSounds.py @@ -1,7 +1,5 @@ from pandac.PandaModules import * from direct.directnotify import DirectNotifyGlobal -from direct.showbase import AppRunnerGlobal -import os class BattleSounds: notify = DirectNotifyGlobal.directNotify.newCategory('BattleSounds') @@ -19,20 +17,12 @@ class BattleSounds: def setupSearchPath(self): self.sfxSearchPath = DSearchPath() - if AppRunnerGlobal.appRunner: - self.sfxSearchPath.appendDirectory(Filename.expandFrom('$TT_3_ROOT/phase_3/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename.expandFrom('$TT_3_5_ROOT/phase_3.5/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename.expandFrom('$TT_4_ROOT/phase_4/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename.expandFrom('$TT_5_ROOT/phase_5/audio/sfx')) - else: - self.sfxSearchPath.appendDirectory(Filename('phase_3/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename('phase_3.5/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename('phase_4/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename('phase_5/audio/sfx')) - self.sfxSearchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$TTMODELS/built/phase_3/audio/sfx'))) - self.sfxSearchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$TTMODELS/built/phase_3.5/audio/sfx'))) - self.sfxSearchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$TTMODELS/built/phase_4/audio/sfx'))) - self.sfxSearchPath.appendDirectory(Filename.fromOsSpecific(os.path.expandvars('$TTMODELS/built/phase_5/audio/sfx'))) + if __debug__: + # In the dev environment, it will always be here: + self.sfxSearchPath.appendDirectory(Filename('resources/phase_3/audio/sfx')) + self.sfxSearchPath.appendDirectory(Filename('resources/phase_3.5/audio/sfx')) + self.sfxSearchPath.appendDirectory(Filename('resources/phase_4/audio/sfx')) + self.sfxSearchPath.appendDirectory(Filename('resources/phase_5/audio/sfx')) def clear(self): if self.isValid: