本文整理汇总了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)
#.........这里部分代码省略.........