diff --git a/otp/otpbase/OTPBase.py b/otp/otpbase/OTPBase.py index e76bf62..ce82d31 100644 --- a/otp/otpbase/OTPBase.py +++ b/otp/otpbase/OTPBase.py @@ -10,6 +10,8 @@ class OTPBase(ShowBase): def __init__(self, windowType = None): self.wantEnviroDR = False ShowBase.__init__(self, windowType=windowType) + __builtins__['__astron__'] = self.config.GetBool('astron-support', 1) + OTPBase.notify.info('__astron__ == %s' % __astron__) if config.GetBool('want-phase-checker', 0): from direct.showbase import Loader Loader.phaseChecker = self.loaderPhaseChecker @@ -227,3 +229,8 @@ class OTPBase(ShowBase): self.wantEnviroDR = not self.win.getGsg().isHardware() or config.GetBool('want-background-region', 1) self.backgroundDrawable = self.win return result + + def isMainWindowOpen(self): + if self.win != None: + return self.win.isValid() + return 0 diff --git a/toontown/toonbase/ToonBase.py b/toontown/toonbase/ToonBase.py index 0bcd7d8..6112c35 100644 --- a/toontown/toonbase/ToonBase.py +++ b/toontown/toonbase/ToonBase.py @@ -52,8 +52,6 @@ class ToonBase(OTPBase.OTPBase): sys.exit(1) self.disableShowbaseMouse() base.debugRunningMultiplier /= OTPGlobals.ToonSpeedFactor - __builtins__['__astron__'] = self.config.GetBool('astron-support', 1) - ToonBase.notify.info('__astron__ == %s' % __astron__) self.toonChatSounds = self.config.GetBool('toon-chat-sounds', 1) self.placeBeforeObjects = config.GetBool('place-before-objects', 1) self.endlessQuietZone = False @@ -205,8 +203,11 @@ class ToonBase(OTPBase.OTPBase): self.walking = pressed def takeScreenShot(self): + if not os.path.exists('screenshots/'): + os.mkdir('screenshots/') + namePrefix = 'screenshot' - namePrefix = launcher.logPrefix + namePrefix + namePrefix = 'screenshots/' + launcher.logPrefix + namePrefix timedif = globalClock.getRealTime() - self.lastScreenShotTime if self.glitchCount > 10 and self.walking: return @@ -400,8 +401,3 @@ class ToonBase(OTPBase.OTPBase): def playMusic(self, music, looping = 0, interrupt = 1, volume = None, time = 0.0): OTPBase.OTPBase.playMusic(self, music, looping, interrupt, volume, time) - - def isMainWindowOpen(self): - if self.win != None: - return self.win.isValid() - return 0