Răsfoiți Sursa

add support for custom views in factory

Samir Naik 22 ani în urmă
părinte
comite
853432e4ff
1 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 8 1
      direct/src/level/DistributedLevel.py

+ 8 - 1
direct/src/level/DistributedLevel.py

@@ -12,6 +12,7 @@ import EntityCreator
 import OnscreenText
 import Task
 import LevelUtil
+import FactoryCameraViews
 
 class DistributedLevel(DistributedObject.DistributedObject,
                        Level.Level):
@@ -79,6 +80,10 @@ class DistributedLevel(DistributedObject.DistributedObject,
         # add factory menu to SpeedChat
         toonbase.localToon.chatMgr.chatInputSpeedChat.addFactoryMenu()
 
+        # add special camera views
+        self.factoryViews = FactoryCameraViews.FactoryCameraViews(self)
+
+
     # the real required fields
     def setLevelZoneId(self, zoneId):
         # this is the zone that the level is in; we should listen to this
@@ -301,7 +306,9 @@ class DistributedLevel(DistributedObject.DistributedObject,
         DistributedObject.DistributedObject.delete(self)
         # remove factory menu to SpeedChat
         toonbase.localToon.chatMgr.chatInputSpeedChat.removeFactoryMenu()
-
+        # remove special camera views
+        del self.factoryViews
+        
     def getZoneNode(self, zoneNum):
         return self.zoneNum2node[zoneNum]