def diedStateDone(self, requestStatus): hood = self.cr.playGame.hood.id if hood == ZoneUtil.BattleTTC: hood = ZoneUtil.ToontownCentral toZone = ZoneUtil.getZoneId(hood) if self.zoneId != toZone: requestStatus = { 'zoneId': toZone, 'hoodId': hood, 'where': ZoneUtil.getWhereName(toZone), 'avId': self.doId, 'loader': ZoneUtil.getLoaderName(toZone), 'shardId': None, 'wantLaffMeter': 1, 'how': 'teleportIn' } self.cr.playGame.getPlace().doneStatus = requestStatus messenger.send(self.cr.playGame.getPlace().doneEvent) else: return
def onDoorCloseFinish(self): if self.index == 1: if self.localAvOnElevator: self.thebldg.d_readyForNextFloor() self.localAvOnElevator = False else: # NOTE: we can't use self.zoneId because the elevator is in the ent zone, not the branch zone zoneId = ZoneUtil.getZoneId( ZoneUtil.getHoodId(base.localAvatar.zoneId, street=1)) requestStatus = { 'zoneId': zoneId, 'hoodId': self.cr.playGame.hood.hoodId, 'where': 'playground', 'avId': base.localAvatar.doId, 'loader': 'safeZoneLoader', 'shardId': None, 'wantLaffMeter': 1, 'world': base.cr.playGame.getCurrentWorldName(), 'how': 'teleportIn' } self.cr.playGame.getPlace().doneStatus = requestStatus messenger.send(self.cr.playGame.getPlace().doneEvent)
def load(self): BookPage.load(self) # Let's load up the clouds. for pos, scale, hpr in self.cloudPos: cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam') cloud.reparentTo(self) cloud.setPos(pos) cloud.setScale(scale) cloud.setHpr(hpr) self.clouds.append(cloud) for pos, scale, hpr, hood in self.hoodClouds: if not base.localAvatar.hasDiscoveredHood( ZoneUtil.getZoneId(hood)): cloud = loader.loadModel('phase_3.5/models/gui/cloud.bam') cloud.reparentTo(self) cloud.setPos(pos) cloud.setScale(scale) cloud.setHpr(hpr) self.clouds.append(cloud) for pos, name in self.labelData: if base.localAvatar.hasDiscoveredHood(ZoneUtil.getZoneId(name)): text = name if base.localAvatar.hasTeleportAccess( ZoneUtil.getZoneId(name)): text = 'Go To\n' + text label = DirectButton( parent=self, relief=None, pos=pos, pad=(0.2, 0.16), text=('', text, text, ''), text_bg=Vec4(1, 1, 1, 0.4), text_scale=0.055, text_wordwrap=8, rolloverSound=CIGlobals.getRolloverSound(), clickSound=None, pressEffect=0, sortOrder=1, text_font=CIGlobals.getToonFont()) if base.localAvatar.hasTeleportAccess( ZoneUtil.getZoneId(name)): label['command'] = self.book.finished label['extraArgs'] = [ZoneUtil.getZoneId(name)] label.resetFrameSize() self.labels.append(label) currHoodName = base.cr.playGame.hood.id currLocation = '' if base.localAvatar.zoneId == ZoneUtil.MinigameAreaId or base.localAvatar.getBattleZone( ) is not None: currLocation = '' elif ZoneUtil.getWhereName(base.localAvatar.zoneId) == 'playground': currLocation = 'Playground' elif ZoneUtil.getWhereName( base.localAvatar.zoneId) in ['street', 'interior']: currLocation = ZoneUtil.BranchZone2StreetName[ ZoneUtil.getBranchZone(base.localAvatar.zoneId)] self.infoLabel = DirectLabel(relief=None, text='You are in: {0}\n{1}'.format( currHoodName, currLocation), scale=0.06, pos=(-0.4, 0, -0.74), parent=self, text_align=TextNode.ACenter) if currHoodName in [ZoneUtil.MinigameArea, ZoneUtil.BattleTTC]: currHoodName = base.cr.playGame.lastHood btpText = 'Back to Playground' btpEA = [ZoneUtil.getZoneId(currHoodName)] self.BTPButton = DirectButton(relief=None, text=btpText, geom=CIGlobals.getDefaultBtnGeom(), text_pos=(0, -0.018), geom_scale=(1.3, 1.11, 1.11), text_scale=0.06, parent=self, text_font=CIGlobals.getToonFont(), pos=(0.25, 0, -0.75), command=self.book.finished, extraArgs=btpEA, scale=0.7) icons = loader.loadModel('phase_3.5/models/gui/sos_textures.bam') self.icon = icons.find('**/teleportIcon') icons.detachNode()