def loadPlaceGeom(self, zoneId): self.notify.info('loadPlaceGeom: %s' % zoneId) zoneId = zoneId - zoneId % 100 self.__handleInterests(zoneId) if zoneId == ToontownGlobals.CashbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) ddLinkTunnel = self.geom.find('**/LinkTunnel1') ddLinkTunnel.setName('linktunnel_dl_9252_DNARoot') locator = self.geom.find('**/sign_origin') backgroundGeom = self.geom.find('**/EntranceFrameFront') backgroundGeom.node().setEffect(DecalEffect.make()) signText = DirectGui.OnscreenText( text=TTLocalizer.DonaldsDreamland[-1], font=ToontownGlobals.getSuitFont(), scale=3, fg=(0.87, 0.87, 0.87, 1), mayChange=False, parent=backgroundGeom) signText.setPosHpr(locator, 0, 0, 0, 0, 0, 0) signText.setDepthWrite(0) elif zoneId == ToontownGlobals.CashbotLobby: if base.config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: COGHQ: Visit CashbotLobby') self.geom = loader.loadModel(self.cogHQLobbyModelPath) else: self.notify.warning('loadPlaceGeom: unclassified zone %s' % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def fixEffects(self): nodes = self.getNodePaths() for curNode in nodes: mf = curNode.find('**/*mesh_front*') sign_joint = curNode.find('**/sign_origin_joint') if not sign_joint.isEmpty(): self.notify.debug('I found sign_origin_joint 1') if not mf.isEmpty(): sign = mf.find('**/sign') mf.clearEffect(DecalEffect.getClassType()) if not sign.isEmpty(): sign.setDepthWrite(1, 1) sign.setEffect(DecalEffect.make()) sign_joint = curNode.find('**/sign_origin_joint') allSignJoints = curNode.findAllMatches('**/sign_origin_joint') num = allSignJoints.getNumPaths() if num: sign_joint = allSignJoints.getPath(num - 1) if not sign_joint.isEmpty(): self.notify.debug('I found sign_origin_joint 2') sign.wrtReparentTo(sign_joint) sign.isEmpty()
def loadPlaceGeom(self, zoneId): self.notify.info("loadPlaceGeom: %s" % zoneId) zoneId = zoneId - zoneId % 100 if zoneId == ToontownGlobals.CashbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) ddLinkTunnel = self.geom.find("**/LinkTunnel1") ddLinkTunnel.setName("linktunnel_dl_9252_DNARoot") locator = self.geom.find("**/sign_origin") backgroundGeom = self.geom.find("**/EntranceFrameFront") backgroundGeom.node().setEffect(DecalEffect.make()) signText = DirectGui.OnscreenText( text=TTLocalizer.DonaldsDreamland[-1], font=ToontownGlobals.getSuitFont(), scale=3, fg=(0.87, 0.87, 0.87, 1), mayChange=False, parent=backgroundGeom, ) signText.setPosHpr(locator, 0, 0, 0, 0, 0, 0) signText.setDepthWrite(0) elif zoneId == ToontownGlobals.CashbotLobby: if config.GetBool("want-qa-regression", 0): self.notify.info("QA-REGRESSION: COGHQ: Visit CashbotLobby") self.geom = loader.loadModel(self.cogHQLobbyModelPath) else: self.notify.warning("loadPlaceGeom: unclassified zone %s" % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def loadIcon(self, iconsFile, name): retVal = iconsFile.find(name) retVal.setBillboardAxis() retVal.reparentTo(self) dark = retVal.copyTo(NodePath()) dark.reparentTo(retVal) dark.setColor(0.5, 0.5, 0.5, 1) retVal.setEffect(DecalEffect.make()) retVal.setTransparency(TransparencyAttrib.MAlpha, 1) ll, ur = dark.getTightBounds() center = retVal.attachNewNode('center') center.setPos(0, 0, ll[2]) dark.wrtReparentTo(center) dark.setTexProjector(TextureStage.getDefault(), center, retVal) retVal.hide() return (retVal, center)
def loadIcon(self, iconsFile, name): """Load and returns one icon and the associated meter.""" retVal = iconsFile.find(name) retVal.setBillboardAxis() retVal.reparentTo(self) # create a dark copy dark = retVal.copyTo(NodePath()) dark.reparentTo(retVal) dark.setColor(0.5, 0.5, 0.5, 1) # make it look right when they are both on top of each other retVal.setEffect(DecalEffect.make()) retVal.setTransparency(TransparencyAttrib.MAlpha, 1) # now for the tricky part, move it down and do the texture projection ll, ur = dark.getTightBounds() center = retVal.attachNewNode('center') center.setPos(0, 0, ll[2]) dark.wrtReparentTo(center) dark.setTexProjector(TextureStage.getDefault(), center, retVal) retVal.hide() return retVal, center
def loadPlaceGeom(self, zoneId): self.notify.info("loadPlaceGeom: %s" % zoneId) # We shoud not look at the last 2 digits to match against these constants zoneId = (zoneId - (zoneId % 100)) if zoneId == ToontownGlobals.CashbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) # Rename the link tunnels so they will hook up properly ddLinkTunnel = self.geom.find("**/LinkTunnel1") ddLinkTunnel.setName("linktunnel_dl_9252_DNARoot") # Put a handy sign on the link tunnel locator = self.geom.find('**/sign_origin') backgroundGeom = self.geom.find('**/EntranceFrameFront') backgroundGeom.node().setEffect(DecalEffect.make()) signText = DirectGui.OnscreenText( text=TTLocalizer.DonaldsDreamland[-1], font=ToontownGlobals.getSuitFont(), scale=3, fg=(0.87, 0.87, 0.87, 1), # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=backgroundGeom) signText.setPosHpr(locator, 0, 0, 0, 0, 0, 0) signText.setDepthWrite(0) elif zoneId == ToontownGlobals.CashbotLobby: self.geom = loader.loadModel(self.cogHQLobbyModelPath) # Note: the factory interior has a dynamically allocated zone but # that is ok because we do not need to load any models - they all # get loaded by the distributed object else: self.notify.warning("loadPlaceGeom: unclassified zone %s" % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def loadPlaceGeom(self, zoneId): self.notify.info('loadPlaceGeom: %s' % zoneId) zoneId -= zoneId % 100 if zoneId == ToontownGlobals.SellbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) dgLinkTunnel = self.geom.find('**/Tunnel1') dgLinkTunnel.setName('linktunnel_dg_5316_DNARoot') factoryLinkTunnel = self.geom.find('**/Tunnel2') factoryLinkTunnel.setName('linktunnel_sellhq_11200_DNARoot') cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 dgSign = cogSign.copyTo(dgLinkTunnel) dgSign.setPosHprScale(0.0, -291.5, 29, 180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) dgSign.node().setEffect(DecalEffect.make()) dgText = DirectGui.OnscreenText(text=TTLocalizer.DaisyGardens[-1], font=ToontownGlobals.getSuitFont(), pos=(0, -0.3), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=dgSign) dgText.setDepthWrite(0) dgText.flattenStrong() factorySign = cogSign.copyTo(factoryLinkTunnel) factorySign.setPosHprScale(148.625, -155, 27, -90.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) factorySign.node().setEffect(DecalEffect.make()) factoryTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart1, scale=TTLocalizer.SellbotFactoryScalePart1, mayChange=False, parent=factorySign) factoryTypeText.setDepthWrite(0) factoryTypeText.flattenStrong() factoryText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart2, scale=TTLocalizer.SellbotFactoryScalePart2, mayChange=False, parent=factorySign) factoryText.setDepthWrite(0) factoryText.flattenStrong() doors = self.geom.find('**/doors') door0 = doors.find('**/door_0') door1 = doors.find('**/door_1') door2 = doors.find('**/door_2') door3 = doors.find('**/door_3') for door in [door0, door1, door2, door3]: doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorTrigger = door.find('**/door_trigger*') doorTrigger.setY(doorTrigger.getY() - 1.5) doorFrame.node().setEffect(DecalEffect.make()) doorFrame.flattenStrong() door.flattenMedium() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotFactoryExt: self.geom = loader.loadModel(self.factoryExteriorModelPath) factoryLinkTunnel = self.geom.find('**/tunnel_group2') factoryLinkTunnel.setName('linktunnel_sellhq_11000_DNARoot') factoryLinkTunnel.find('**/tunnel_sphere').setName( 'tunnel_trigger') cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 elevatorSignSF = 15 hqSign = cogSign.copyTo(factoryLinkTunnel) hqSign.setPosHprScale(0.0, -353, 27.5, -180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) hqSign.node().setEffect(DecalEffect.make()) hqTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=hqSign) hqTypeText.setDepthWrite(0) hqTypeText.flattenStrong() hqText = DirectGui.OnscreenText(text=TTLocalizer.Headquarters, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=hqSign) hqText.setDepthWrite(0) hqText.flattenStrong() frontDoor = self.geom.find('**/doorway1') fdSign = cogSign.copyTo(frontDoor) fdSign.setPosHprScale(62.74, -87.99, 17.26, 2.72, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) fdSign.node().setEffect(DecalEffect.make()) fdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=TTLocalizer.SCHQLfdTypeText, mayChange=False, parent=fdSign) fdTypeText.setDepthWrite(0) fdTypeText.flattenStrong() fdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotFrontEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=fdSign) fdText.setDepthWrite(0) fdText.flattenStrong() sideDoor = self.geom.find('**/doorway2') sdSign = cogSign.copyTo(sideDoor) sdSign.setPosHprScale(-164.78, 26.28, 17.25, -89.89, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) sdSign.node().setEffect(DecalEffect.make()) sdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=sdSign) sdTypeText.setDepthWrite(0) sdTypeText.flattenStrong() sdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotSideEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=sdSign) sdText.setDepthWrite(0) sdText.flattenStrong() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotLobby: if config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: COGHQ: Visit SellbotLobby') self.geom = loader.loadModel(self.cogHQLobbyModelPath) front = self.geom.find('**/frontWall') front.node().setEffect(DecalEffect.make()) door = self.geom.find('**/door_0') parent = door.getParent() door.wrtReparentTo(front) doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorFrame.node().setEffect(DecalEffect.make()) door.find('**/leftDoor').wrtReparentTo(parent) door.find('**/rightDoor').wrtReparentTo(parent) self.geom.flattenStrong() else: self.notify.warning('loadPlaceGeom: unclassified zone %s' % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def loadPlaceGeom(self, zoneId): self.notify.info('loadPlaceGeom: %s' % zoneId) zoneId -= zoneId % 100 if zoneId == ToontownGlobals.SellbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) dgLinkTunnel = self.geom.find('**/Tunnel1') dgLinkTunnel.setName('linktunnel_dg_5316_DNARoot') factoryLinkTunnel = self.geom.find('**/Tunnel2') factoryLinkTunnel.setName('linktunnel_sellhq_11200_DNARoot') cogSignModel = loader.loadModel('phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 dgSign = cogSign.copyTo(dgLinkTunnel) dgSign.setPosHprScale(0.0, -291.5, 29, 180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) dgSign.node().setEffect(DecalEffect.make()) dgText = DirectGui.OnscreenText(text=TTLocalizer.DaisyGardens[-1], font=ToontownGlobals.getSuitFont(), pos=(0, -0.3), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=dgSign) dgText.setDepthWrite(0) dgText.flattenStrong() factorySign = cogSign.copyTo(factoryLinkTunnel) factorySign.setPosHprScale(148.625, -155, 27, -90.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) factorySign.node().setEffect(DecalEffect.make()) factoryTypeText = DirectGui.OnscreenText(text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart1, scale=TTLocalizer.SellbotFactoryScalePart1, mayChange=False, parent=factorySign) factoryTypeText.setDepthWrite(0) factoryTypeText.flattenStrong() factoryText = DirectGui.OnscreenText(text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart2, scale=TTLocalizer.SellbotFactoryScalePart2, mayChange=False, parent=factorySign) factoryText.setDepthWrite(0) factoryText.flattenStrong() doors = self.geom.find('**/doors') door0 = doors.find('**/door_0') door1 = doors.find('**/door_1') door2 = doors.find('**/door_2') door3 = doors.find('**/door_3') for door in [door0, door1, door2, door3]: doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorTrigger = door.find('**/door_trigger*') doorTrigger.setY(doorTrigger.getY() - 1.5) doorFrame.node().setEffect(DecalEffect.make()) doorFrame.flattenStrong() door.flattenMedium() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotFactoryExt: self.geom = loader.loadModel(self.factoryExteriorModelPath) factoryLinkTunnel = self.geom.find('**/tunnel_group2') factoryLinkTunnel.setName('linktunnel_sellhq_11000_DNARoot') factoryLinkTunnel.find('**/tunnel_sphere').setName('tunnel_trigger') cogSignModel = loader.loadModel('phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 elevatorSignSF = 15 hqSign = cogSign.copyTo(factoryLinkTunnel) hqSign.setPosHprScale(0.0, -353, 27.5, -180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) hqSign.node().setEffect(DecalEffect.make()) hqTypeText = DirectGui.OnscreenText(text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=hqSign) hqTypeText.setDepthWrite(0) hqTypeText.flattenStrong() hqText = DirectGui.OnscreenText(text=TTLocalizer.Headquarters, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=hqSign) hqText.setDepthWrite(0) hqText.flattenStrong() frontDoor = self.geom.find('**/doorway1') fdSign = cogSign.copyTo(frontDoor) fdSign.setPosHprScale(62.74, -87.99, 17.26, 2.72, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) fdSign.node().setEffect(DecalEffect.make()) fdTypeText = DirectGui.OnscreenText(text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=TTLocalizer.SCHQLfdTypeText, mayChange=False, parent=fdSign) fdTypeText.setDepthWrite(0) fdTypeText.flattenStrong() fdText = DirectGui.OnscreenText(text=TTLocalizer.SellbotFrontEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=fdSign) fdText.setDepthWrite(0) fdText.flattenStrong() sideDoor = self.geom.find('**/doorway2') sdSign = cogSign.copyTo(sideDoor) sdSign.setPosHprScale(-164.78, 26.28, 17.25, -89.89, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) sdSign.node().setEffect(DecalEffect.make()) sdTypeText = DirectGui.OnscreenText(text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=sdSign) sdTypeText.setDepthWrite(0) sdTypeText.flattenStrong() sdText = DirectGui.OnscreenText(text=TTLocalizer.SellbotSideEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=sdSign) sdText.setDepthWrite(0) sdText.flattenStrong() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotLobby: if config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: COGHQ: Visit SellbotLobby') self.geom = loader.loadModel(self.cogHQLobbyModelPath) front = self.geom.find('**/frontWall') front.node().setEffect(DecalEffect.make()) door = self.geom.find('**/door_0') parent = door.getParent() door.wrtReparentTo(front) doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorFrame.node().setEffect(DecalEffect.make()) door.find('**/leftDoor').wrtReparentTo(parent) door.find('**/rightDoor').wrtReparentTo(parent) self.geom.flattenStrong() else: self.notify.warning('loadPlaceGeom: unclassified zone %s' % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def loadPlaceGeom(self, zoneId): self.notify.info('loadPlaceGeom: %s' % zoneId) zoneId = zoneId - zoneId % 100 if zoneId == ToontownGlobals.SellbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) factoryExteriorPOV = loader.loadModel( 'phase_9/models/cogHQ/SellbotFactoryExterior') factoryExteriorPOV.reparentTo(self.geom) factoryExteriorPOV.setPosHpr(400.62, -139.52, 15.22, 272.73, 0, 0) factoryExteriorPOV.setScale(0.5) dgLinkTunnel = self.geom.find('**/Tunnel1') dgLinkTunnel.setName('linktunnel_dg_5316_DNARoot') factoryLinkTunnel = self.geom.find('**/Tunnel2') factoryLinkTunnel.setName('linktunnel_sellhq_11200_DNARoot') cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ').copyTo( NodePath()) cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 dgSign = cogSign.copyTo(dgLinkTunnel) dgSign.setPosHprScale(0.0, -291.5, 29, 180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) dgSign.node().setEffect(DecalEffect.make()) dgText = DirectGui.OnscreenText(text=TTLocalizer.DaisyGardens[-1], font=ToontownGlobals.getSuitFont(), pos=(0, -0.3), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=dgSign) dgText.setDepthWrite(0) dgText.flattenStrong() factorySign = cogSign.copyTo(factoryLinkTunnel) factorySign.setPosHprScale(148.625, -155, 27, -90.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) factorySign.node().setEffect(DecalEffect.make()) factoryTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart1, scale=TTLocalizer.SellbotFactoryScalePart1, mayChange=False, parent=factorySign) factoryTypeText.setDepthWrite(0) factoryTypeText.flattenStrong() factoryText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=TTLocalizer.SellbotFactoryPosPart2, scale=TTLocalizer.SellbotFactoryScalePart2, mayChange=False, parent=factorySign) factoryText.setDepthWrite(0) factoryText.flattenStrong() doors = self.geom.find('**/doors') door0 = doors.find('**/door_0') door1 = doors.find('**/door_1') door2 = doors.find('**/door_2') door3 = doors.find('**/door_3') for door in [door0, door1, door2, door3]: doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorTrigger = door.find('**/door_trigger*') doorTrigger.setY(doorTrigger.getY() - 1.5) doorFrame.node().setEffect(DecalEffect.make()) doorFrame.flattenStrong() door.flattenMedium() self.botcam1 = Actor( 'phase_9/models/char/BotCam-zero.bam', {'botcamneutral': 'phase_9/models/char/BotCam-neutral.bam'}) self.bossroom = Actor('phase_9/models/cogHQ/BossRoomPOV.bam') self.botcam1.reparentTo(self.geom) self.botcam1.setPos(-0.01, -39.3, 24) self.botcam1.loop('botcamneutral') self.bossroom.reparentTo(self.geom) self.bossroom.setPos(42, 25, 298) self.bossroom.setScale(0.1) self.spotLights = self.geom.find('**/SpotLights') self.spot1Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot1'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot1'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot2Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot2'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot2'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot3Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot3'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot3'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot4Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot4'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot4'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot5Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot5'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot5'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot6Sequence = Sequence( LerpHprInterval(self.spotLights.find('**/Spot6'), 7, Vec3(0, 1, 10), startHpr=Vec3(0, 1, -5)), LerpHprInterval(self.spotLights.find('**/Spot6'), 7, Vec3(0, 1, -5), startHpr=Vec3(0, 1, 10))) self.spot1Sequence.loop() self.spot2Sequence.loop() self.spot3Sequence.loop() self.spot4Sequence.loop() self.spot5Sequence.loop() self.spot6Sequence.loop() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotFactoryExt: self.geom = loader.loadModel(self.factoryExteriorModelPath) factoryLinkTunnel = self.geom.find('**/tunnel_group2') factoryLinkTunnel.setName('linktunnel_sellhq_11000_DNARoot') factoryLinkTunnel.find('**/tunnel_sphere').setName( 'tunnel_trigger') junkyardPOV = loader.loadModel( 'phase_9/models/cogHQ/SellbotHQExterior') junkyardPOV.reparentTo(self.geom) junkyardPOV.setPos(-200, -635, 0) junkyardPOV.setH(-275) junkyardPOV.setScale(0.5) cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ').copyTo( NodePath()) cogSign.flattenStrong() cogSignModel.removeNode() cogSignSF = 23 elevatorSignSF = 15 hqSign = cogSign.copyTo(factoryLinkTunnel) hqSign.setPosHprScale(0.0, -353, 27.5, -180.0, 0.0, 0.0, cogSignSF, cogSignSF, cogSignSF * aspectSF) hqSign.node().setEffect(DecalEffect.make()) hqTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=hqSign) hqTypeText.setDepthWrite(0) hqTypeText.flattenStrong() hqText = DirectGui.OnscreenText(text=TTLocalizer.Headquarters, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=hqSign) hqText.setDepthWrite(0) hqText.flattenStrong() frontDoor = self.geom.find('**/doorway1') fdSign = cogSign.copyTo(frontDoor) fdSign.setPosHprScale(62.74, -87.99, 17.26, 2.72, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) fdSign.node().setEffect(DecalEffect.make()) fdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=TTLocalizer.SCHQLfdTypeText, mayChange=False, parent=fdSign) fdTypeText.setDepthWrite(0) fdTypeText.flattenStrong() fdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotFrontEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=TTLocalizer.SCHQLdgText, mayChange=False, parent=fdSign) fdText.setDepthWrite(0) fdText.flattenStrong() sideDoor = self.geom.find('**/doorway2') sdSign = cogSign.copyTo(sideDoor) sdSign.setPosHprScale(-164.78, 26.28, 17.25, -89.89, 0.0, 0.0, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) sdSign.node().setEffect(DecalEffect.make()) sdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=0.075, mayChange=False, parent=sdSign) sdTypeText.setDepthWrite(0) sdTypeText.flattenStrong() sdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotSideEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, mayChange=False, parent=sdSign) sdText.setDepthWrite(0) sdText.flattenStrong() cogSign.removeNode() self.geom.flattenMedium() elif zoneId == ToontownGlobals.SellbotLobby: if base.config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: COGHQ: Visit SellbotLobby') self.geom = loader.loadModel(self.cogHQLobbyModelPath) front = self.geom.find('**/frontWall') front.node().setEffect(DecalEffect.make()) door = self.geom.find('**/door_0') parent = door.getParent() door.wrtReparentTo(front) doorFrame = door.find('**/doorDoubleFlat/+GeomNode') door.find('**/doorFrameHoleLeft').wrtReparentTo(doorFrame) door.find('**/doorFrameHoleRight').wrtReparentTo(doorFrame) doorFrame.node().setEffect(DecalEffect.make()) door.find('**/leftDoor').wrtReparentTo(parent) door.find('**/rightDoor').wrtReparentTo(parent) self.geom.flattenStrong() else: self.notify.warning('loadPlaceGeom: unclassified zone %s' % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)
def loadPlaceGeom(self, zoneId): self.notify.info("loadPlaceGeom: %s" % zoneId) # We shoud not look at the last 2 digits to match against these constants zoneId = (zoneId - (zoneId % 100)) if zoneId == ToontownGlobals.SellbotHQ: self.geom = loader.loadModel(self.cogHQExteriorModelPath) # Rename the link tunnels so they will hook up properly dgLinkTunnel = self.geom.find("**/Tunnel1") dgLinkTunnel.setName("linktunnel_dg_5316_DNARoot") factoryLinkTunnel = self.geom.find("**/Tunnel2") factoryLinkTunnel.setName("linktunnel_sellhq_11200_DNARoot") # Put handy signs on the link tunnels cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSignSF = 23 # To Daisys Garden dgSign = cogSign.copyTo(dgLinkTunnel) dgSign.setPosHprScale(0.00, -291.5, 29, 180.00, 0.00, 0.00, cogSignSF, cogSignSF, cogSignSF * aspectSF) dgSign.node().setEffect(DecalEffect.make()) dgText = DirectGui.OnscreenText( text=TTLocalizer.DaisyGardens[-1], font=ToontownGlobals.getSuitFont(), pos=(0, -0.3), scale=TTLocalizer.SCLdgSign, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=dgSign) dgText.setDepthWrite(0) # To Factory factorySign = cogSign.copyTo(factoryLinkTunnel) factorySign.setPosHprScale(148.625, -155, 27, -90.00, 0.00, 0.00, cogSignSF, cogSignSF, cogSignSF * aspectSF) # Make text a decal factorySign.node().setEffect(DecalEffect.make()) factoryTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=.075, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=factorySign) factoryTypeText.setDepthWrite(0) factoryText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=.12, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=factorySign) factoryText.setDepthWrite(0) doors = self.geom.find("**/doors") door0 = doors.find("**/door_0") door1 = doors.find("**/door_1") door2 = doors.find("**/door_2") door3 = doors.find("**/door_3") index = 0 for door in [door0, door1, door2, door3]: doorFrame = door.find("**/doorDoubleFlat/+GeomNode") door.find("**/doorFrameHoleLeft").wrtReparentTo(doorFrame) door.find("**/doorFrameHoleRight").wrtReparentTo(doorFrame) doorFrame.node().setEffect(DecalEffect.make()) index += 1 elif zoneId == ToontownGlobals.SellbotFactoryExt: self.geom = loader.loadModel(self.factoryExteriorModelPath) factoryLinkTunnel = self.geom.find("**/tunnel_group2") factoryLinkTunnel.setName("linktunnel_sellhq_11000_DNARoot") factoryLinkTunnel.find("**/tunnel_sphere").setName( "tunnel_trigger") # Put handy signs on the link tunnels cogSignModel = loader.loadModel( 'phase_4/models/props/sign_sellBotHeadHQ') cogSign = cogSignModel.find('**/sign_sellBotHeadHQ') cogSignSF = 23 elevatorSignSF = 15 # To Daisys Garden hqSign = cogSign.copyTo(factoryLinkTunnel) hqSign.setPosHprScale(0.0, -353, 27.5, -180.00, 0.00, 0.00, cogSignSF, cogSignSF, cogSignSF * aspectSF) hqSign.node().setEffect(DecalEffect.make()) hqTypeText = DirectGui.OnscreenText( text=TTLocalizer.Sellbot, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=.075, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=hqSign) hqTypeText.setDepthWrite(0) hqText = DirectGui.OnscreenText( text=TTLocalizer.Headquarters, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=hqSign) hqText.setDepthWrite(0) # Factory Front Entrance frontDoor = self.geom.find("**/doorway1") fdSign = cogSign.copyTo(frontDoor) fdSign.setPosHprScale(62.74, -87.99, 17.26, 2.72, 0.00, 0.00, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) fdSign.node().setEffect(DecalEffect.make()) fdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=TTLocalizer.SCLfdSign, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=fdSign) fdTypeText.setDepthWrite(0) fdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotFrontEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=TTLocalizer.SCLdgSign, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=fdSign) fdText.setDepthWrite(0) # Factory Side Entrance sideDoor = self.geom.find("**/doorway2") sdSign = cogSign.copyTo(sideDoor) sdSign.setPosHprScale(-164.78, 26.28, 17.25, -89.89, 0.00, 0.00, elevatorSignSF, elevatorSignSF, elevatorSignSF * aspectSF) sdSign.node().setEffect(DecalEffect.make()) sdTypeText = DirectGui.OnscreenText( text=TTLocalizer.Factory, font=ToontownGlobals.getSuitFont(), pos=(0, -0.25), scale=.075, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=sdSign) sdTypeText.setDepthWrite(0) sdText = DirectGui.OnscreenText( text=TTLocalizer.SellbotSideEntrance, font=ToontownGlobals.getSuitFont(), pos=(0, -0.34), scale=0.1, # required for DecalEffect (must be a GeomNode, not a TextNode) mayChange=False, parent=sdSign) sdText.setDepthWrite(0) elif zoneId == ToontownGlobals.SellbotLobby: self.geom = loader.loadModel(self.cogHQLobbyModelPath) front = self.geom.find("**/frontWall") front.node().setEffect(DecalEffect.make()) door = self.geom.find("**/door_0") parent = door.getParent() door.wrtReparentTo(front) doorFrame = door.find("**/doorDoubleFlat/+GeomNode") door.find("**/doorFrameHoleLeft").wrtReparentTo(doorFrame) door.find("**/doorFrameHoleRight").wrtReparentTo(doorFrame) doorFrame.node().setEffect(DecalEffect.make()) door.find("**/leftDoor").wrtReparentTo(parent) door.find("**/rightDoor").wrtReparentTo(parent) else: # Note: the factory interior has a dynamically allocated zone but # that is ok because we do not need to load any models - they all # get loaded by the distributed object self.notify.warning("loadPlaceGeom: unclassified zone %s" % zoneId) CogHQLoader.CogHQLoader.loadPlaceGeom(self, zoneId)