def startSky(self): if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self) if base.cloudPlatformsEnabled: if hasattr(self, 'loader') and self.loader: self.loader.startCloudPlatforms()
def startSky(self): if self.hasFog: SkyUtil.startCloudSky(self, parent=self.dummyNode, effects=CompassEffect.PRot) else: SkyUtil.startCloudSky(self, parent=render)
def startSky(self): self.sky.setTransparency(TransparencyAttrib.MDual, 1) self.sky.setScale(1.2) base.camLens.setFar(1024) self.notify.debug('The sky is: %s' % self.sky) if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self)
def startSky(self): self.sky.setTransparency(TransparencyAttrib.MDual, 1) self.sky.setScale(1.2) base.camLens.setFar(1024) self.notify.debug('The sky is: %s' % self.sky) if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self)
def skyTransition(self, sky): if self.id != DonaldsDreamland or self.id != DonaldsDock or self.id != TheBrrrgh: if self.sky.getTag('sky').lower() != sky: print(self.sky.getTag('sky') + "-->" + sky) if hasattr(self, 'sky'): self.oldSky = self.sky if sky == 'mml': self.newSky = loader.loadModel(self.mmlSkyFile) self.newSky.setTag('sky', 'MML') if sky == 'day': self.newSky = loader.loadModel(self.daySkyFile) self.newSky.setTag('sky', 'Day') if sky == 'night': self.newSky = loader.loadModel(self.nightSkyFile) self.newSky.setTag('sky', 'Night') if sky == 'rain': self.newSky = loader.loadModel(self.snowySkyFile) self.newSky.setTag('sky', 'Rain') if self.oldSky: self.oldSky.setTransparency(TransparencyAttrib.MDual, 1) if self.newSky: self.newSky.setTransparency(TransparencyAttrib.MDual, 1) self.newSky.setScale(1.0) self.newSky.setDepthTest(0) self.newSky.setDepthWrite(0) self.newSky.setColorScale(1, 1, 1, 0) self.newSky.setBin('background', 100) self.newSky.setFogOff() self.newSky.setZ(0.0) self.newSky.setHpr(0.0, 0.0, 0.0) ce = CompassEffect.make( NodePath(), CompassEffect.PRot | CompassEffect.PZ) self.newSky.node().setEffect(ce) self.newSky.reparentTo(camera) self.sky = self.newSky SkyUtil.startCloudSky(self) newFadeIn = LerpColorScaleInterval(self.newSky, 3, Vec4(1, 1, 1, 1), startColorScale=Vec4( 1, 1, 1, 0), blendType='easeInOut') if self.oldSky: oldFadeOut = LerpColorScaleInterval( self.oldSky, 3, Vec4(1, 1, 1, 0), startColorScale=Vec4(1, 1, 1, 1), blendType='easeInOut') else: oldFadeOut = Wait( 0 ) # Just do that to please the sequence so it doesnt crash Sequence(Parallel(newFadeIn, oldFadeOut), Func(self.end)).start()
def enter(self): base.cam.setPos(-50,-27,6.5) base.cam.setHpr(0,4,0) SkyUtil.startCloudSky(self) self.patNode.unstash() self.pat2dNode.unstash() self.__updateMainButton() self.__updateFunction()
def __init__(self): DirectObject.__init__(self) base.cr.DMENU_SCREEN = self self.seq = None base.cr.avChoice = None self.allButtons = [] base.transitions.fadeOut(0) base.camera.setPosHpr(Point3(MAIN_POS), VBase3(MAIN_HPR)) base.transitions.getFadeInIval(1).start() if base.showDisclaimer: FeatureComingSoonDialog.FeatureComingSoonDialog( text=TTLocalizer.PopupAlphaDisclaimer) self.background2d = OnscreenImage( image='phase_3.5/maps/loading/toon.jpg', parent=render2d) self.background2d.setScale(render2d, Vec3(1)) self.background2d.setBin('background', 1) self.background2d.setTransparency(1) self.background2d.setColorScale(1, 1, 1, 1) self.background = loader.loadModel( 'phase_3.5/models/modules/tt_m_ara_int_toonhall') self.background.reparentTo(render) self.background.setPosHpr(-25, 0, 8.1, -95, 0, 0) self.surlee = Toon.Toon() self.surlee.setName('Doctor Surlee') self.surlee.setPickable(0) self.surlee.setPlayerType(CCNonPlayer) dna = ToonDNA.ToonDNA() dna.newToonFromProperties('pls', 'ls', 'l', 'm', 9, 0, 9, 9, 98, 27, 86, 27, 38, 27) self.surlee.setDNA(dna) self.surlee.loop('scientistGame') self.surlee.reparentTo(self.background) self.surlee.setPosHpr(13, 24, 0.025, -180, 0, 0) self.dimm = Toon.Toon() self.dimm.setName('Doctor Dimm') self.dimm.setPickable(0) self.dimm.setPlayerType(CCNonPlayer) dna = ToonDNA.ToonDNA() dna.newToonFromProperties('fll', 'ss', 's', 'm', 15, 0, 15, 15, 99, 27, 86, 27, 39, 27) self.dimm.setDNA(dna) self.dimm.loop('scientistGame') self.dimm.reparentTo(self.background) self.dimm.setPosHpr(16, 24, 0.025, -180, 0, 0) surleeHand = self.surlee.find('**/def_joint_right_hold') clipBoard = loader.loadModel( 'phase_4/models/props/tt_m_prp_acs_clipboard') surleeHandNode = surleeHand.attachNewNode('ClipBoard') clipBoard.instanceTo(surleeHandNode) surleeHandNode.setH(180) surleeHandNode.setScale(render, 1.0) surleeHandNode.setPos(0, 0, 0.1) dimmHand = self.dimm.find('**/def_joint_right_hold') sillyReader = loader.loadModel( 'phase_4/models/props/tt_m_prp_acs_sillyReader') dimHandNode = dimmHand.attachNewNode('SillyReader') sillyReader.instanceTo(dimHandNode) dimHandNode.setH(180) dimHandNode.setScale(render, 1.0) dimHandNode.setPos(0, 0, 0.1) self.sky = loader.loadModel('phase_3.5/models/props/TT_sky') SkyUtil.startCloudSky(self) base.camera.setPosHpr(MAIN_POS, MAIN_HPR) self.logo = OnscreenImage(image=GameLogo, scale=(.5, .5, .25)) self.logo.reparentTo(aspect2d) self.logo.setTransparency(TransparencyAttrib.MAlpha) scale = self.logo.getScale() self.logo.setPos(0, 0, .6) self.logo.setColorScale(Vec4(0, 0, 0, 0)) fadeInLogo = (LerpColorScaleInterval(self.logo, 1, Vec4(1, 1, 1, 1), Vec4(1, 1, 1, 0))).start() self.releaseNotesBox = None self.releaseNotesText = None self.createButtons() self.fadeOut = None self.optionsMgr = PickAToonOptions.NewPickAToonOptions() self.quitConfirmation = DMenuQuit.DMenuQuit() self.newsMgr = DMenuNewsManager.DMenuNewsManager() self.accept('doQuitGame', self.doQuitFunc) self.accept('doCancelQuitGame', self.doCancelQuitFunc) self.patNode = None # TT: We need these to run the Pick A Toon screen self.patAvList = base.cr.PAT_AVLIST self.patFSM = base.cr.PAT_LOGINFSM self.patDoneEvent = base.cr.PAT_DONEEVENT
def startSky(self): if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self)
def startSky(self): if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self)
def startSky(self): if not self.sky.getTag('sky') == 'Regular': self.endSpookySky() SkyUtil.startCloudSky(self) if base.cloudPlatformsEnabled: self.loader.startCloudPlatforms()
def startSky(self): SkyUtil.startCloudSky(self) if base.cloudPlatformsEnabled: self.loader.startCloudPlatforms()
def startSky(self): if self.hasFog: SkyUtil.startCloudSky(self, parent=self.dummyNode, effects=CompassEffect.PRot) else: SkyUtil.startCloudSky(self, parent=render)
def load(self): self.patNode = render.attachNewNode('patNode') self.patNode2d = aspect2d.attachNewNode('patNode2d') gui = loader.loadModel('phase_3/models/gui/pick_a_toon_gui') gui2 = loader.loadModel('phase_3/models/gui/quit_button') newGui = loader.loadModel('phase_3/models/gui/tt_m_gui_pat_mainGui') self.background = loader.loadModel( 'phase_3.5/models/modules/gagShop_interior') self.background.reparentTo(render) self.background.setPosHpr(-50, 0, 8.1, -90, 0, 0) for frame in render.findAllMatches('*/doorFrame*'): frame.removeNode() self.sky = loader.loadModel('phase_3.5/models/props/TT_sky') SkyUtil.startCloudSky(self) base.camera.setPosHpr(MAIN_POS, MAIN_HPR) self.title = OnscreenText(TTLocalizer.AvatarChooserPickAToon, scale=TTLocalizer.ACtitle, parent=hidden, fg=(1, 0.9, 0.1, 1), pos=(0.0, 0.82)) # Quit Button quitHover = gui.find('**/QuitBtn_RLVR') self.quitHover = quitHover self.quitButton = DirectButton(image=(quitHover, quitHover, quitHover), relief=None, text=TTLocalizer.AvatarChooserQuit, text_font=ToontownGlobals.getSignFont(), text_fg=(0.977, 0.816, 0.133, 1), text_pos=TTLocalizer.ACquitButtonPos, text_scale=TTLocalizer.ACquitButton, image_scale=1, image1_scale=1.05, image2_scale=1.05, scale=1.05, pos=(1.08, 0, -0.907), command=self.__handleQuit) self.quitButton.reparentTo(base.a2dBottomLeft) self.quitButton.setPos(0.25, 0, 0.075) # Options Button self.optionsButton = DirectButton( image=(quitHover, quitHover, quitHover), relief=None, text="Options", text_font=ToontownGlobals.getSignFont(), text_fg=(0.977, 0.816, 0.133, 1), text_pos=TTLocalizer.ACquitButtonPos, text_scale=TTLocalizer.ACquitButton, image_scale=1, image1_scale=1.05, image2_scale=1.05, scale=1.05, pos=(1.08, 0, -0.907), command=self.openOptions) self.optionsButton.reparentTo(base.a2dBottomRight) self.optionsButton.setPos(-0.25, 0, 0.075) # Shard Selector Button self.shardsButton = DirectButton( image=(quitHover, quitHover, quitHover), relief=None, text="Districts", text_font=ToontownGlobals.getSignFont(), text_fg=(0.977, 0.816, 0.133, 1), text_pos=TTLocalizer.ACquitButtonPos, text_scale=0.08, image_scale=1, image1_scale=1.05, image2_scale=1.05, scale=1.05, pos=(1.08, 0, -0.907), command=self.openShardPicker) self.shardsButton.reparentTo(base.a2dBottomLeft) self.shardsButton.setPos(0.25, 0, 0.2) gui.removeNode() gui2.removeNode() newGui.removeNode() # Area toon is in self.area = OnscreenText(parent=self.patNode2d, font=ToontownGlobals.getToonFont(), pos=(-.1, -.1), scale=.075, text='', shadow=(0, 0, 0, 1), fg=COLORS[self.selectedToon]) # DMENU Pat Screen Stuff self.play = DirectButton(relief=None, image=(quitHover, quitHover, quitHover), text='PLAY THIS TOON', text_font=ToontownGlobals.getSignFont(), text_fg=(0.977, 0.816, 0.133, 1), text_pos=(0, -.016), text_scale=0.045, image_scale=1, image1_scale=1.05, image2_scale=1.05, scale=1.4, pos=(0, 0, -0.90), command=self.playGame, parent=self.patNode2d) self.toon = Toon.Toon() self.toon.setPosHpr(-46, 0, 8.1, 90, 0, 0) self.toon.reparentTo(self.patNode) self.toon.stopLookAroundNow() self.pickAToonGui = loader.loadModel( 'phase_3/models/gui/tt_m_gui_pat_mainGui') self.buttonBgs = [] self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squareRed')) self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squareGreen')) self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squarePurple')) self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squareBlue')) self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squarePink')) self.buttonBgs.append( self.pickAToonGui.find('**/tt_t_gui_pat_squareYellow')) self.toon1 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[0], image=self.buttonBgs[0]) self.toon1.reparentTo(self.patNode2d) self.toon1.setPos(-1, 0, 0.5) self.toon1.setScale(.5) self.toon2 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[1], image=self.buttonBgs[1]) self.toon2.reparentTo(self.patNode2d) self.toon2.setPos(-.6, 0, 0.5) self.toon2.setScale(.5) self.toon3 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[2], image=self.buttonBgs[2]) self.toon3.reparentTo(self.patNode2d) self.toon3.setPos(-.2, 0, 0.5) self.toon3.setScale(.5) self.toon4 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[3], image=self.buttonBgs[3]) self.toon4.reparentTo(self.patNode2d) self.toon4.setPos(.2, 0, 0.5) self.toon4.setScale(.5) self.toon5 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[4], image=self.buttonBgs[4]) self.toon5.reparentTo(self.patNode2d) self.toon5.setPos(.6, 0, 0.5) self.toon5.setScale(.5) self.toon6 = DirectButton(text=' ', relief=None, command=self.selectToon, extraArgs=[5], image=self.buttonBgs[5]) self.toon6.reparentTo(self.patNode2d) self.toon6.setPos(1, 0, 0.5) self.toon6.setScale(.5) # Delete Toon button trashcanGui = loader.loadModel('phase_3/models/gui/trashcan_gui.bam') self.deleteButton = DirectButton( parent=base.a2dBottomRight, geom=(trashcanGui.find('**/TrashCan_CLSD'), trashcanGui.find('**/TrashCan_OPEN'), trashcanGui.find('**/TrashCan_RLVR')), text=('', TTLocalizer.AvatarChoiceDelete, TTLocalizer.AvatarChoiceDelete, ''), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.15, text_pos=(0, -0.1), relief=None, scale=.5, command=self.__handleDelete, pos=(-.2, 0, .25))
def __init__(self): DirectObject.__init__(self) base.cr.DMENU_SCREEN = self self.seq = None self.isSeqPlaying = False # .isPlaying() doesnt want to work base.cr.avChoice = None fadeSequence = Sequence( Func(base.transitions.fadeOut, .001), Wait(.5), Func(base.transitions.fadeIn, .5), base.camera.posHprInterval(1, Point3(MAIN_POS), VBase3(MAIN_HPR), blendType = 'easeInOut')).start() if base.showDisclaimer: FeatureComingSoonDialog.FeatureComingSoonDialog(text = '\1textShadow\1Disclaimer:\2\nThis is an ALPHA build of Project Altis! Expect the server to restart a lot, and expect crashes and other bugs. Please report bugs to the team. Thanks, and enjoy Project Altis!') self.background2d = OnscreenImage(image = 'phase_3.5/maps/loading/toon.jpg', parent = aspect2d) self.background2d.setScale(2, 1, 1) self.background2d.setBin('background', 1) self.background2d.setTransparency(1) self.background2d.setColorScale(1, 1, 1, .2) self.background = loader.loadModel('phase_3.5/models/modules/tt_m_ara_int_toonhall') self.background.reparentTo(render) self.background.setPosHpr(-25, 0, 8.1, -95, 0, 0) ropes = loader.loadModel('phase_4/models/modules/tt_m_ara_int_ropes') ropes.reparentTo(self.background) self.sillyMeter = Actor.Actor('phase_4/models/props/tt_a_ara_ttc_sillyMeter_default', {'arrowTube': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_arrowFluid', 'phaseOne': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseOne', 'phaseTwo': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseTwo', 'phaseThree': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseThree', 'phaseFour': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseFour', 'phaseFourToFive': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseFourToFive', 'phaseFive': 'phase_4/models/props/tt_a_ara_ttc_sillyMeter_phaseFive'}) self.sillyMeter.reparentTo(self.background) self.sillyMeter.makeSubpart('arrow', ['uvj_progressBar*', 'def_springA']) self.sillyMeter.makeSubpart('meter', ['def_pivot'], ['uvj_progressBar*', 'def_springA']) self.audio3d = Audio3DManager.Audio3DManager(base.sfxManagerList[0], camera) self.phase3Sfx = self.audio3d.loadSfx('phase_4/audio/sfx/tt_s_prp_sillyMeterPhaseThree.ogg') self.phase3Sfx.setLoop(True) self.arrowSfx = self.audio3d.loadSfx('phase_4/audio/sfx/tt_s_prp_sillyMeterArrow.ogg') self.arrowSfx.setLoop(False) self.phase3Sfx.setVolume(0.2) self.arrowSfx.setVolume(0.2) self.animSeq = Sequence(Sequence(ActorInterval(self.sillyMeter, 'arrowTube', partName = 'arrow', constrainedLoop = 0, startFrame = 236, endFrame = 247), Func(self.arrowSfx.play)), Parallel(ActorInterval(self.sillyMeter, 'arrowTube', partName = 'arrow', duration = 604800, constrainedLoop = 1, startFrame = 247, endFrame = 276), Sequence(Func(self.phase3Sfx.play), Func(self.audio3d.attachSoundToObject, self.phase3Sfx, self.sillyMeter)))) self.animSeq.start() self.smPhase1 = self.sillyMeter.find('**/stage1') self.smPhase1.show() self.smPhase2 = self.sillyMeter.find('**/stage2') self.smPhase2.hide() self.smPhase3 = self.sillyMeter.find('**/stage3') self.smPhase3.hide() self.smPhase4 = self.sillyMeter.find('**/stage4') self.smPhase4.hide() thermometerLocator = self.sillyMeter.findAllMatches('**/uvj_progressBar')[1] thermometerMesh = self.sillyMeter.find('**/tube') thermometerMesh.setTexProjector(thermometerMesh.findTextureStage('default'), thermometerLocator, self.sillyMeter) self.sillyMeter.loop('phaseOne', partName = 'meter') self.sillyMeter.setBlend(frameBlend = base.wantSmoothAnims) self.surlee = Toon.Toon() self.surlee.setName('Doctor Surlee') self.surlee.setPickable(0) self.surlee.setPlayerType(CCNonPlayer) dna = ToonDNA.ToonDNA() dna.newToonFromProperties('pls', 'ls', 'l', 'm', 9, 0, 9, 9, 98, 27, 86, 27, 38, 27) self.surlee.setDNA(dna) self.surlee.loop('scientistGame') self.surlee.reparentTo(self.background) self.surlee.setPosHpr(13, 24, 0.025, -180, 0, 0) self.dimm = Toon.Toon() self.dimm.setName('Doctor Dimm') self.dimm.setPickable(0) self.dimm.setPlayerType(CCNonPlayer) dna = ToonDNA.ToonDNA() dna.newToonFromProperties('fll', 'ss', 's', 'm', 15, 0, 15, 15, 99, 27, 86, 27, 39, 27) self.dimm.setDNA(dna) self.dimm.loop('scientistGame') self.dimm.reparentTo(self.background) self.dimm.setPosHpr(16, 24, 0.025, -180, 0, 0) surleeHand = self.surlee.find('**/def_joint_right_hold') clipBoard = loader.loadModel('phase_4/models/props/tt_m_prp_acs_clipboard') surleeHandNode = surleeHand.attachNewNode('ClipBoard') clipBoard.instanceTo(surleeHandNode) surleeHandNode.setH(180) surleeHandNode.setScale(render, 1.0) surleeHandNode.setPos(0, 0, 0.1) dimmHand = self.dimm.find('**/def_joint_right_hold') sillyReader = loader.loadModel('phase_4/models/props/tt_m_prp_acs_sillyReader') dimHandNode = dimmHand.attachNewNode('SillyReader') sillyReader.instanceTo(dimHandNode) dimHandNode.setH(180) dimHandNode.setScale(render, 1.0) dimHandNode.setPos(0, 0, 0.1) self.banana = self.background.find('**/gagBanana') self.bananaClicker = CollisionTraverser() # self.bananaClicker.showCollisions(render) self.collHandlerQueue = CollisionHandlerQueue() self.bananaRayNode = CollisionNode('bananaMouseRay') self.bananaRayNP = base.camera.attachNewNode(self.bananaRayNode) self.bananaRayNode.setIntoCollideMask(BitMask32.bit(0)) self.bananaRayNode.setFromCollideMask(BitMask32.bit(1)) self.banana.setCollideMask(BitMask32.bit(1)) self.ray = CollisionRay() self.bananaRayNode.addSolid(self.ray) self.bananaClicker.addCollider(self.bananaRayNP, self.collHandlerQueue) self.accept('mouse1', self.slipAndSlideOnThisBananaPeelHaHaHa) for frame in render.findAllMatches('*/doorFrame*'): frame.removeNode() self.sky = loader.loadModel('phase_3.5/models/props/TT_sky') SkyUtil.startCloudSky(self) base.camera.setPosHpr(MAIN_POS, MAIN_HPR) self.logo = OnscreenImage(image = GameLogo, scale = (.5, .5, .25)) self.logo.reparentTo(aspect2d) self.logo.setTransparency(TransparencyAttrib.MAlpha) scale = self.logo.getScale() self.logo.setPos(0, 0, .5) self.logo.setColorScale(Vec4(0, 0, 0, 0)) fadeInLogo = (LerpColorScaleInterval(self.logo, 1, Vec4(1, 1, 1, 1), Vec4(1, 1, 1, 0))).start() self.createButtons() self.fadeOut = None self.optionsMgr = PickAToonOptions.NewPickAToonOptions() self.quitConfirmation = DMenuQuit.DMenuQuit() self.accept('doQuitGame', self.doQuitFunc) self.accept('doCancelQuitGame', self.doCancelQuitFunc) self.patNode = None if DMENU_GAME == 'Toontown': # TT: We need these to run the Pick A Toon screen self.patAvList = base.cr.PAT_AVLIST self.patFSM = base.cr.PAT_LOGINFSM self.patDoneEvent = base.cr.PAT_DONEEVENT
def startSky(self): SkyUtil.startCloudSky(self) if base.cloudPlatformsEnabled: self.loader.startCloudPlatforms()
def startSky(self): SkyUtil.startCloudSky(self) if base.cloudPlatformsEnabled: if hasattr(self, 'loader'): self.loader.startCloudPlatforms()