general: more loading progress

This commit is contained in:
Open Toontown 2019-11-02 20:25:58 -04:00
parent b339c4d484
commit 27bd82aa36
5 changed files with 29 additions and 2 deletions

View file

@ -1,4 +1,8 @@
class Settings:
GL = 0
DX7 = 1
DX8 = 5
@staticmethod
def readSettings():
pass # todo

View file

@ -9,7 +9,7 @@ from direct.distributed import ClockDelta
from otp.avatar.ShadowCaster import ShadowCaster
import random
from otp.otpbase import OTPRender
from direct.showbase.PythonUtil import recordCreationStack
from otp.otpbase.PythonUtil import recordCreationStack
teleportNotify = DirectNotifyGlobal.directNotify.newCategory('Teleport')
teleportNotify.showTime = True
if config.GetBool('want-teleport-debug', 1):

21
otp/otpbase/PythonUtil.py Normal file
View file

@ -0,0 +1,21 @@
# class 'decorator' that records the stack at the time of creation
# be careful with this, it creates a StackTrace, and that can take a
# lot of CPU
def recordCreationStack(cls):
if not hasattr(cls, '__init__'):
raise 'recordCreationStack: class \'%s\' must define __init__' % cls.__name__
cls.__moved_init__ = cls.__init__
def __recordCreationStack_init__(self, *args, **kArgs):
self._creationStackTrace = StackTrace(start=1)
return self.__moved_init__(*args, **kArgs)
def getCreationStackTrace(self):
return self._creationStackTrace
def getCreationStackTraceCompactStr(self):
return self._creationStackTrace.compact()
def printCreationStackTrace(self):
print self._creationStackTrace
cls.__init__ = __recordCreationStack_init__
cls.getCreationStackTrace = getCreationStackTrace
cls.getCreationStackTraceCompactStr = getCreationStackTraceCompactStr
cls.printCreationStackTrace = printCreationStackTrace
return cls

View file

@ -1,4 +1,5 @@
from pandac.PandaModules import *
from libotp import Settings
import ShtikerPage
from toontown.toontowngui import TTDialog
from direct.gui.DirectGui import *

View file

@ -3,7 +3,8 @@ import string
import os
import sys
import datetime
from pandac.PandaModules import loadPrcFileData, Settings, WindowProperties
from pandac.PandaModules import loadPrcFileData, WindowProperties
from libotp import Settings
from otp.otpgui import OTPDialog
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPRender