소스 검색

clean up letterbox typos, noisy behavior

David Rose 18 년 전
부모
커밋
c4c58208a2
1개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. 13 4
      direct/src/showbase/Transitions.py

+ 13 - 4
direct/src/showbase/Transitions.py

@@ -307,8 +307,17 @@ class Transitions:
             # Allow DirectLabels to be parented to the letterbox sensibly
             self.letterbox.setBin('unsorted', 0)
             
-            # TODO:  This texture isn't available everywhere
-            button = loader.loadModel('models/gui/toplevel_gui')
+            # Allow a custom look to the letterbox graphic.
+
+            # TODO: This model isn't available everywhere.  We should
+            # pass it in as a parameter.  In the meantime, at least
+            # set the LoaderOptions so there will be no error message
+            # if it fails to load.
+            options = LoaderOptions()
+            options.setFlags(options.getFlags() & ~options.LFReportErrors)
+            button = loader.loadModel('models/gui/toplevel_gui',
+                                      loaderOptions = options)
+            
             barImage = None
             if button:
                 barImage = button.find('**/generic_button')
@@ -341,7 +350,6 @@ class Transitions:
                 image_pos = (0,0,.1),
                 image_color = (0.3,0.3,0.3,1),
                 )
-            button.removeNode()
 
     def noLetterbox(self):
         """
@@ -397,8 +405,9 @@ class Transitions:
                                           LerpPosInterval(self.letterboxTop, t,
                                                           pos = Vec3(0, 0, 1),
                                                           startPos = Vec3(0, 0, 0.8)),
+                                          ),
                                  name = self.letterboxTaskName,
-                                 ))
+                                 )
             if finishIval:
                 self.letterboxIval.append(finishIval)
             self.letterboxIval.start()