Ver Fonte

Import changes to get level editor to run

David Schafer há 19 anos atrás
pai
commit
b92660bf13

+ 1 - 1
direct/src/directtools/DirectSession.py

@@ -32,7 +32,7 @@ class DirectSession(DirectObject):
     def __init__(self):
         # Establish a global pointer to the direct object early on
         # so dependant classes can access it in their code
-        __builtins__["direct"] = self
+        __builtins__["direct"] = base.direct = self
         # These come early since they are used later on
         self.group = render.attachNewNode('DIRECT')
         self.font = TextNode.getDefaultFont()

+ 4 - 3
direct/src/leveleditor/LevelEditor.py

@@ -3,13 +3,14 @@ from pandac.PandaModules import *
 from direct.directbase.DirectStart import *
 from direct.showbase.DirectObject import DirectObject
 from PieMenu import *
-import direct.gui.DirectGuiGlobals
+import direct.gui.DirectGuiGlobals as DGG
 from direct.showbase.TkGlobal import *
 from direct.directtools.DirectUtil import *
 from direct.directtools.DirectGeometry import *
 from direct.tkwidgets.SceneGraphExplorer import *
 from tkMessageBox import showinfo
 from tkFileDialog import *
+from Tkinter import *
 from whrandom import *
 from direct.tkwidgets import Floater
 from direct.tkwidgets import VectorWidgets
@@ -4635,7 +4636,7 @@ class LevelStyleManager:
         for i in range (numItems):
             # Create a text node--just a card, really--of the right color.
             tn = TextNode('colorChip')
-            tn.setFont(DirectGuiGlobals.getDefaultFont())
+            tn.setFont(DGG.getDefaultFont())
             tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
             tn.setCardColor(colorList[i])
             tn.setCardActual(0, 1.1111, 0, 0.8333)
@@ -4761,7 +4762,7 @@ class LevelStyleManager:
             # Create text node for each item
             if (textList[i] != None):
                 tn = TextNode('TextItem')
-                tn.setFont(DirectGuiGlobals.getDefaultFont())
+                tn.setFont(DGG.getDefaultFont())
                 tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
                 tn.setTextColor(0, 0, 0, 1)
                 tn.setCardColor(1, 1, 1, 1)