mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Merge and expand on config fix from 'release/1.9.x'
This commit is contained in:
commit
0eeec6b02f
@ -4,6 +4,7 @@ __all__ = ['DirectGuiBase', 'DirectGuiWidget']
|
|||||||
|
|
||||||
|
|
||||||
from panda3d.core import *
|
from panda3d.core import *
|
||||||
|
from panda3d.direct import get_config_showbase
|
||||||
import DirectGuiGlobals as DGG
|
import DirectGuiGlobals as DGG
|
||||||
from OnscreenText import *
|
from OnscreenText import *
|
||||||
from OnscreenGeom import *
|
from OnscreenGeom import *
|
||||||
@ -630,7 +631,7 @@ class DirectGuiBase(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
# Need to tack on gui item specific id
|
# Need to tack on gui item specific id
|
||||||
gEvent = event + self.guiId
|
gEvent = event + self.guiId
|
||||||
if base.config.GetBool('debug-directgui-msgs', False):
|
if get_config_showbase().GetBool('debug-directgui-msgs', False):
|
||||||
from direct.showbase.PythonUtil import StackTrace
|
from direct.showbase.PythonUtil import StackTrace
|
||||||
print gEvent
|
print gEvent
|
||||||
print StackTrace()
|
print StackTrace()
|
||||||
@ -653,7 +654,7 @@ def setGuiGridSpacing(spacing):
|
|||||||
# this should trigger off of __dev__, but it's not available at this point.
|
# this should trigger off of __dev__, but it's not available at this point.
|
||||||
# __debug__ works because the production client is not __debug__ and the
|
# __debug__ works because the production client is not __debug__ and the
|
||||||
# production AI doesn't create any GUI.
|
# production AI doesn't create any GUI.
|
||||||
if config.GetBool('record-gui-creation-stack', __debug__):
|
if get_config_showbase().GetBool('record-gui-creation-stack', __debug__):
|
||||||
# this will help track down the code that created DirectGui objects
|
# this will help track down the code that created DirectGui objects
|
||||||
# call obj.printCreationStackTrace() to figure out what code created it
|
# call obj.printCreationStackTrace() to figure out what code created it
|
||||||
DirectGuiBase = recordCreationStackStr(DirectGuiBase)
|
DirectGuiBase = recordCreationStackStr(DirectGuiBase)
|
||||||
@ -666,8 +667,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
|
|||||||
# Determine the default initial state for inactive (or
|
# Determine the default initial state for inactive (or
|
||||||
# unclickable) components. If we are in edit mode, these are
|
# unclickable) components. If we are in edit mode, these are
|
||||||
# actually clickable by default.
|
# actually clickable by default.
|
||||||
#guiEdit = base.config.GetBool('direct-gui-edit', 0)
|
guiEdit = get_config_showbase().GetBool('direct-gui-edit', 0)
|
||||||
guiEdit = config.GetBool('direct-gui-edit', 0)
|
|
||||||
if guiEdit:
|
if guiEdit:
|
||||||
inactiveInitState = DGG.NORMAL
|
inactiveInitState = DGG.NORMAL
|
||||||
else:
|
else:
|
||||||
|
@ -57,15 +57,16 @@ def exitfunc():
|
|||||||
# *seem* to cause anyone any problems.
|
# *seem* to cause anyone any problems.
|
||||||
class ShowBase(DirectObject.DirectObject):
|
class ShowBase(DirectObject.DirectObject):
|
||||||
|
|
||||||
|
config = get_config_showbase()
|
||||||
notify = directNotify.newCategory("ShowBase")
|
notify = directNotify.newCategory("ShowBase")
|
||||||
|
|
||||||
def __init__(self, fStartDirect = True, windowType = None):
|
def __init__(self, fStartDirect = True, windowType = None):
|
||||||
self.__dev__ = config.GetBool('want-dev', __debug__)
|
self.__dev__ = self.config.GetBool('want-dev', __debug__)
|
||||||
builtins.__dev__ = self.__dev__
|
builtins.__dev__ = self.__dev__
|
||||||
|
|
||||||
logStackDump = (config.GetBool('log-stack-dump', False) or
|
logStackDump = (self.config.GetBool('log-stack-dump', False) or
|
||||||
config.GetBool('client-log-stack-dump', False))
|
self.config.GetBool('client-log-stack-dump', False))
|
||||||
uploadStackDump = config.GetBool('upload-stack-dump', False)
|
uploadStackDump = self.config.GetBool('upload-stack-dump', False)
|
||||||
if logStackDump or uploadStackDump:
|
if logStackDump or uploadStackDump:
|
||||||
ExceptionVarDump.install(logStackDump, uploadStackDump)
|
ExceptionVarDump.install(logStackDump, uploadStackDump)
|
||||||
|
|
||||||
@ -80,8 +81,6 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
#debug running multiplier
|
#debug running multiplier
|
||||||
self.debugRunningMultiplier = 4
|
self.debugRunningMultiplier = 4
|
||||||
|
|
||||||
# Get the dconfig object
|
|
||||||
self.config = config
|
|
||||||
# Setup wantVerifyPdb as soon as reasonable:
|
# Setup wantVerifyPdb as soon as reasonable:
|
||||||
Verify.wantVerifyPdb = self.config.GetBool('want-verify-pdb', 0)
|
Verify.wantVerifyPdb = self.config.GetBool('want-verify-pdb', 0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user