Beispiel #1
0
 def setupSuitBuilding(self, nodePath):
     dnaStore = self.cr.playGame.dnaStore
     level = int(self.difficulty / 2) + 1
     suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) +
                                str(level))
     zoneId = dnaStore.getZoneFromBlockNumber(self.block)
     newParentNP = toonbase.tcr.playGame.hood.loader.zoneDict[zoneId]
     suitBuildingNP = suitNP.copyTo(newParentNP)
     buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
     if buildingTitle:
         buildingTitle += ', Inc.'
     else:
         buildingTitle = 'COGS, Inc.'
     buildingTitle += '\n%s' % AvatarDNA.getDeptFullname(chr(self.track))
     textNode = TextNode('sign')
     textNode.freeze()
     textNode.setTextColor(1.0, 1.0, 1.0, 1.0)
     textNode.setFont(ToontownGlobals.getSuitFont())
     textNode.setAlign(TextNode.ACenter)
     textNode.setWordwrap(17.0)
     textNode.setText(buildingTitle)
     textHeight = textNode.getHeight()
     zScale = (textHeight + 2) / 3.0
     signOrigin = suitBuildingNP.find('**/sign_origin;+s')
     backgroundNP = loader.loadModel('phase_5/models/modules/suit_sign')
     backgroundNP.reparentTo(signOrigin)
     backgroundNP.setPosHprScale(0.0, 0.0,
                                 textHeight * 0.80000000000000004 / zScale,
                                 0.0, 0.0, 0.0, 8.0, 8.0, 8.0 * zScale)
     backgroundNP.node().setEffect(DecalEffect.make())
     signTextNodePath = backgroundNP.attachNewNode(textNode.generate())
     signTextNodePath.setPosHprScale(
         0.0, 0.0,
         -0.20999999999999999 + textHeight * 0.10000000000000001 / zScale,
         0.0, 0.0, 0.0, 0.10000000000000001, 0.10000000000000001,
         0.10000000000000001 / zScale)
     signTextNodePath.setColor(1.0, 1.0, 1.0, 1.0)
     frontNP = suitBuildingNP.find('**/*_front/+GeomNode;+s')
     backgroundNP.wrtReparentTo(frontNP)
     frontNP.node().setEffect(DecalEffect.make())
     suitBuildingNP.setName('sb' + str(self.block) + ':_landmark__DNARoot')
     suitBuildingNP.setPosHprScale(nodePath, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                                   1.0, 1.0, 1.0)
     suitBuildingNP.flattenMedium()
     self.loadElevator(suitBuildingNP)
     return suitBuildingNP
Beispiel #2
0
 def getStyleDept(self):
     if self.dna:
         return AvatarDNA.getDeptFullname(self.dna.dept)
     else:
         self.notify.error('called getStyleDept() before dna was set!')
         return 'unknown'
Beispiel #3
0
 def getStyleDept(self):
     if self.dna:
         return AvatarDNA.getDeptFullname(self.dna.dept)
     else:
         self.notify.error('called getStyleDept() before dna was set!')
         return 'unknown'