當前位置: 首頁>>代碼示例>>Python>>正文


Python TTGlobalDialog.cleanup方法代碼示例

本文整理匯總了Python中toontown.toontowngui.TTDialog.TTGlobalDialog.cleanup方法的典型用法代碼示例。如果您正苦於以下問題:Python TTGlobalDialog.cleanup方法的具體用法?Python TTGlobalDialog.cleanup怎麽用?Python TTGlobalDialog.cleanup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在toontown.toontowngui.TTDialog.TTGlobalDialog的用法示例。


在下文中一共展示了TTGlobalDialog.cleanup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: DistributedStartingBlock

# 需要導入模塊: from toontown.toontowngui.TTDialog import TTGlobalDialog [as 別名]
# 或者: from toontown.toontowngui.TTDialog.TTGlobalDialog import cleanup [as 別名]
class DistributedStartingBlock(DistributedObject.DistributedObject, FSM):
    notify = DirectNotifyGlobal.directNotify.newCategory('DistributedStartingBlock')
    sphereRadius = 1.5
    id = 0
    cameraPos = Point3(0, -23, 10)
    cameraHpr = Point3(0, -10, 0)
    SFX_BaseDir = 'phase_6/audio/sfx/'
    SFX_KartAppear = SFX_BaseDir + 'KART_Appear.ogg'
    defaultTransitions = {'Off': ['EnterMovie'],
     'EnterMovie': ['Off', 'Waiting', 'ExitMovie'],
     'Waiting': ['ExitMovie', 'Off'],
     'ExitMovie': ['Off', 'ExitMovie']}

    def __init__(self, cr):
        DistributedObject.DistributedObject.__init__(self, cr)
        FSM.__init__(self, 'staringBlock_%s_FSM' % DistributedStartingBlock.id)
        self.avId = 0
        self.av = None
        self.lastAvId = 0
        self.avatar = None
        self.kartPad = None
        self.collNode = None
        self.movieNode = None
        self.movieTrack = None
        self.collSphere = None
        self.collNodePath = None
        self.localToonKarting = 0
        self.kartNode = None
        self.kart = None
        self.holeActor = None
        self.exitRequested = False
        if (__debug__):
            self.testLOD = False
        self.id = DistributedStartingBlock.id
        DistributedStartingBlock.id += 1
        return

    def disable(self):
        FSM.cleanup(self)
        self.ignore(self.uniqueName('enterStartingBlockSphere'))
        self.ignore('stoppedAsleep')
        self.setOccupied(0)
        self.avId = 0
        self.nodePath.detachNode()
        self.kartPad = None
        if self.holeActor:
            self.holeActor.cleanup()
            self.holeActor = None
        DistributedObject.DistributedObject.disable(self)
        return

    def delete(self):
        if hasattr(self, 'dialog'):
            if not self.dialog.removed():
                self.dialog.ignoreAll()
                if not self.dialog.isEmpty():
                    self.dialog.cleanup()
                del self.dialog
        self.finishMovie()
        if hasattr(self, 'cancelButton'):
            self.cancelButton.destroy()
            del self.cancelButton
        del self.kartPad
        if self.nodePath:
            self.nodePath.removeNode()
            del self.nodePath
        DistributedObject.DistributedObject.delete(self)

    def generateInit(self):
        self.notify.debugStateCall(self)
        DistributedObject.DistributedObject.generateInit(self)
        self.nodePath = NodePath(self.uniqueName('StartingBlock'))
        self.collSphere = CollisionSphere(0, 0, 0, self.sphereRadius)
        self.collSphere.setTangible(0)
        self.collNode = CollisionNode(self.uniqueName('StartingBlockSphere'))
        self.collNode.setCollideMask(ToontownGlobals.WallBitmask)
        self.collNode.addSolid(self.collSphere)
        self.collNodePath = self.nodePath.attachNewNode(self.collNode)

    def announceGenerate(self):
        self.notify.debugStateCall(self)
        DistributedObject.DistributedObject.announceGenerate(self)
        self.nodePath.reparentTo(render)
        self.accept(self.uniqueName('enterStartingBlockSphere'), self.__handleEnterSphere)
        if (__debug__):
            if self.testLOD:
                self.__generateKartAppearTrack()

    def setPadDoId(self, padDoId):
        if padDoId in self.cr.doId2do:
            self.setPad(self.cr.doId2do[padDoId])
        else:
            self.acceptOnce('generate-%d' % padDoId, self.setPad)
        
    def setPad(self, pad):
        self.kartPad = pad
        self.kartPad.addStartingBlock(self)

    def setPosHpr(self, x, y, z, h, p, r):
        self.notify.debugStateCall(self)
#.........這裏部分代碼省略.........
開發者ID:FelixBucket,項目名稱:ToontownFritzServer,代碼行數:103,代碼來源:DistributedStartingBlock.py


注:本文中的toontown.toontowngui.TTDialog.TTGlobalDialog.cleanup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。