Selaa lähdekoodia

*** empty log message ***

Joe Shochet 25 vuotta sitten
vanhempi
sitoutus
98a46bed4d
1 muutettua tiedostoa jossa 10 lisäystä ja 7 poistoa
  1. 10 7
      direct/src/showbase/ShowBase.py

+ 10 - 7
direct/src/showbase/ShowBase.py

@@ -5,8 +5,6 @@ from MessengerGlobal import *
 from TaskManagerGlobal import *
 from TaskManagerGlobal import *
 from EventManagerGlobal import *
 from EventManagerGlobal import *
 from AudioManagerGlobal import *
 from AudioManagerGlobal import *
-# This should be on a dconfig variable
-from TkGlobal import *
 import Task
 import Task
 import EventManager
 import EventManager
 
 
@@ -15,6 +13,14 @@ class ShowBase:
     notify = None
     notify = None
 
 
     def __init__(self):
     def __init__(self):
+
+        # Get the dconfig object
+        self.config = getConfigShowbase()
+
+        # Store dconfig variables
+        self.wantTk = self.config.GetBool('want-tk', 0)
+        self.wantSound = self.config.GetBool('want-sound', 1)
+        self.wantMusic = self.config.GetBool('want-music', 1)
         
         
         import Loader
         import Loader
 
 
@@ -45,7 +51,7 @@ class ShowBase:
 
 
         if (ShowBase.notify == None):
         if (ShowBase.notify == None):
             ShowBase.notify = directNotify.newCategory("ShowBase")
             ShowBase.notify = directNotify.newCategory("ShowBase")
-        
+
         self.loader = Loader.Loader(self)
         self.loader = Loader.Loader(self)
 
 
         self.eventMgr = eventMgr
         self.eventMgr = eventMgr
@@ -56,17 +62,14 @@ class ShowBase:
 
 
         self.audioMgr = audioMgr
         self.audioMgr = audioMgr
 
 
-        self.wantTk = 1
         self.createRootPanel()
         self.createRootPanel()
         
         
         self.restart()
         self.restart()
 
 
-        self.wantSound = 1
-
-        self.wantMusic = 1
 
 
     def createRootPanel(self):
     def createRootPanel(self):
         if self.wantTk:
         if self.wantTk:
+            from TkGlobal import *
             self.tkroot = Pmw.initialise()
             self.tkroot = Pmw.initialise()
         else:
         else:
             self.tkroot = None
             self.tkroot = None