oldschool-toontown/toontown/coghq/DistributedElevatorMarker.py
Little Cat 1801d2b9fb
all: replace pandac.PandaModules imports.
UD/AI + Client boots up.
2022-12-16 20:40:57 -04:00

57 lines
1.9 KiB
Python

from panda3d.core import *
from direct.interval.IntervalGlobal import *
from .StomperGlobals import *
from direct.distributed import ClockDelta
from direct.showbase.PythonUtil import lerp
import math
from otp.level import DistributedEntity
from direct.directnotify import DirectNotifyGlobal
from panda3d.core import NodePath
from otp.level import BasicEntities
from direct.task import Task
from toontown.toonbase import ToontownGlobals
class DistributedElevatorMarker(BasicEntities.DistributedNodePathEntity):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedElevatorMarker')
elevatorMarkerModels = ['phase_9/models/cogHQ/square_stomper']
def __init__(self, cr):
BasicEntities.DistributedNodePathEntity.__init__(self, cr)
def generateInit(self):
self.notify.debug('generateInit')
BasicEntities.DistributedNodePathEntity.generateInit(self)
def generate(self):
self.notify.debug('generate')
BasicEntities.DistributedNodePathEntity.generate(self)
def announceGenerate(self):
self.notify.debug('announceGenerate')
BasicEntities.DistributedNodePathEntity.announceGenerate(self)
self.loadModel()
def disable(self):
self.notify.debug('disable')
self.ignoreAll()
DistributedEntity.DistributedEntity.disable(self)
def delete(self):
self.notify.debug('delete')
self.unloadModel()
BasicEntities.DistributedNodePathEntity.delete(self)
def loadModel(self):
self.rotateNode = self.attachNewNode('rotate')
self.model = None
if __dev__:
self.model = loader.loadModel(self.elevatorMarkerModels[self.modelPath])
self.model.reparentTo(self.rotateNode)
return
def unloadModel(self):
if self.model:
self.model.removeNode()
del self.model
self.model = None
return