def __accept(self): messenger.send(self.doneEvent, [ 1, "", DistributedToonStatuary.dnaCodeFromToonDNA(self.dnaSelected) ]) #if we're clicking on buttons, we're not asleep messenger.send('wakeup')
def getPicture(self, avatar): from toontown.estate import DistributedToonStatuary toonStatuary = DistributedToonStatuary.DistributedToonStatuary(None) toonStatuary.setupStoneToon(base.localAvatar.style) toonStatuary.poseToonFromSpecialsIndex(self.gardenIndex) toonStatuary.toon.setZ(0) model, ival = self.makeFrameModel(toonStatuary.toon, 1) self.pictureToonStatue = toonStatuary self.hasPicture = True return (model, ival)
def loadModel(self, specialsIndex): if specialsIndex == -1: nodePath = self.attachNewNode('blank') return nodePath else: if specialsIndex >= 105 and specialsIndex <= 109: from toontown.estate import DistributedToonStatuary self.toonStatuary = DistributedToonStatuary.DistributedToonStatuary( None) if specialsIndex == 109: self.toonStatuary.setupToonHead() self.toonStatuary.toon.setH(180) else: self.toonStatuary.setupStoneToon(base.localAvatar.style) self.toonStatuary.poseToonFromSpecialsIndex(specialsIndex) self.toonStatuary.toon.setH(180) pedestalModelPath = GardenGlobals.Specials[specialsIndex][ 'photoModel'] pedestal = loader.loadModel(pedestalModelPath) self.toonStatuary.toon.reparentTo(pedestal) pedestal.setScale( GardenGlobals.Specials[specialsIndex]['photoScale'] * 0.5) return pedestal else: if specialsIndex == 135: model = Actor.Actor() modelPath = GardenGlobals.Specials[specialsIndex][ 'photoModel'] anims = GardenGlobals.Specials[specialsIndex][ 'photoAnimation'] animPath = modelPath + anims[1] model.loadModel(modelPath + anims[0]) model.loadAnims(dict([[anims[1], animPath]])) frameNo = random.randint(1, 2) model.pose(anims[1], 1) model.setScale( GardenGlobals.Specials[specialsIndex]['photoScale'] * 0.1) return model modelName = GardenGlobals.Specials[specialsIndex]['photoModel'] nodePath = loader.loadModel(modelName) desat = None colorTuple = (1, 1, 1) if desat and not desat.isEmpty(): desat.setColorScale(colorTuple[0], colorTuple[1], colorTuple[2], 1.0) else: nodePath.setColorScale(colorTuple[0], colorTuple[1], colorTuple[2], 1.0) nodePath.setScale( GardenGlobals.Specials[specialsIndex]['photoScale'] * 0.5) return nodePath return
def getPicture(self, avatar): # Handle the ToonStatues separately because we have to load a toon statue of the # local avatar with a predefined pose instead of a predefined static model # Don't import this at the top of the file, since this code must run on the AI. from toontown.estate import DistributedToonStatuary toonStatuary = DistributedToonStatuary.DistributedToonStatuary(None) toonStatuary.setupStoneToon(base.localAvatar.style) toonStatuary.poseToonFromSpecialsIndex(self.gardenIndex) # Toon with the pedestal looks too small in the catalog, so I'm removing the pedestal. # Bring the toon up to 0 height, because we do a toon.setZ(70) in DistributedToonStatuary.py toonStatuary.toon.setZ(0) model, ival = self.makeFrameModel(toonStatuary.toon, 1) self.pictureToonStatue = toonStatuary assert (not self.hasPicture) self.hasPicture = True return (model, ival)
def loadModel(self, specialsIndex): if specialsIndex == -1: nodePath = self.attachNewNode("blank") return nodePath # Handle the ToonStatues separately because we have to load a toon statue of the # local avatar with a predefined pose instead of a predefined static model if specialsIndex >= 105 and specialsIndex <= 108: # This is the range of Special indices in GardenGlobals.py # Don't import this at the top of the file, since this code must run on the AI. from toontown.estate import DistributedToonStatuary self.toonStatuary = DistributedToonStatuary.DistributedToonStatuary( None) self.toonStatuary.setupStoneToon(base.localAvatar.style) self.toonStatuary.poseToonFromSpecialsIndex(specialsIndex) self.toonStatuary.toon.setH(180) pedestalModelPath = GardenGlobals.Specials[specialsIndex][ 'photoModel'] pedestal = loader.loadModel(pedestalModelPath) self.toonStatuary.toon.reparentTo(pedestal) pedestal.setScale( GardenGlobals.Specials[specialsIndex]['photoScale'] * 0.5) return pedestal else: modelName = GardenGlobals.Specials[specialsIndex]['photoModel'] nodePath = loader.loadModel(modelName) desat = None colorTuple = (1, 1, 1) if desat and not desat.isEmpty(): desat.setColorScale(colorTuple[0], colorTuple[1], colorTuple[2], 1.0) else: nodePath.setColorScale(colorTuple[0], colorTuple[1], colorTuple[2], 1.0) nodePath.setScale( GardenGlobals.Specials[specialsIndex]['photoScale'] * 0.5) return nodePath
def __accept(self): messenger.send(self.doneEvent, [ 1, '', DistributedToonStatuary.dnaCodeFromToonDNA(self.dnaSelected) ]) messenger.send('wakeup')
def __accept(self): messenger.send(self.doneEvent, [1, '', DistributedToonStatuary.dnaCodeFromToonDNA(self.dnaSelected)]) messenger.send('wakeup')