Переглянути джерело

added hard disable for in-game editor, to prevent placer panels from re-enabling

Darren Ranalli 21 роки тому
батько
коміт
31b5179d42
1 змінених файлів з 6 додано та 0 видалено
  1. 6 0
      direct/src/directtools/DirectSession.py

+ 6 - 0
direct/src/directtools/DirectSession.py

@@ -19,6 +19,9 @@ from direct.showbase import Loader
 
 
 class DirectSession(PandaObject):
 class DirectSession(PandaObject):
 
 
+    # post this to the bboard to make sure DIRECT doesn't turn on
+    DIRECTdisablePost = 'disableDIRECT'
+
     def __init__(self):
     def __init__(self):
         # Establish a global pointer to the direct object early on
         # Establish a global pointer to the direct object early on
         # so dependant classes can access it in their code
         # so dependant classes can access it in their code
@@ -189,6 +192,9 @@ class DirectSession(PandaObject):
         __builtins__['cluster'] = self.cluster
         __builtins__['cluster'] = self.cluster
             
             
     def enable(self):
     def enable(self):
+        # don't enable DIRECT if someone has posted DIRECTdisablePost
+        if bboard.has(DirectSession.DIRECTdisablePost):
+            return
         if self.fEnabled:
         if self.fEnabled:
             return
             return
         # Make sure old tasks are shut down
         # Make sure old tasks are shut down