oldschool-toontown/toontown/estate/DistributedGardenBox.py

58 lines
2.1 KiB
Python
Raw Normal View History

from . import DistributedLawnDecor
2019-11-02 17:27:54 -05:00
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.ShowBase import *
from . import GardenGlobals
2019-11-02 17:27:54 -05:00
from toontown.toonbase import TTLocalizer
from toontown.estate import PlantingGUI
from toontown.estate import PlantTreeGUI
from direct.distributed import DistributedNode
from panda3d.core import NodePath
from panda3d.core import Vec3
2019-11-02 17:27:54 -05:00
class DistributedGardenBox(DistributedLawnDecor.DistributedLawnDecor):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedGardenPlot')
def __init__(self, cr):
DistributedLawnDecor.DistributedLawnDecor.__init__(self, cr)
self.plantPath = NodePath('plantPath')
self.plantPath.reparentTo(self)
self.plotScale = 1.0
self.plantingGuiDoneEvent = 'plantingGuiDone'
self.defaultModel = 'phase_5.5/models/estate/planterC'
def announceGenerate(self):
self.notify.debug('announceGenerate')
DistributedLawnDecor.DistributedLawnDecor.announceGenerate(self)
def doModelSetup(self):
if self.typeIndex == GardenGlobals.BOX_THREE:
self.defaultModel = 'phase_5.5/models/estate/planterA'
elif self.typeIndex == GardenGlobals.BOX_TWO:
self.defaultModel = 'phase_5.5/models/estate/planterC'
else:
self.defaultModel = 'phase_5.5/models/estate/planterD'
self.collSphereOffset = 0.0
self.collSphereRadius = self.collSphereRadius * 1.41
self.plotScale = Vec3(1.0, 1.0, 1.0)
def setupShadow(self):
pass
def loadModel(self):
self.rotateNode = self.plantPath.attachNewNode('rotate')
self.model = None
self.model = loader.loadModel(self.defaultModel)
self.model.setScale(self.plotScale)
self.model.reparentTo(self.rotateNode)
self.stick2Ground()
return
def handleEnterPlot(self, entry = None):
pass
def handleExitPlot(self, entry = None):
DistributedLawnDecor.DistributedLawnDecor.handleExitPlot(self, entry)
def setTypeIndex(self, typeIndex):
self.typeIndex = typeIndex