diff --git a/dependencies/astron/astrond.exe b/dependencies/astron/astrond.exe index a055fb03..75ab02c0 100755 Binary files a/dependencies/astron/astrond.exe and b/dependencies/astron/astrond.exe differ diff --git a/dependencies/astron/config/cluster.yml b/dependencies/astron/config/cluster.yml index 63ea9f74..ba1c9049 100644 --- a/dependencies/astron/config/cluster.yml +++ b/dependencies/astron/config/cluster.yml @@ -51,7 +51,7 @@ roles: max: 399999999 backend: type: yaml - foldername: ../databases/astrondb + directory: ../databases/astrondb - type: dbss database: 4003 diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index 881681f1..5cc646c6 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -133,7 +133,7 @@ dclass DistributedAvatar : DistributedSmoothNode { friendsNotify(DoId avId, int8 status) ownrecv airecv; checkAvOnShard(DoId) clsend airecv; confirmAvOnShard(DoId avId, int8 isOnShard); - setTalk(string(0-400) chat) broadcast; + setTalk(string(0-400) chat) broadcast ram; setTalkWhisper(uint32 avId, string(0-400) chat) ownrecv clsend; }; @@ -590,8 +590,8 @@ dclass DistributedToon : DistributedPlayer { setTrackAccess(uint16[] = [0,0,0,0,1,1,0]) required broadcast ownrecv db; setTrackProgress(int8 = -1, uint32 = 0) required ownrecv db; setTrackBonusLevel(int8[] = [-1,-1,-1,-1,-1,-1,-1]) required broadcast ownrecv db; - setInventory(blob = [0*7, 0*7, 0*7, 0*7, 0, 0*6, 0, 0*6, 0*7]) required ownrecv db; - setNPCFriendsDict(FriendEntry[] = []) required ownrecv db; + setInventory(blob = [0*7, 0*7, 0*7, 0*7, 0, 0*6, 0, 0*6, 0*7]) required broadcast ownrecv db; + setNPCFriendsDict(FriendEntry[] = []) required broadcast ownrecv db; setDefaultShard(uint32 = 0) required ownrecv broadcast db; setDefaultZone(uint32 = 0) required ownrecv broadcast db; setHoodsVisited(uint32[] = [ 2000 ]) required ownrecv db; @@ -755,6 +755,7 @@ dclass DistributedToon : DistributedPlayer { requestNametagStyle(uint8) airecv ownsend; requestFishingRod(uint8) airecv ownsend; wipeStats() airecv ownsend; + takeMoney(int16) airecv ownsend; }; dclass DistributedPartyGate : DistributedObject { @@ -2048,7 +2049,6 @@ dclass DistributedCloset : DistributedFurnitureItem { setDNA(blob, int8, uint8) airecv clsend; setState(uint8, uint32, uint32, string, uint8[], uint8[]) broadcast ram; setMovie(uint8, uint32, int16) broadcast ram; - resetItemLists() broadcast ram; setCustomerDNA(uint32, blob) broadcast ram; }; diff --git a/otp/avatar/LocalAvatar.py b/otp/avatar/LocalAvatar.py index 36a4a29b..b19d5672 100755 --- a/otp/avatar/LocalAvatar.py +++ b/otp/avatar/LocalAvatar.py @@ -1125,9 +1125,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis def d_setParent(self, parentToken): DistributedSmoothNode.DistributedSmoothNode.d_setParent(self, parentToken) - def canChat(self): - return 0 - @magicWord(category=CATEGORY_COMMUNITY_MANAGER) def run(): diff --git a/otp/chat/ChatAgentUD.py b/otp/chat/ChatAgentUD.py index 5c1973f6..5b816f13 100755 --- a/otp/chat/ChatAgentUD.py +++ b/otp/chat/ChatAgentUD.py @@ -41,12 +41,7 @@ class ChatAgentUD(DistributedObjectGlobalUD): return self.air.writeServerEvent('chat-said', sender, message) - - DistributedAvatar = self.air.dclassesByName['DistributedAvatarUD'] - dg = DistributedAvatar.aiFormatUpdate('setTalk', sender, sender, - self.air.ourChannel, - [message]) - self.air.send(dg) + self.air.send(self.air.dclassesByName['DistributedAvatarUD'].aiFormatUpdate('setTalk', sender, sender, self.air.ourChannel, [message])) def detectBadWords(self, sender, message): words = message.split() diff --git a/otp/chat/ChatManager.py b/otp/chat/ChatManager.py index f7ec7676..05779a5f 100755 --- a/otp/chat/ChatManager.py +++ b/otp/chat/ChatManager.py @@ -123,7 +123,7 @@ class ChatManager(DirectObject.DirectObject): def enterMainMenu(self): self.checkObscurred() - if self.localAvatar.canChat(): + if base.cr.wantTypedChat(): if self.wantBackgroundFocus: self.chatInputNormal.chatEntry['backgroundFocus'] = 1 self.acceptOnce('enterNormalChat', self.fsm.request, ['normalChat']) diff --git a/otp/otpbase/OTPGlobals.py b/otp/otpbase/OTPGlobals.py index 8c989807..a80d95a7 100755 --- a/otp/otpbase/OTPGlobals.py +++ b/otp/otpbase/OTPGlobals.py @@ -76,8 +76,8 @@ InterfaceFont = None InterfaceFontPath = None SignFont = None SignFontPath = None -FancyFont = None -FancyFontPath = None +ChalkFont = None +ChalkFontPath = None NametagFonts = {} NametagFontPaths = {} DialogClass = None @@ -115,20 +115,20 @@ def setSignFont(path): global SignFontPath SignFontPath = path -def getFancyFont(): - global FancyFontPath - global FancyFont - if FancyFont == None: - if FancyFontPath == None: +def getChalkFont(): + global ChalkFontPath + global ChalkFont + if ChalkFont == None: + if ChalkFontPath == None: InterfaceFont = TextNode.getDefaultFont() - FancyFont = TextNode.getDefaultFont() + ChalkFont = TextNode.getDefaultFont() else: - FancyFont = loader.loadFont(FancyFontPath, lineHeight=1.0) - return FancyFont + ChalkFont = loader.loadFont(ChalkFontPath, lineHeight=1.0) + return ChalkFont -def setFancyFont(path): - global FancyFontPath - FancyFontPath = path +def setChalkFont(path): + global ChalkFontPath + ChalkFontPath = path def getNametagFont(index): global NametagFontPaths diff --git a/resources b/resources index 38571686..4e298683 160000 --- a/resources +++ b/resources @@ -1 +1 @@ -Subproject commit 385716865935081c00f8ebbc53ab2875aef4ef19 +Subproject commit 4e2986832f047ae4e8f6256d187a6d111a526f5d diff --git a/toontown/ai/HolidayGlobals.py b/toontown/ai/HolidayGlobals.py index 4935d6af..4910516b 100644 --- a/toontown/ai/HolidayGlobals.py +++ b/toontown/ai/HolidayGlobals.py @@ -28,8 +28,10 @@ Holidays = { 'endMessage': TTLocalizer.SillySaturdayEnd }, ToontownGlobals.BLACK_CAT_DAY: { - 'startDay': 13, - 'endDay': 13, + 'startMonth': 10, + 'startDay': 31, + 'endMonth': 10, + 'endDay': 31, 'startMessage': TTLocalizer.BlackCatHolidayStart, 'ongoingMessage': TTLocalizer.BlackCatHolidayStart, 'endMessage': TTLocalizer.BlackCatHolidayEnd diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index f42a45b6..958e3f1c 100755 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -52,6 +52,7 @@ from toontown.tutorial.TutorialManagerAI import TutorialManagerAI from toontown.uberdog.DistributedPartyManagerAI import DistributedPartyManagerAI from toontown.uberdog.TopToonsManagerAI import TopToonsManagerAI #from toontown.uberdog.DistributedLobbyManagerAI import DistributedLobbyManagerAI +import threading class ToontownAIRepository(ToontownInternalRepository): def __init__(self, baseChannel, stateServerChannel, districtName): @@ -180,6 +181,9 @@ class ToontownAIRepository(ToontownInternalRepository): def handleConnected(self): ToontownInternalRepository.handleConnected(self) + threading.Thread(target=self.startDistrict).start() + + def startDistrict(self): self.districtId = self.allocateChannel() self.notify.info('Creating ToontownDistrictAI(%d)...' % self.districtId) self.distributedDistrict = ToontownDistrictAI(self) diff --git a/toontown/battle/BattleBase.py b/toontown/battle/BattleBase.py index 4500b89c..c3797665 100755 --- a/toontown/battle/BattleBase.py +++ b/toontown/battle/BattleBase.py @@ -229,8 +229,8 @@ class BattleBase: posA] suitSpeed = 4.8 toonSpeed = 8.0 - maxTimeToon = 10.0 - maxTimeSuit = 11.0 + maxTimeToon = 3.0 + maxTimeSuit = 4.0 def __init__(self): self.pos = Point3(0, 0, 0) diff --git a/toontown/battle/DistributedBattleBaseAI.py b/toontown/battle/DistributedBattleBaseAI.py index 95228535..3c1b31cc 100755 --- a/toontown/battle/DistributedBattleBaseAI.py +++ b/toontown/battle/DistributedBattleBaseAI.py @@ -993,6 +993,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas self.notify.warning('requestAttack() - no toon: %d' % toonId) return validResponse = 1 + self.npcAttacks = {k:v for k, v in self.npcAttacks.iteritems() if v != toonId} if track == SOS: self.notify.debug('toon: %d calls for help' % toonId) self.air.writeServerEvent('friendSOS', toonId, '%s' % av) @@ -1007,7 +1008,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas npcCollision = 0 if av in self.npcAttacks: callingToon = self.npcAttacks[av] - if self.activeToons.count(callingToon) == 1: + if callingToon != toonId and self.activeToons.count(callingToon) == 1: self.toonAttacks[toonId] = getToonAttack(toonId, track=PASS) npcCollision = 1 if npcCollision == 0: diff --git a/toontown/battle/MovieUtil.py b/toontown/battle/MovieUtil.py index 9590761e..be47b06b 100755 --- a/toontown/battle/MovieUtil.py +++ b/toontown/battle/MovieUtil.py @@ -255,17 +255,13 @@ def createSuitReviveTrack(suit, toon, battle, npcs = []): if hasattr(suit, 'battleTrapProp') and suit.battleTrapProp and suit.battleTrapProp.getName() == 'traintrack' and not suit.battleTrapProp.isHidden(): suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs)) deathSuit = suit.getLoseActor() - suitTrack.append(Func(notify.debug, 'before insertDeathSuit')) suitTrack.append(Func(insertReviveSuit, suit, deathSuit, battle, suitPos, suitHpr)) - suitTrack.append(Func(notify.debug, 'before actorInterval lose')) suitTrack.append(ActorInterval(deathSuit, 'lose', duration=SUIT_LOSE_REVIVE_DURATION)) - suitTrack.append(Func(notify.debug, 'before removeDeathSuit')) suitTrack.append(Func(removeReviveSuit, suit, deathSuit, name='remove-death-suit')) - suitTrack.append(Func(notify.debug, 'after removeDeathSuit')) suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.48, duration=0.1)) suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.58)) suitTrack.append(Func(suit.loop, 'neutral')) - suitTrack.append(Func(messenger.send, suit.uniqueName('hpChange'))) + suitTrack.append(Func(suit.setHP, suit.getMaxHP())) spinningSound = base.loadSfx('phase_3.5/audio/sfx/Cog_Death.ogg') deathSound = base.loadSfx('phase_3.5/audio/sfx/ENC_cogfall_apart_%s.ogg' % random.randint(1, 6)) deathSoundTrack = Sequence(Wait(0.8), SoundInterval(spinningSound, duration=1.2, startTime=1.5, volume=0.2), SoundInterval(spinningSound, duration=3.0, startTime=0.6, volume=0.8), SoundInterval(deathSound, volume=0.32)) diff --git a/toontown/building/DistributedElevator.py b/toontown/building/DistributedElevator.py index 83b244fc..8f0ad08a 100755 --- a/toontown/building/DistributedElevator.py +++ b/toontown/building/DistributedElevator.py @@ -465,7 +465,6 @@ class DistributedElevator(DistributedObject.DistributedObject): del self.elevatorFSM elevator.signalDone(doneStatus) base.camLens.setMinFov(ToontownGlobals.CBElevatorFov/(4./3.)) - return def getElevatorModel(self): self.notify.error('getElevatorModel: pure virtual -- inheritors must override') @@ -530,10 +529,7 @@ class DistributedElevator(DistributedObject.DistributedObject): return self.offsetNP.getPos(render) def canHideBoardingQuitBtn(self, avId): - if avId == localAvatar.doId and hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.groupPanel: - return True - else: - return False + return avId == localAvatar.doId and hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.groupPanel def getBoardingTrack(self, toon, seatIndex, wantToonRotation): self.boardingGroupShow = BoardingGroupShow.BoardingGroupShow(toon) diff --git a/toontown/building/DistributedKnockKnockDoor.py b/toontown/building/DistributedKnockKnockDoor.py index a1bdde91..ac28c792 100755 --- a/toontown/building/DistributedKnockKnockDoor.py +++ b/toontown/building/DistributedKnockKnockDoor.py @@ -53,11 +53,7 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp) def avatarExit(self, avatarId): if avatarId == self.avatarId: - for track in self.avatarTracks: - track.finish() - DelayDelete.cleanupDelayDeletes(track) - - self.avatarTracks = [] + self.stopTracks() def knockKnockTrack(self, avatar, duration): if avatar is None: @@ -96,7 +92,7 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp) return track def cleanupTrack(self): - avatar = self.cr.doId2do.get(self.avatarId, None) + avatar = self.cr.doId2do.get(self.avatarId) if avatar: avatar.clearChat() if self.nametag: @@ -105,7 +101,6 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp) self.nametag.destroy() self.nametag = None self.nametagNP = None - return def enterOff(self): DistributedAnimatedProp.DistributedAnimatedProp.enterOff(self) @@ -132,9 +127,13 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp) def exitPlaying(self): DistributedAnimatedProp.DistributedAnimatedProp.exitPlaying(self) + self.stopTracks() + + def stopTracks(self): for track in self.avatarTracks: - track.finish() + track.pause() DelayDelete.cleanupDelayDeletes(track) + self.cleanupTrack() self.avatarTracks = [] self.avatarId = 0 diff --git a/toontown/building/DistributedSuitInterior.py b/toontown/building/DistributedSuitInterior.py index 8d7688dd..78386e6b 100755 --- a/toontown/building/DistributedSuitInterior.py +++ b/toontown/building/DistributedSuitInterior.py @@ -365,6 +365,7 @@ class DistributedSuitInterior(DistributedObject.DistributedObject): def enterResting(self, ts = 0): base.playMusic(self.waitMusic, looping=1, volume=0.7) + base.localAvatar.questMap.stop() self.__closeInElevator() def exitResting(self): diff --git a/toontown/building/ToonInterior.py b/toontown/building/ToonInterior.py index 0e39640d..fb2f05d8 100755 --- a/toontown/building/ToonInterior.py +++ b/toontown/building/ToonInterior.py @@ -176,16 +176,17 @@ class ToonInterior(Place.Place): def enterTeleportIn(self, requestStatus): modelType = DistributedToonInterior.DistributedToonInterior(base.cr).getModelType(self.getZoneId()) - if ZoneUtil.isHQ(self.zoneId): + if self.zoneId == ToontownGlobals.ToonHall: + base.localAvatar.setPosHpr(-63.5, 30.5, ToontownGlobals.FloorOffset, 90.0, 0.0, 0.0) + elif ZoneUtil.isHQ(self.zoneId): base.localAvatar.setPosHpr(-5.5, -1.5, ToontownGlobals.FloorOffset, 0.0, 0.0, 0.0) elif ZoneUtil.isPetshop(self.zoneId): base.localAvatar.setPosHpr(0, 0, ToontownGlobals.FloorOffset, 45.0, 0.0, 0.0) + elif modelType in InteriorTypes: + area = InteriorTypes[modelType] + base.localAvatar.setPosHpr(area[0], area[1], ToontownGlobals.FloorOffset, area[2], 0.0, 0.0) else: - if modelType in InteriorTypes: - area = InteriorTypes[modelType] - base.localAvatar.setPosHpr(area[0], area[1], ToontownGlobals.FloorOffset, area[2], 0.0, 0.0) - else: - base.localAvatar.setPosHpr(2.5, 11.5, ToontownGlobals.FloorOffset, 45.0, 0.0, 0.0) + base.localAvatar.setPosHpr(2.5, 11.5, ToontownGlobals.FloorOffset, 45.0, 0.0, 0.0) Place.Place.enterTeleportIn(self, requestStatus) def enterTeleportOut(self, requestStatus): diff --git a/toontown/chat/ToontownChatManager.py b/toontown/chat/ToontownChatManager.py index 80301e3f..b0b89382 100755 --- a/toontown/chat/ToontownChatManager.py +++ b/toontown/chat/ToontownChatManager.py @@ -130,15 +130,9 @@ class ToontownChatManager(ChatManager.ChatManager): if avatarId: self.enterWhisperChat(avatarName, avatarId) self.whisperFrame.hide() - return def enterNormalChat(self): - if not base.cr.wantTypedChat(): - self.fsm.request('mainMenu') - return - result = ChatManager.ChatManager.enterNormalChat(self) - if result == None: - self.notify.warning('something went wrong in enterNormalChat, falling back to main menu') + if not base.cr.wantTypedChat() or not base.localAvatar.getTutorialAck() or not ChatManager.ChatManager.enterNormalChat(self): self.fsm.request('mainMenu') def enterWhisperChat(self, avatarName, avatarId): diff --git a/toontown/cogdominium/CogdoBarrelRoom.py b/toontown/cogdominium/CogdoBarrelRoom.py index 04a2147e..2d1ab2d1 100755 --- a/toontown/cogdominium/CogdoBarrelRoom.py +++ b/toontown/cogdominium/CogdoBarrelRoom.py @@ -23,7 +23,6 @@ class CogdoBarrelRoom: self.fog = None self.defaultFar = None self.stomperSfx = None - return def destroy(self): self.unload() @@ -71,7 +70,6 @@ class CogdoBarrelRoom: taskMgr.remove(self.rewardUiTaskName) taskMgr.remove(self.rewardCameraTaskName) self._isLoaded = False - return def isLoaded(self): return self._isLoaded diff --git a/toontown/cogdominium/DistributedCogdoInterior.py b/toontown/cogdominium/DistributedCogdoInterior.py index 837c3e3e..c599e426 100755 --- a/toontown/cogdominium/DistributedCogdoInterior.py +++ b/toontown/cogdominium/DistributedCogdoInterior.py @@ -113,7 +113,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self._movie = None self.SOSToonName = None self.FOType = None - return def setShopOwnerNpcId(self, npcId): self.shopOwnerNpcId = npcId @@ -202,13 +201,11 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.shopOwnerNpc.removeActive() self.shopOwnerNpc.delete() self.shopOwnerNpc = None - return def __cleanupPenthouseIntro(self): if hasattr(self, '_movie') and self._movie: self._movie.unload() self._movie = None - return def delete(self): self._stashEntranceElevatorFC.destroy() @@ -223,13 +220,9 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): del self.fsm base.localAvatar.inventory.setBattleCreditMultiplier(1) DistributedObject.DistributedObject.delete(self) - return def isBossFloor(self, floorNum): - if not self.layout.hasBossBattle(): - return False - - return (self.layout.getBossBattleFloor() + 0) == floorNum + return self.layout.hasBossBattle() and (self.layout.getBossBattleFloor() + 0) == floorNum def __cleanup(self): self.toons = [] @@ -251,7 +244,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.rightDoorIn = None self.leftDoorOut = None self.rightDoorOut = None - return def __addToon(self, toon): self.accept(toon.uniqueName('disable'), self.__handleUnexpectedExit, extraArgs=[toon]) @@ -404,7 +396,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): def enterWaitForAllToonsInside(self, ts = 0): base.transitions.fadeOut(0) - return None def exitWaitForAllToonsInside(self): return None @@ -568,7 +559,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self._movie.end() self.__cleanupPenthouseIntro() self.__finishInterval(self.elevatorName) - return None def __setupBarrelRoom(self): self.currentFloor += 1 @@ -607,7 +597,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.barrelRoomIntroTrack.finish() DelayDelete.cleanupDelayDeletes(self.barrelRoomIntroTrack) self.barrelRoomIntroTrack = None - return def __handleLocalToonLeftBarrelRoom(self): self.notify.info('Local toon teleported out of barrel room.') @@ -620,6 +609,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.acceptOnce('localToonLeft', self.__handleLocalToonLeftBarrelRoom) self.barrelRoom.activate() base.playMusic(self.waitMusic, looping=1, volume=0.7) + base.localAvatar.questMap.stop() def exitCollectBarrels(self): if self._wantBarrelRoom and not self.isBossFloor(self.currentFloor): @@ -675,13 +665,11 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.__playCloseElevatorOut(self.uniqueName('close-out-elevator')) camera.setPos(0, -15, 6) camera.headsUp(self.elevatorModelOut) - return None def exitBattle(self): if self.elevatorOutOpen == 1: self.__finishInterval(self.uniqueName('close-out-elevator')) self.elevatorOutOpen = 0 - return None def __playReservesJoining(self, ts, name, callback): index = 0 @@ -698,7 +686,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): def enterReservesJoining(self, ts = 0): self.__playReservesJoining(ts, self.uniqueName('reserves-joining'), self.__handleReserveJoinDone) - return None def __handleReserveJoinDone(self): self.joiningReserves = [] @@ -707,7 +694,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): def exitReservesJoining(self): self.__finishInterval(self.uniqueName('reserves-joining')) - return None def enterResting(self, ts = 0): self._showExitElevator() @@ -734,7 +720,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.penthouseOutroTrack.start(ts) else: self.exitCogdoBuilding() - return None def exitReward(self): self.notify.debug('exitReward') @@ -747,16 +732,13 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): self.__outroPenthouseChatDone() self.penthouseOutroChatDoneTrack.finish() self.penthouseOutroChatDoneTrack = None - return def enterFailed(self, ts = 0): self.exitCogdoBuilding() - return None def exitFailed(self): self.notify.debug('exitFailed()') self.exitCogdoBuilding() - return None def exitCogdoBuilding(self): if base.localAvatar.hp < 0: @@ -771,7 +753,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): 'avId': -1, 'bldgDoId': self.distBldgDoId} messenger.send('DSIDoneEvent', [request]) - return def displayBadges(self): numFloors = self.layout.getNumGameFloors() @@ -796,9 +777,8 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject): track = Parallel(name=trackName) base.cr.playGame.getPlace().fsm.request('stopped') - if self.FOType == "l": + if self.FOType == 'l': speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot - else: speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName diff --git a/toontown/coghq/CogHQExterior.py b/toontown/coghq/CogHQExterior.py index 4e186469..62a87610 100755 --- a/toontown/coghq/CogHQExterior.py +++ b/toontown/coghq/CogHQExterior.py @@ -99,7 +99,7 @@ class CogHQExterior(BattlePlace.BattlePlace): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def enterTunnelOut(self, requestStatus): fromZoneId = self.zoneId - self.zoneId % 100 diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index f2aba06a..dd35209b 100755 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -63,7 +63,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): self._playerAvDclass = self.dclassesByName['DistributedToon'] setInterfaceFont(TTLocalizer.InterfaceFont) setSignFont(TTLocalizer.SignFont) - setFancyFont(TTLocalizer.FancyFont) + setChalkFont(TTLocalizer.ChalkFont) for i in xrange(len(TTLocalizer.NametagFonts)): setNametagFont(i, TTLocalizer.NametagFonts[i]) diff --git a/toontown/estate/ClosetGUI.py b/toontown/estate/ClosetGUI.py index 94814a61..40c52089 100755 --- a/toontown/estate/ClosetGUI.py +++ b/toontown/estate/ClosetGUI.py @@ -11,7 +11,7 @@ from toontown.toonbase import TTLocalizer class ClosetGUI(ClothesGUI.ClothesGUI): notify = directNotify.newCategory('ClosetGUI') - def __init__(self, isOwner, doneEvent, cancelEvent, swapEvent, deleteEvent, topList = None, botList = None): + def __init__(self, isOwner, doneEvent, cancelEvent, swapEvent, deleteEvent, topList = None, botList = None, maxClothes = 0): ClothesGUI.ClothesGUI.__init__(self, ClothesGUI.CLOTHES_CLOSET, doneEvent, swapEvent) self.toon = None self.topsList = topList @@ -20,29 +20,31 @@ class ClosetGUI(ClothesGUI.ClothesGUI): self.deleteEvent = deleteEvent self.cancelEvent = cancelEvent self.genderChange = 0 + self.maxClothes = maxClothes self.verify = None - return def load(self): ClothesGUI.ClothesGUI.load(self) self.gui = loader.loadModel('phase_3/models/gui/create_a_toon_gui') self.cancelButton = DirectButton(relief=None, image=(self.gui.find('**/CrtAtoon_Btn2_UP'), self.gui.find('**/CrtAtoon_Btn2_DOWN'), self.gui.find('**/CrtAtoon_Btn2_RLLVR')), pos=(0.15, 0, -0.85), command=self.__handleCancel, text=('', TTLocalizer.MakeAToonCancel, TTLocalizer.MakeAToonCancel), text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08, text_pos=(0, -0.03), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1)) self.cancelButton.hide() + self.countFrame = DirectFrame(parent=self.parentFrame, image=self.shuffleFrame, image_scale=(-0.6, 0.6, 0.6), relief=None, pos=(0, 0, -0.125), scale=1.2, frameColor=(1, 1, 1, 1), text=TTLocalizer.ClothesGUICount % (0, 0), text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) if self.isOwner: - trashcanGui = loader.loadModel('phase_3/models/gui/trashcan_gui.bam') + trashcanGui = loader.loadModel('phase_3/models/gui/trashcan_gui') trashImage = (trashcanGui.find('**/TrashCan_CLSD'), trashcanGui.find('**/TrashCan_OPEN'), trashcanGui.find('**/TrashCan_RLVR')) self.trashPanel = DirectFrame(parent=aspect2d, image=DGG.getDefaultDialogGeom(), image_color=(1, 1, 0.75, 0.8), image_scale=(0.36, 0, 0.75), pos=(-.86, 0, -.05), relief=None) self.topTrashButton = DirectButton(parent=self.trashPanel, image=trashImage, relief=None, pos=(-0.09, 0, 0.2), command=self.__handleDelete, extraArgs=[ClosetGlobals.SHIRT], scale=(0.5, 0.5, 0.5), text=TTLocalizer.ClosetDeleteShirt, text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.12, text_pos=(0.3, 0), text_fg=(0.8, 0.2, 0.2, 1), text_shadow=(0, 0, 0, 1), textMayChange=0) self.bottomTrashButton = DirectButton(parent=self.trashPanel, image=trashImage, relief=None, textMayChange=1, pos=(-0.09, 0, -0.2), command=self.__handleDelete, extraArgs=[ClosetGlobals.SHORTS], scale=(0.5, 0.5, 0.5), text=TTLocalizer.ClosetDeleteShorts, text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.12, text_pos=(0.3, 0), text_fg=(0.8, 0.2, 0.2, 1), text_shadow=(0, 0, 0, 1)) self.button = DirectButton(relief=None, image=(self.gui.find('**/CrtAtoon_Btn1_UP'), self.gui.find('**/CrtAtoon_Btn1_DOWN'), self.gui.find('**/CrtAtoon_Btn1_RLLVR')), pos=(-0.15, 0, -0.85), command=self.__handleButton, text=('', TTLocalizer.MakeAToonDone, TTLocalizer.MakeAToonDone), text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08, text_pos=(0, -0.03), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1)) trashcanGui.removeNode() - return def unload(self): self.ignore('verifyDone') ClothesGUI.ClothesGUI.unload(self) self.cancelButton.destroy() del self.cancelButton + self.countFrame.destroy() + del self.countFrame if self.isOwner: self.topTrashButton.destroy() self.bottomTrashButton.destroy() @@ -108,7 +110,10 @@ class ClosetGUI(ClothesGUI.ClothesGUI): if self.isOwner: self.updateTrashButtons() self.setupButtons() - return + self.updateCount() + + def updateCount(self, clothes, maxClothes): + self.countFrame['text'] = TTLocalizer.ClothesGUICount % (clothes, maxClothes) def updateTrashButtons(self): if len(self.tops) < 2: @@ -124,6 +129,11 @@ class ClosetGUI(ClothesGUI.ClothesGUI): self.bottomTrashButton['text'] = TTLocalizer.ClosetDeleteSkirt else: self.bottomTrashButton['text'] = TTLocalizer.ClosetDeleteShorts + self.updateCount() + + def updateCount(self): + clothes = (len(self.tops) + len(self.bottoms)) - 2 + self.countFrame['text'] = TTLocalizer.ClothesGUICount % (clothes, self.maxClothes) def setGender(self, gender): self.ownerGender = gender diff --git a/toontown/estate/DistributedCloset.py b/toontown/estate/DistributedCloset.py index 0045c648..e16cd9ce 100755 --- a/toontown/estate/DistributedCloset.py +++ b/toontown/estate/DistributedCloset.py @@ -13,6 +13,7 @@ from direct.task.Task import Task import ClosetGlobals import DistributedFurnitureItem from toontown.toonbase import TTLocalizer +from toontown.catalog import CatalogFurnitureItem class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): notify = directNotify.newCategory('DistributedCloset') @@ -235,7 +236,8 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): if self.isOwner: self.accept(self.deleteEvent, self.__handleDelete) if not self.closetGUI: - self.closetGUI = ClosetGUI.ClosetGUI(self.isOwner, self.purchaseDoneEvent, self.cancelEvent, self.swapEvent, self.deleteEvent, self.topList, self.botList) + maxClothes = CatalogFurnitureItem.ClosetToClothes.get(self.item.furnitureType) + self.closetGUI = ClosetGUI.ClosetGUI(self.isOwner, self.purchaseDoneEvent, self.cancelEvent, self.swapEvent, self.deleteEvent, self.topList, self.botList, maxClothes) self.closetGUI.load() if self.gender != self.ownerGender: self.closetGUI.setGender(self.ownerGender) @@ -320,14 +322,6 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): else: self.notify.warning("cant delete this item(type = %s), since we don't have a replacement" % t_or_b) - def resetItemLists(self): - self.topList = self.oldTopList[0:] - self.botList = self.oldBotList[0:] - self.closetGUI.tops = self.topList - self.closetGUI.bottoms = self.botList - self.topDeleted = 0 - self.bottomDeleted = 0 - def __proceedToCheckout(self): if self.topDeleted or self.bottomDeleted: self.__popupAreYouSurePanel() @@ -360,7 +354,6 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): self.av.swapToonTorso(self.av.style.torso, genClothes=0) self.av.loop('neutral', 0) self.av.generateToonClothes() - return def printInfo(self): print 'avid: %s, gender: %s' % (self.av.doId, self.av.style.gender) @@ -425,7 +418,6 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): DirectButton(self.popupInfo, image=okButtonImage, relief=None, text=TTLocalizer.ClosetPopupOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.0, 0.0, -0.16), command=self.__handleTimeoutMessageOK) buttons.removeNode() self.popupInfo.reparentTo(aspect2d) - return def __handleTimeoutMessageOK(self): self.popupInfo.reparentTo(hidden) diff --git a/toontown/estate/DistributedClosetAI.py b/toontown/estate/DistributedClosetAI.py index fcd79408..bb72ea6f 100755 --- a/toontown/estate/DistributedClosetAI.py +++ b/toontown/estate/DistributedClosetAI.py @@ -206,8 +206,5 @@ class DistributedClosetAI(DistributedFurnitureItemAI): def setMovie(self, todo0, todo1, todo2): pass - def resetItemLists(self): - pass - def setCustomerDNA(self, todo0, todo1): pass diff --git a/toontown/estate/DistributedPhone.py b/toontown/estate/DistributedPhone.py index ca461e18..02813ca7 100755 --- a/toontown/estate/DistributedPhone.py +++ b/toontown/estate/DistributedPhone.py @@ -177,6 +177,7 @@ class DistributedPhone(DistributedFurnitureItem.DistributedFurnitureItem): self.notify.debug('Entering Phone Sphere....') taskMgr.remove(self.uniqueName('ringDoLater')) + base.localAvatar.obscureMoveFurnitureButton(1) self.cr.playGame.getPlace().detectedPhoneCollision() self.hasLocalAvatar = 1 self.sendUpdate('avatarEnter', []) @@ -184,6 +185,7 @@ class DistributedPhone(DistributedFurnitureItem.DistributedFurnitureItem): def __handlePhoneDone(self): self.sendUpdate('avatarExit', []) self.ignore(self.phoneGuiDoneEvent) + base.localAvatar.obscureMoveFurnitureButton(0) self.setPos(self.getPos()) self.phoneGui = None diff --git a/toontown/estate/DistributedTrunk.py b/toontown/estate/DistributedTrunk.py index 8dbadb8b..66c94ba4 100755 --- a/toontown/estate/DistributedTrunk.py +++ b/toontown/estate/DistributedTrunk.py @@ -231,20 +231,6 @@ class DistributedTrunk(DistributedCloset.DistributedCloset): else: self.notify.warning("cant delete this item(type = %s), since we don't have a replacement" % which) - def resetItemLists(self): - self.hatList = self.oldHatList[0:] - self.glassesList = self.oldGlassesList[0:] - self.backpackList = self.oldBackpackList[0:] - self.shoesList = self.oldShoesList[0:] - self.closetGUI.hat = self.hatList - self.closetGUI.glasses = self.glassesList - self.closetGUI.backpack = self.backpackList - self.closetGUI.shoes = self.shoesList - self.hatDeleted = 0 - self.glassesDeleted = 0 - self.backpackDeleted = 0 - self.shoesDeleted = 0 - def __proceedToCheckout(self): if self.hatDeleted or self.glassesDeleted or self.backpackDeleted or self.shoesDeleted: self.__popupAreYouSurePanel() diff --git a/toontown/estate/House.py b/toontown/estate/House.py index 7e896de7..25f04538 100755 --- a/toontown/estate/House.py +++ b/toontown/estate/House.py @@ -164,7 +164,7 @@ class House(Place.Place): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopSleepWatch() def enterBanking(self): diff --git a/toontown/estate/TrunkGUI.py b/toontown/estate/TrunkGUI.py index 7a26e96a..2a3017bb 100755 --- a/toontown/estate/TrunkGUI.py +++ b/toontown/estate/TrunkGUI.py @@ -31,25 +31,24 @@ class TrunkGUI(StateData.StateData): self.cancelEvent = cancelEvent self.genderChange = 0 self.verify = None - return def load(self): - self.gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') - guiRArrowUp = self.gui.find('**/tt_t_gui_mat_arrowUp') - guiRArrowRollover = self.gui.find('**/tt_t_gui_mat_arrowUp') - guiRArrowDown = self.gui.find('**/tt_t_gui_mat_arrowDown') - guiRArrowDisabled = self.gui.find('**/tt_t_gui_mat_arrowDisabled') - guiArrowRotateUp = self.gui.find('**/tt_t_gui_mat_arrowRotateUp') - guiArrowRotateDown = self.gui.find('**/tt_t_gui_mat_arrowRotateDown') - shuffleFrame = self.gui.find('**/tt_t_gui_mat_shuffleFrame') - shuffleArrowUp = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') - shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown') - shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') - shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled') - self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.416), frameColor=(1, 0, 0, 0)) + self.matGui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') + guiRArrowUp = self.matGui.find('**/tt_t_gui_mat_arrowUp') + guiRArrowRollover = self.matGui.find('**/tt_t_gui_mat_arrowUp') + guiRArrowDown = self.matGui.find('**/tt_t_gui_mat_arrowDown') + guiRArrowDisabled = self.matGui.find('**/tt_t_gui_mat_arrowDisabled') + guiArrowRotateUp = self.matGui.find('**/tt_t_gui_mat_arrowRotateUp') + guiArrowRotateDown = self.matGui.find('**/tt_t_gui_mat_arrowRotateDown') + self.shuffleFrame = self.matGui.find('**/tt_t_gui_mat_shuffleFrame') + shuffleArrowUp = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp') + shuffleArrowDown = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDown') + shuffleArrowRollover = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp') + shuffleArrowDisabled = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDisabled') + self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.216), frameColor=(1, 0, 0, 0)) def addFrame(posZ, text): - return DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, posZ), hpr=(0, 0, 3), scale=1.2, frameColor=(1, 1, 1, 1), text=text, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) + return DirectFrame(parent=self.parentFrame, image=self.shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, posZ), hpr=(0, 0, 3), scale=1.2, frameColor=(1, 1, 1, 1), text=text, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) def addButton(parent, scale, hoverScale, posX, command, extraArg): return DirectButton(parent=parent, relief=None, image=(shuffleArrowUp, @@ -57,6 +56,7 @@ class TrunkGUI(StateData.StateData): shuffleArrowRollover, shuffleArrowDisabled), image_scale=scale, image1_scale=hoverScale, image2_scale=hoverScale, pos=(posX, 0, 0), command=command, extraArgs=[extraArg]) + self.countFrame = addFrame(0.37, TTLocalizer.ClothesGUICount % (0, 0)) self.hatFrame = addFrame(0.1, TTLocalizer.TrunkHatGUI) self.hatLButton = addButton(self.hatFrame, halfButtonScale, halfButtonHoverScale, -0.2, self.swapHat, -1) self.hatRButton = addButton(self.hatFrame, halfButtonInvertScale, halfButtonInvertHoverScale, 0.2, self.swapHat, 1) @@ -103,7 +103,6 @@ class TrunkGUI(StateData.StateData): self.shoesTrashButton = addTrashButton(-0.4, TTLocalizer.TrunkDeleteShoes, ToonDNA.SHOES) self.button = DirectButton(relief=None, image=(self.gui.find('**/CrtAtoon_Btn1_UP'), self.gui.find('**/CrtAtoon_Btn1_DOWN'), self.gui.find('**/CrtAtoon_Btn1_RLLVR')), pos=(-0.15, 0, -0.85), command=self.__handleButton, text=('', TTLocalizer.MakeAToonDone, TTLocalizer.MakeAToonDone), text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08, text_pos=(0, -0.03), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1)) trashcanGui.removeNode() - return def unload(self): taskMgr.remove(self.taskName('rotateL')) @@ -111,7 +110,11 @@ class TrunkGUI(StateData.StateData): self.ignore('verifyDone') self.gui.removeNode() del self.gui + self.matGui.removeNode() + del self.matGui + del self.shuffleFrame self.parentFrame.destroy() + self.countFrame.destroy() self.hatFrame.destroy() self.glassesFrame.destroy() self.backpackFrame.destroy() @@ -124,6 +127,7 @@ class TrunkGUI(StateData.StateData): self.backpackRButton.destroy() self.shoesLButton.destroy() self.shoesRButton.destroy() + del self.countFrame del self.parentFrame del self.hatFrame del self.glassesFrame @@ -286,7 +290,7 @@ class TrunkGUI(StateData.StateData): self.swapShoes(0) self.updateTrashButtons() self.setupButtons() - return + self.updateCountFrame() def updateTrashButtons(self): if not self.isOwner: @@ -307,6 +311,11 @@ class TrunkGUI(StateData.StateData): self.shoesTrashButton['state'] = DGG.DISABLED else: self.shoesTrashButton['state'] = DGG.NORMAL + self.updateCountFrame() + + def updateCountFrame(self): + accessories = (len(self.hats) + len(self.glasses) + len(self.backpacks) + len(self.shoes)) - 4 + self.countFrame['text'] = TTLocalizer.ClothesGUICount % (accessories, ToontownGlobals.MaxAccessories) def rotateToonL(self, task): self.toon.setH(self.toon.getH() - 4) diff --git a/toontown/fishing/DistributedFishingPond.py b/toontown/fishing/DistributedFishingPond.py index dd2db7bf..5bb8bef4 100755 --- a/toontown/fishing/DistributedFishingPond.py +++ b/toontown/fishing/DistributedFishingPond.py @@ -90,7 +90,7 @@ class DistributedFishingPond(DistributedObject.DistributedObject): return self.pondBingoMgr def hasPondBingoManager(self): - return (self.pondBingoMgr and [1] or [0])[0] + return self.pondBingoMgr is not None def handleBingoCatch(self, catch): if self.pondBingoMgr: diff --git a/toontown/hood/Place.py b/toontown/hood/Place.py index 21aca716..c501bb8c 100755 --- a/toontown/hood/Place.py +++ b/toontown/hood/Place.py @@ -187,7 +187,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.invPage.hideInventoryOnscreen() base.localAvatar.questMap.hide() base.localAvatar.questMap.ignoreOnscreenHooks() - return def handleWalkDone(self, doneStatus): mode = doneStatus['mode'] @@ -293,7 +292,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): self.ignore('bookDone') base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) target = base.cr.doFind('DistributedTarget') if target: target.showGui() @@ -445,13 +444,13 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def exitDoorIn(self): NametagGlobals.setMasterArrowsOn(1) - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def enterDoorOut(self): base.localAvatar.obscureMoveFurnitureButton(1) def exitDoorOut(self): - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopQuestMap() def handleDoorDoneEvent(self, requestStatus): @@ -495,7 +494,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): self.accept('tunnelOutMovieDone', self.__tunnelOutMovieDone) base.localAvatar.tunnelOut(tunnelOrigin) base.localAvatar.stopQuestMap() - return def __tunnelOutMovieDone(self): self.ignore('tunnelOutMovieDone') @@ -512,7 +510,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def exitTeleportOut(self): base.localAvatar.laffMeter.stop() base.localAvatar.stopQuestMap() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def enterDied(self, requestStatus, callback = None): if callback == None: @@ -529,7 +527,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): def exitDied(self): base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def getEstateZoneAndGoHome(self, requestStatus): self.doneStatus = requestStatus @@ -647,7 +645,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): self._tiToken = None NametagGlobals.setMasterArrowsOn(1) base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopUpdateSmartCamera() base.localAvatar.detachCamera() base.localAvatar.stopPosHprBroadcast() @@ -692,7 +690,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def enterPurchase(self): base.localAvatar.b_setAnimState('neutral', 1) @@ -705,7 +703,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) def enterFishing(self): base.localAvatar.b_setAnimState('neutral', 1) @@ -736,7 +734,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopSleepWatch() def enterPhone(self): @@ -757,7 +755,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopSleepWatch() def enterStopped(self): @@ -783,7 +781,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager): base.localAvatar.setTeleportAvailable(0) self.ignore('teleportQuery') base.localAvatar.laffMeter.stop() - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0) base.localAvatar.stopSleepWatch() messenger.send('exitingStoppedState') diff --git a/toontown/makeatoon/ClothesGUI.py b/toontown/makeatoon/ClothesGUI.py index 22136c98..1d4ea4b5 100755 --- a/toontown/makeatoon/ClothesGUI.py +++ b/toontown/makeatoon/ClothesGUI.py @@ -25,20 +25,20 @@ class ClothesGUI(StateData.StateData): return def load(self): - self.gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') - guiRArrowUp = self.gui.find('**/tt_t_gui_mat_arrowUp') - guiRArrowRollover = self.gui.find('**/tt_t_gui_mat_arrowUp') - guiRArrowDown = self.gui.find('**/tt_t_gui_mat_arrowDown') - guiRArrowDisabled = self.gui.find('**/tt_t_gui_mat_arrowDisabled') - shuffleFrame = self.gui.find('**/tt_t_gui_mat_shuffleFrame') - shuffleArrowUp = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') - shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown') - shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') - shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled') + self.matGui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') + guiRArrowUp = self.matGui.find('**/tt_t_gui_mat_arrowUp') + guiRArrowRollover = self.matGui.find('**/tt_t_gui_mat_arrowUp') + guiRArrowDown = self.matGui.find('**/tt_t_gui_mat_arrowDown') + guiRArrowDisabled = self.matGui.find('**/tt_t_gui_mat_arrowDisabled') + self.shuffleFrame = self.matGui.find('**/tt_t_gui_mat_shuffleFrame') + shuffleArrowUp = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp') + shuffleArrowDown = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDown') + shuffleArrowRollover = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp') + shuffleArrowDisabled = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDisabled') self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.416), frameColor=(1, 0, 0, 0)) self.parentFrame.setPos(-0.36, 0, -0.5) self.parentFrame.reparentTo(base.a2dTopRight) - self.shirtFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.4), hpr=(0, 0, 3), scale=1.2, frameColor=(1, 1, 1, 1), text=TTLocalizer.ClothesShopShirt, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) + self.shirtFrame = DirectFrame(parent=self.parentFrame, image=self.shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.4), hpr=(0, 0, 3), scale=1.2, frameColor=(1, 1, 1, 1), text=TTLocalizer.ClothesShopShirt, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.topLButton = DirectButton(parent=self.shirtFrame, relief=None, image=(shuffleArrowUp, shuffleArrowDown, shuffleArrowRollover, @@ -47,7 +47,7 @@ class ClothesGUI(StateData.StateData): shuffleArrowDown, shuffleArrowRollover, shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.swapTop, extraArgs=[1]) - self.bottomFrame = DirectFrame(parent=self.parentFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.65), hpr=(0, 0, -2), scale=1.2, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopToon, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) + self.bottomFrame = DirectFrame(parent=self.parentFrame, image=self.shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(0, 0, -0.65), hpr=(0, 0, -2), scale=1.2, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorShopToon, text_scale=0.0575, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) self.bottomLButton = DirectButton(parent=self.bottomFrame, relief=None, image=(shuffleArrowUp, shuffleArrowDown, shuffleArrowRollover, @@ -59,11 +59,10 @@ class ClothesGUI(StateData.StateData): self.parentFrame.hide() self.shuffleFetchMsg = 'ClothesShopShuffle' self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg) - return def unload(self): - self.gui.removeNode() - del self.gui + self.matGui.removeNode() + del self.matGui self.parentFrame.destroy() self.shirtFrame.destroy() self.bottomFrame.destroy() @@ -71,6 +70,7 @@ class ClothesGUI(StateData.StateData): self.topRButton.destroy() self.bottomLButton.destroy() self.bottomRButton.destroy() + del self.shuffleFrame del self.parentFrame del self.shirtFrame del self.bottomFrame diff --git a/toontown/makeatoon/ColorShop.py b/toontown/makeatoon/ColorShop.py index 9ed310cb..c9bf9adc 100755 --- a/toontown/makeatoon/ColorShop.py +++ b/toontown/makeatoon/ColorShop.py @@ -91,7 +91,7 @@ class ColorShop(StateData.StateData): self.pickContainer.setTransparency(True) self.pickImage = PNMImage(int((ToontownGlobals.COLOR_SATURATION_MAX - ToontownGlobals.COLOR_SATURATION_MIN) * 100), int((ToontownGlobals.COLOR_VALUE_MAX - ToontownGlobals.COLOR_VALUE_MIN) * 100)) self.hueSlider = DirectSlider(parent=self.advancedFrame, relief=None, image='phase_3/maps/color_picker_hue.jpg', scale=0.3, pos=(-0.05, 0, -0.43), image_scale=(0.1, 1.0, 1.0), pageSize=5, orientation=DGG.VERTICAL, command=self.__chooseHue) - self.pickButton = DirectButton(parent=self.advancedFrame, relief=None, image='phase_3/maps/color_picker_empty.png', scale=0.3, pos=(-0.45, 0, -0.43), frameColor=(1, 1, 1, 0.1), pressEffect=0) + self.pickButton = DirectButton(parent=self.advancedFrame, relief=None, image='phase_3/maps/invisible.png', scale=0.3, pos=(-0.45, 0, -0.43), frameColor=(1, 1, 1, 0.1), pressEffect=0) self.pickButton.bind(DGG.B1PRESS, self.__startPickColor) self.pickButton.bind(DGG.B1RELEASE, self.__stopPickColor) self.partsFrame = DirectFrame(parent=self.advancedFrame, image=shuffleFrame, image_scale=halfButtonInvertScale, relief=None, pos=(-0.395, 0, -0.85), hpr=(0, 0, -2), scale=0.9, frameColor=(1, 1, 1, 1), text=TTLocalizer.ColorAll, text_scale=0.0625, text_pos=(-0.001, -0.015), text_fg=(1, 1, 1, 1)) diff --git a/toontown/quest/QuestMap.py b/toontown/quest/QuestMap.py index 038601c7..1cb2dbab 100755 --- a/toontown/quest/QuestMap.py +++ b/toontown/quest/QuestMap.py @@ -30,9 +30,6 @@ class QuestMap(DirectFrame): self.cogInfoFrame.setPos(0, 0, 0.6) self.buildingMarkers = [] self.av = av - self.wantToggle = False - if base.config.GetBool('want-toggle-quest-map', True): - self.wantToggle = True self.updateMarker = True self.cornerPosInfo = None self.hqPosInfo = None @@ -47,8 +44,6 @@ class QuestMap(DirectFrame): tracks = currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_TRACK] self.suitPercentage[currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_ZONE]] = tracks - return - def load(self): gui = loader.loadModel('phase_4/models/questmap/questmap_gui') icon = gui.find('**/tt_t_gui_qst_arrow') @@ -279,7 +274,6 @@ class QuestMap(DirectFrame): self.obscureButton() self.ignore('questPageUpdated') taskMgr.remove('questMapUpdate') - return def handleMarker(self): if hasattr(base.cr.playGame.getPlace(), 'isInterior') and base.cr.playGame.getPlace().isInterior: @@ -288,15 +282,9 @@ class QuestMap(DirectFrame): self.updateMarker = True def acceptOnscreenHooks(self): - if self.wantToggle: - self.accept(ToontownGlobals.MapHotkey, self.toggle) - else: - self.accept(ToontownGlobals.MapHotkeyOn, self.show) - self.accept(ToontownGlobals.MapHotkeyOff, self.hide) + self.accept(ToontownGlobals.MapHotkey, self.toggle) self.updateMap() def ignoreOnscreenHooks(self): self.ignore(ToontownGlobals.MapHotkey) - self.ignore(ToontownGlobals.MapHotkeyOn) - self.ignore(ToontownGlobals.MapHotkeyOff) self.obscureButton() diff --git a/toontown/quest/QuestParser.py b/toontown/quest/QuestParser.py index db41baba..fbe13bc4 100755 --- a/toontown/quest/QuestParser.py +++ b/toontown/quest/QuestParser.py @@ -406,8 +406,11 @@ class NPCMoviePlayer(DirectObject.DirectObject): self.closePreviousChapter(iList) chapterList = [] self.currentEvent = nextEvent + elif command == 'TUTORIAL_ACK_DONE': + iList.append(Func(base.localAvatar.setTutorialAck, True)) else: notify.warning('Unknown command token: %s for scriptId: %s on line: %s' % (command, self.scriptId, lineNum)) + self.closePreviousChapter(chapterList) if timeoutList: diff --git a/toontown/quest/QuestPoster.py b/toontown/quest/QuestPoster.py index a5b9c577..9ccb40cf 100755 --- a/toontown/quest/QuestPoster.py +++ b/toontown/quest/QuestPoster.py @@ -73,11 +73,18 @@ class QuestPoster(DirectFrame): self.teleportButton = DirectButton(parent=self.questFrame, relief=None, image=circleModel, text=TTLocalizer.TeleportButton, text_scale=0.035, text_pos=(-0.0025, -0.015), pos=(0.175, 0, 0.125), scale=0.75) #, text_bg=(0, 0.75, 1, 1) self.teleportButton.hide() self.laffMeter = None - return + self.dialog = None def destroy(self): self._deleteGeoms() + self.destroyDialog() DirectFrame.destroy(self) + + def destroyDialog(self, extra=None): + if self.dialog: + self.dialog.destroy() + self.dialog = None + base.cr.playGame.getPlace().setState('walk') def _deleteGeoms(self): for icon in (self.lQuestIcon, self.rQuestIcon): @@ -153,11 +160,7 @@ class QuestPoster(DirectFrame): def loadElevator(self, building, numFloors): elevatorNodePath = hidden.attachNewNode('elevatorNodePath') elevatorModel = loader.loadModel('phase_4/models/modules/elevator') - floorIndicator = [None, - None, - None, - None, - None] + floorIndicator = [None] * 5 npc = elevatorModel.findAllMatches('**/floor_light_?;+s') for i in xrange(npc.getNumPaths()): np = npc.getPath(i) @@ -174,6 +177,9 @@ class QuestPoster(DirectFrame): elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0) def teleportToShop(self, npcId): + if base.cr.playGame.getPlace().getState() != 'walk': + return + npcZone = NPCToons.getNPCZone(npcId) npcHood = ZoneUtil.getCanonicalHoodId(npcZone) hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505} @@ -184,15 +190,32 @@ class QuestPoster(DirectFrame): zoneId = 2000 npcHood = ZoneUtil.getCanonicalHoodId(zoneId) npcZone = hqZone.get(npcHood, 2520) + + cost = ToontownGlobals.getTeleportButtonCost(npcHood) + self.destroyDialog() + base.cr.playGame.getPlace().setState('stopped') + + if base.localAvatar.getTotalMoney() < cost: + self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.TeleportButtonNoMoney % cost, command=self.destroyDialog) + else: + self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.TeleportButtonConfirm % cost, command=lambda value: self.teleportToShopConfirm(npcZone, npcHood, cost, value)) - base.cr.buildingQueryMgr.d_isSuit(npcZone, lambda isSuit: self.teleportToShopCallback(npcZone, npcHood, isSuit)) + self.dialog.show() - def teleportToShopCallback(self, npcZone, npcHood, flag): + def teleportToShopConfirm(self, npcZone, npcHood, cost, value): + self.destroyDialog() + + if value > 0: + base.cr.buildingQueryMgr.d_isSuit(npcZone, lambda isSuit: self.teleportToShopCallback(npcZone, npcHood, cost, isSuit)) + + def teleportToShopCallback(self, npcZone, npcHood, cost, flag): if flag: - self.teleportButton.setColorScale(0.3, 0.3, 0.3, 1.0) + base.cr.playGame.getPlace().setState('stopped') + self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.TeleportButtonTakenOver, command=self.destroyDialog) + self.dialog.show() return - self.teleportButton.setColorScale(1.0, 1.0, 1.0, 1.0) + base.localAvatar.takeMoney(cost) base.cr.playGame.getPlace().requestTeleport(npcHood, npcZone, base.localAvatar.defaultShard, -1) def fitGeometry(self, geom, fFlip = 0, dimension = 0.8): @@ -228,6 +251,7 @@ class QuestPoster(DirectFrame): self.rPictureFrame.hide() self.questProgress.hide() self.teleportButton.hide() + self.destroyDialog() if hasattr(self, 'chooseButton'): self.chooseButton.destroy() del self.chooseButton diff --git a/toontown/quest/QuestScripts.py b/toontown/quest/QuestScripts.py index 18d1b2da..77f59772 100755 --- a/toontown/quest/QuestScripts.py +++ b/toontown/quest/QuestScripts.py @@ -253,7 +253,8 @@ WAIT 0.5 WRTREPARENTTO chatNormalButton topLeft LERP_POS chatNormalButton 0.068 0 -0.072 0.6 LERP_SCALE chatNormalButton 1.179 1.179 1.179 0.6 -WAIT 0.6 +WAIT 0.6 +TUTORIAL_ACK_DONE LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_7 "CFReversed" LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_8 1 "CFReversed" LOOP_ANIM npc "walk" diff --git a/toontown/racing/DistributedRace.py b/toontown/racing/DistributedRace.py index 8a55d038..035354a1 100755 --- a/toontown/racing/DistributedRace.py +++ b/toontown/racing/DistributedRace.py @@ -551,14 +551,14 @@ class DistributedRace(DistributedObject.DistributedObject): newLapT = (newT - self.startT) / self.curve.getMaxT() % 1.0 if newLapT - self.currLapT < -0.5: self.laps += 1 - self.changeMusicTempo(1 + self.laps * 0.33) + self.changeMusicTempo(1 + self.laps * 0.5) self.notify.debug('crossed the start line: %s, %s, %s, %s' % (self.laps, self.startT, self.currT, newT)) elif newLapT - self.currLapT > 0.5: self.laps -= 1 - self.changeMusicTempo(1 + self.laps * 0.33) + self.changeMusicTempo(1 + self.laps * 0.5) self.notify.debug('crossed the start line - wrong way: %s, %s, %s, %s' % (self.laps, self.startT, self.currT, diff --git a/toontown/racing/DistributedRaceAI.py b/toontown/racing/DistributedRaceAI.py index a4cb502f..1791149d 100755 --- a/toontown/racing/DistributedRaceAI.py +++ b/toontown/racing/DistributedRaceAI.py @@ -33,6 +33,7 @@ class DistributedRaceAI(DistributedObjectAI, FSM): self.livingGags = [] self.currentlyAffectedByAnvil = {} self.avatarProgress = {} + self.startTime = globalClockDelta.networkToLocalTime(globalClockDelta.getRealNetworkTime()) + 3 def generate(self): for avatar in self.avatars: diff --git a/toontown/safezone/DistributedFishingSpot.py b/toontown/safezone/DistributedFishingSpot.py index 078f197f..d4a4e1d4 100755 --- a/toontown/safezone/DistributedFishingSpot.py +++ b/toontown/safezone/DistributedFishingSpot.py @@ -568,6 +568,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): self.sellFishConfirmDialog.hide() self.brokeDialog.hide() self.howToDialog.hide() + self.exitButton.hide() self.castButton.unbind(DGG.B1PRESS) self.castButton.unbind(DGG.B3PRESS) self.castButton.unbind(DGG.B1RELEASE) @@ -592,7 +593,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): self.castGui.setPos(0, 1, 0) for nodeName in ('bucket', 'jar', 'display_bucket', 'display_jar'): self.castGui.find('**/' + nodeName).reparentTo(self.castGui) - self.exitButton = DirectButton(parent=self.castGui, relief=None, text=('', TTLocalizer.FishingExit, TTLocalizer.FishingExit), text_align=TextNode.ACenter, text_scale=0.1, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0.0, -0.12), pos=(1.75*(4./3.), 0, -1.33), textMayChange=0, image=(self.castGui.find('**/exit_buttonUp'), self.castGui.find('**/exit_buttonDown'), self.castGui.find('**/exit_buttonRollover')), command=self.__userExit) + self.exitButton = DirectButton(parent=base.a2dBottomRight, relief=None, text=('', TTLocalizer.FishingExit, TTLocalizer.FishingExit), text_align=TextNode.ACenter, text_scale=0.1, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0.0, -0.12), pos=(-0.218, 0, 0.11), scale=0.8, textMayChange=0, image=(self.castGui.find('**/exit_buttonUp'), self.castGui.find('**/exit_buttonDown'), self.castGui.find('**/exit_buttonRollover')), command=self.__userExit) self.castGui.find('**/exitButton').removeNode() self.castButton = DirectButton(parent=self.castGui, relief=None, text=TTLocalizer.FishingCast, text_align=TextNode.ACenter, text_scale=(3, 3 * 0.75, 3 * 0.75), text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -4), image=self.castGui.find('**/castButton'), image0_color=(1, 0, 0, 1), image1_color=(0, 1, 0, 1), image2_color=(1, 1, 0, 1), image3_color=(0.8, 0.5, 0.5, 1), pos=(0, -0.05, -0.666), scale=(0.036, 1, 0.048)) self.castGui.find('**/castButton').removeNode() @@ -1050,9 +1051,4 @@ class DistributedFishingSpot(DistributedObject.DistributedObject): self.fsm.request('waiting', [False]) def __allowSellFish(self): - if base.wantBingo: - if self.pond.hasPondBingoManager(): - hoodId = base.cr.playGame.getPlaceId() - if hoodId == ToontownGlobals.MyEstate: - return True - return False + return base.wantBingo and self.pond.hasPondBingoManager() diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index afa5cdeb..cda4d2f5 100755 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -731,27 +731,30 @@ class ExtraOptionsTabPage(DirectFrame): self.fov_label = DirectLabel(parent=self, relief=None, text=TTLocalizer.FieldOfViewLabel, text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight)) self.cogInterface_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - textRowHeight)) self.tpTransition_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 2 * textRowHeight)) - self.teleport_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 3 * textRowHeight)) + self.fpsMeter_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 3 * textRowHeight)) + self.teleport_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 4 * textRowHeight)) self.fov_slider = DirectSlider(parent=self, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), value=settings['fov'], pageSize=5, range=(ToontownGlobals.DefaultCameraFov, ToontownGlobals.MaxCameraFov), command=self.__doFov, thumb_geom=(circleModel.find('**/tt_t_gui_mat_namePanelCircle')), thumb_relief=None, thumb_geom_scale=2) self.fov_slider.setScale(0.25) self.cogInterface_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight), command=self.__doToggleCogInterface) self.tpTransition_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 2 * textRowHeight), command=self.__doToggleTpTransition) - self.teleport_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 3 * textRowHeight), command=self.__doToggleTeleport) + self.fpsMeter_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 3 * textRowHeight), command=self.__doToggleFpsMeter) + self.teleport_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 4 * textRowHeight), command=self.__doToggleTeleport) self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=button_image, image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045)) guiButton.removeNode() circleModel.removeNode() - self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 4, self.__updateFishingPole, [False], self.__applyFishingPole) - self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 5, self.__updateNametagStyle, [False], self.__applyNametagStyle) + self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 5, self.__updateFishingPole, [False], self.__applyFishingPole) + self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 6, self.__updateNametagStyle, [False], self.__applyNametagStyle) def enter(self): self.show() self.settingsChanged = 0 self.__setCogInterfaceButton() self.__setTpTransitionButton() + self.__setFpsMeterButton() self.__setTeleportButton() self.__updateNametagStyle() self.__updateFishingPole() @@ -779,6 +782,10 @@ class ExtraOptionsTabPage(DirectFrame): del self.tpTransition_label self.tpTransition_toggleButton.destroy() del self.tpTransition_toggleButton + self.fpsMeter_label.destroy() + del self.fpsMeter_label + self.fpsMeter_toggleButton.destroy() + del self.fpsMeter_toggleButton self.teleport_label.destroy() del self.teleport_label self.teleport_toggleButton.destroy() @@ -815,6 +822,17 @@ class ExtraOptionsTabPage(DirectFrame): self.tpTransition_label['text'] = TTLocalizer.TpTransitionLabelOn if settings['tpTransition'] else TTLocalizer.TpTransitionLabelOff self.tpTransition_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['tpTransition'] else TTLocalizer.OptionsPageToggleOn + def __doToggleFpsMeter(self): + messenger.send('wakeup') + settings['fpsMeter'] = not settings['fpsMeter'] + base.setFrameRateMeter(settings['fpsMeter']) + self.settingsChanged = 1 + self.__setFpsMeterButton() + + def __setFpsMeterButton(self): + self.fpsMeter_label['text'] = TTLocalizer.FpsMeterLabelOn if settings['fpsMeter'] else TTLocalizer.FpsMeterLabelOff + self.fpsMeter_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['fpsMeter'] else TTLocalizer.OptionsPageToggleOn + def __doToggleTeleport(self): messenger.send('wakeup') acceptingTeleport = settings.get('acceptingTeleport', {}) diff --git a/toontown/shtiker/ShtikerBook.py b/toontown/shtiker/ShtikerBook.py index 0874ac99..baddb5e7 100755 --- a/toontown/shtiker/ShtikerBook.py +++ b/toontown/shtiker/ShtikerBook.py @@ -21,8 +21,7 @@ class ShtikerBook(DirectFrame, StateData.StateData): self.pages = [] self.pageTabs = [] self.currPageTabIndex = None - self.pageTabFrame = DirectFrame(parent=self, relief=None, pos=(0.93, 1, 0.575), scale=1.25) - self.pageTabFrame.hide() + self.pageTabFrames = [self.createPageTabFrame(x) for x in (-0.93, 0.93)] self.currPageIndex = None self.entered = 0 self.safeMode = 0 @@ -47,6 +46,11 @@ class ShtikerBook(DirectFrame, StateData.StateData): TTLocalizer.PhotoPageTitle, TTLocalizer.EventsPageName, TTLocalizer.StatPageTitle] + + def createPageTabFrame(self, x): + frame = DirectFrame(parent=self, relief=None, pos=(x, 0, 0.66), scale=1.25) + frame.hide() + return frame def setSafeMode(self, setting): self.safeMode = setting @@ -76,7 +80,8 @@ class ShtikerBook(DirectFrame, StateData.StateData): self.accept('shtiker-page-done', self.__pageDone) self.accept(ToontownGlobals.StickerBookHotkey, self.__close) self.accept(ToontownGlobals.OptionsPageHotkey, self.__close) - self.pageTabFrame.show() + for tab in self.pageTabFrames: + tab.show() self.pages[self.currPageIndex].enter() def exit(self): @@ -106,7 +111,8 @@ class ShtikerBook(DirectFrame, StateData.StateData): self.hide() self.hideButton() cleanupDialog('globalDialog') - self.pageTabFrame.hide() + for tab in self.pageTabFrames: + tab.hide() self.ignore('shtiker-page-done') self.ignore(ToontownGlobals.StickerBookHotkey) self.ignore(ToontownGlobals.OptionsPageHotkey) @@ -178,7 +184,7 @@ class ShtikerBook(DirectFrame, StateData.StateData): if base.config.GetBool('want-qa-regression', 0): self.notify.info('QA-REGRESSION: SHTICKERBOOK: Browse tabs %s' % page.pageName) - yOffset = 0.07 * pageIndex + yOffset = 0.07 * (pageIndex % 16) iconGeom = None iconImage = None iconScale = 1 @@ -257,13 +263,14 @@ class ShtikerBook(DirectFrame, StateData.StateData): iconModels.detachNode() if pageName == TTLocalizer.OptionsPageTitle: pageName = TTLocalizer.OptionsTabTitle - pageTab = DirectButton(parent=self.pageTabFrame, relief=DGG.RAISED, frameSize=(-0.575, + rightSide = pageIndex < 16 + pageTab = DirectButton(parent=self.pageTabFrames[rightSide], relief=DGG.RAISED, frameSize=(-0.575, 0.575, -0.575, 0.575), borderWidth=(0.05, 0.05), text=('', '', pageName, - ''), text_align=TextNode.ALeft, text_pos=(1, -0.2), text_scale=TTLocalizer.SBpageTab, text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), image=iconImage, image_scale=iconScale, geom=iconGeom, geom_scale=iconScale, geom_color=iconColor, pos=(0, 0, -yOffset), scale=0.06, command=buttonPressedCommand, extraArgs=extraArgs) + ''), text_align=TextNode.ALeft, text_pos=(1 if rightSide else -4, -0.2), text_scale=TTLocalizer.SBpageTab, text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), image=iconImage, image_scale=iconScale, geom=iconGeom, geom_scale=iconScale, geom_color=iconColor, pos=(0, 0, -yOffset), scale=0.06, command=buttonPressedCommand, extraArgs=extraArgs) self.pageTabs.insert(pageIndex, pageTab) return diff --git a/toontown/shtiker/StatPage.py b/toontown/shtiker/StatPage.py index 9c38a7f8..a945aae3 100644 --- a/toontown/shtiker/StatPage.py +++ b/toontown/shtiker/StatPage.py @@ -1,24 +1,21 @@ from direct.gui.DirectGui import * -from toontown.toonbase import TTLocalizer +from toontown.toonbase import TTLocalizer, ToontownGlobals from toontown.toontowngui import TTDialog import ShtikerPage -STATS = ['cog', 'v2', 'skele', 'beanSpent', 'beanEarnt', 'task', 'vp', 'cfo', 'cj', 'ceo', 'sad', 'bldg', 'cogdo', 'item', 'fish', 'flower', 'race', 'golf', 'sos', 'unite', 'slip', 'gag'] - class StatPage(ShtikerPage.ShtikerPage): - def __init__(self): + ShtikerPage.ShtikerPage.__init__(self) self.dialog = None + self.chunkCount = 11 def load(self): guiButton = loader.loadModel('phase_3/models/gui/quit_button') - self.rows = [None] * 2 - self.title = DirectLabel(parent=self, relief=None, text=TTLocalizer.StatPageTitle, text_scale=0.12, textMayChange=0, pos=(0, 0, 0.6)) - self.rows[0] = DirectLabel(parent=self, relief=None, text_align=TextNode.ALeft, text='', text_scale=0.06, text_wordwrap=16, pos=(-0.8, 0, 0.515)) - self.rows[1] = DirectLabel(parent=self, relief=None, text_align=TextNode.ALeft, text='', text_scale=0.06, text_wordwrap=16, pos=(0.05, 0, 0.515)) - self.resetButton = empty = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(1.1, 1, 1), text='Reset stats', text_scale=0.055, text_pos=(0, -0.02), pos=(-0.55, 0.0, 0.65), command=self.__showDialog) + self.rows = [self.createRow(pos) for pos in ((-0.8, 0, 0.435), (0.08, 0, 0.435))] + self.title = DirectLabel(parent=self, relief=None, text=TTLocalizer.StatPageTitle, text_scale=0.12, textMayChange=0, pos=(-0.625, 0, 0.625)) + self.resetButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(1.1, 1, 1), text=TTLocalizer.StatPageClear, text_scale=0.055, text_pos=(0, -0.02), pos=(0.605, 0, 0.66), command=self.__showDialog) guiButton.removeNode() def enter(self): @@ -47,25 +44,26 @@ class StatPage(ShtikerPage.ShtikerPage): if self.dialog: self.dialog.destroy() self.dialog = None + + def createRow(self, pos): + row = DirectLabel(parent=self, relief=None, text_align=TextNode.ALeft, text='', text_scale=0.045, text_wordwrap=16, text_font=ToontownGlobals.getChalkFont(), text_fg=(1, 1, 1, 1), image='phase_3/maps/stat_board.png', image_scale=(0.42, 0, 0.6), image_pos=(0.35, 0, -0.45)) + row.setPos(pos) + return row def cutToChunks(self, list, size): for i in xrange(0, len(list), size): yield list[i:i+size] def updateStats(self): - dict = {} stats = base.localAvatar.stats - - for i, string in enumerate(STATS): - dict[string] = "{:,}".format(stats[i]) - - textChunks = list(self.cutToChunks(TTLocalizer.Stats, 11)) + allStats = [TTLocalizer.Stats[i] % '{:,}'.format(stats[i]) for i in xrange(len(stats))] + textChunks = list(self.cutToChunks(allStats, self.chunkCount)) for i, chunk in enumerate(textChunks): - self.rows[i]['text'] = '\n\n'.join(chunk) % dict + self.rows[i]['text'] = '\n\n'.join(chunk) def __showDialog(self): - self.dialog = TTDialog.TTDialog(style=TTDialog.TwoChoice, text=TTLocalizer.StatResetAsk, text_wordwrap=15, command=self.__handleDialogResponse) + self.dialog = TTDialog.TTDialog(style=TTDialog.TwoChoice, text=TTLocalizer.StatPageClearAsk, text_wordwrap=15, command=self.__handleDialogResponse) self.dialog.show() def __handleDialogResponse(self, response): @@ -75,5 +73,5 @@ class StatPage(ShtikerPage.ShtikerPage): return base.localAvatar.wipeStats() - self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.StatResetDone, text_wordwrap=15, command=self.unloadDialog) + self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.StatPageClearDone, text_wordwrap=15, command=self.unloadDialog) self.dialog.show() \ No newline at end of file diff --git a/toontown/shtiker/SuitPage.py b/toontown/shtiker/SuitPage.py index dc295cbf..b4606f0f 100755 --- a/toontown/shtiker/SuitPage.py +++ b/toontown/shtiker/SuitPage.py @@ -336,9 +336,12 @@ class SuitPage(ShtikerPage.ShtikerPage): yStart = -0.18 xOffset = 0.199 yOffset = 0.284 - self.rolloverFrame = DirectFrame(parent=self.panelNode, relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=(0.5, 0.5, 0.5, 1), geom_scale=(0.8, 0, 0.77), text_scale=0.06, text_pos=(0, 0.32), text='', text_fg=(1, 1, 1, 1), pos=(0.44, 0, 0)) + gui = loader.loadModel('phase_3.5/models/gui/suit_detail_panel') + gui.find('**/avatar_panel/shadow').setColor(1, 1, 1, 0.5) + self.rolloverFrame = DirectFrame(parent=self.panelNode, relief=None, geom=gui.find('**/avatar_panel'), geom_color=(0.5, 0.5, 0.5, 1), geom_scale=(0.59, 0, 0.21), text_scale=0.06, text_pos=(0, 0.35), text='', text_fg=(1, 1, 1, 1), text_font=ToontownGlobals.getSuitFont(), pos=(0.8, 0, 0)) self.rolloverFrame.setBin('gui-popup', 0) self.rolloverFrame.hide() + gui.removeNode() for dept in xrange(0, len(SuitDNA.suitDepts)): row = [] color = PANEL_COLORS[dept] @@ -419,7 +422,6 @@ class SuitPage(ShtikerPage.ShtikerPage): index = self.panels.index(panel) if not base.localAvatar.hasCogSummons(index): panel.summonButton.hide() - return def addBuildingRadarLabel(self, button): gui = loader.loadModel('phase_3.5/models/gui/suit_detail_panel') @@ -427,7 +429,6 @@ class SuitPage(ShtikerPage.ShtikerPage): buildingRadarLabel = DirectLabel(parent=button, relief=None, pos=(0.225, 0.0, zPos), state=DGG.DISABLED, image=gui.find('**/avatar_panel'), image_hpr=(0, 0, 90), image_scale=(0.05, 1, 0.1), image_pos=(0, 0, 0.015), text=TTLocalizer.SuitPageBuildingRadarP % '0', text_scale=0.05, text_fg=(1, 0, 0, 1), text_font=ToontownGlobals.getSuitFont()) gui.removeNode() button.buildingRadarLabel = buildingRadarLabel - return def resetPanel(self, dept, type): panel = self.panels[dept * SuitDNA.suitsPerDept + type] @@ -602,4 +603,3 @@ class SuitPage(ShtikerPage.ShtikerPage): taskMgr.doMethodLater(RADAR_DELAY * SuitDNA.suitsPerDept, showLabel, 'showBuildingRadarLater', extraArgs=(button,)) else: button.buildingRadarLabel.hide() - return diff --git a/toontown/suit/BossCog.py b/toontown/suit/BossCog.py index 3c96a4f0..e247384a 100755 --- a/toontown/suit/BossCog.py +++ b/toontown/suit/BossCog.py @@ -461,7 +461,8 @@ class BossCog(Avatar.Avatar): self.doAnimate(None, raised=1, happy=1, queueNeutral=1) ival = Sequence() if self.dna.dept == 'm': - ival.append(Parallel(SoundInterval(self.warningSfx, node=self), Wait(5.0))) + ival.append(Func(self.loop, 'Ff_neutral')) + ival.append(Parallel(SoundInterval(self.warningSfx, node=self, volume=2.0), Wait(3.0))) ival.append(Parallel(ActorInterval(self, 'Fb_jump'), Sequence(Func(self.setChatAbsolute, random.choice(TTLocalizer.JumpBossTaunts[self.dna.dept]), CFSpeech | CFTimeout), SoundInterval(self.swishSfx, duration=1.1, node=self), SoundInterval(self.boomSfx, duration=1.9)), Sequence(Wait(1.21), Func(self.announceAreaAttack)))) if self.twoFaced: self.happy = 0 diff --git a/toontown/suit/DistributedBossCogAI.py b/toontown/suit/DistributedBossCogAI.py index 7d82d1f3..c790e670 100755 --- a/toontown/suit/DistributedBossCogAI.py +++ b/toontown/suit/DistributedBossCogAI.py @@ -561,7 +561,7 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI): damage *= self.getDamageMultiplier() self.damageToon(toon, damage) currState = self.getCurrentOrNextState() - if attackCode == ToontownGlobals.BossCogElectricFence and (currState == 'RollToBattleTwo' or currState == 'BattleThree'): + if attackCode == ToontownGlobals.BossCogElectricFence and (currState == 'RollToBattleTwo' or currState == 'BattleThree') and self.attackCode not in (ToontownGlobals.BossCogDizzy, ToontownGlobals.BossCogDizzyNow): if bpy < 0 and abs(bpx / bpy) > 0.5: if bpx < 0: self.b_setAttackCode(ToontownGlobals.BossCogSwatRight) @@ -600,7 +600,6 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI): if self.dept == 'm' and attackCode == ToontownGlobals.BossCogAreaAttack: delayTime += 5.0 self.waitForNextAttack(delayTime) - return def d_setAttackCode(self, attackCode, avId = 0): self.sendUpdate('setAttackCode', [attackCode, avId]) diff --git a/toontown/suit/DistributedCashbotBossAI.py b/toontown/suit/DistributedCashbotBossAI.py index 4dd14e16..77e8535a 100755 --- a/toontown/suit/DistributedCashbotBossAI.py +++ b/toontown/suit/DistributedCashbotBossAI.py @@ -145,7 +145,7 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS def doNextAttack(self, task): if random.random() <= 0.2: self.b_setAttackCode(ToontownGlobals.BossCogAreaAttack) - taskMgr.doMethodLater(9.36, self.__reviveGoons, self.uniqueName('reviveGoons')) + taskMgr.doMethodLater(7.36, self.__reviveGoons, self.uniqueName('reviveGoons')) else: self.__doDirectedAttack() if self.heldObject == None and not self.waitingForHelmet: diff --git a/toontown/suit/DistributedLawbotBoss.py b/toontown/suit/DistributedLawbotBoss.py index 2ee4b9da..279af16b 100755 --- a/toontown/suit/DistributedLawbotBoss.py +++ b/toontown/suit/DistributedLawbotBoss.py @@ -23,10 +23,9 @@ from toontown.building import ElevatorConstants from toontown.building import ElevatorUtils from toontown.coghq import CogDisguiseGlobals from toontown.distributed import DelayDelete -from otp.nametag import NametagGroup from otp.nametag.NametagConstants import * from otp.nametag import NametagGlobals -from toontown.toon import Toon +from toontown.toon import NPCToons from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownGlobals @@ -1567,15 +1566,11 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): return bossTrack def __makeWitnessToon(self): - dnaNetString = 't\x1b\x00\x01\x01\x00\x03\x00\x03\x01\x10\x13\x00\x13\x13' - npc = Toon.Toon() - npc.setDNAString(dnaNetString) - npc.setName(TTLocalizer.WitnessToonName) - npc.setPickable(0) - npc.setPlayerType(NametagGroup.CCNonPlayer) - npc.animFSM.request('Sit') - self.witnessToon = npc + if self.witnessToon: + return + self.witnessToon = NPCToons.createLocalNPC(13002) self.witnessToon.setPosHpr(*ToontownGlobals.LawbotBossWitnessStandPosHpr) + self.witnessToon.animFSM.request('Sit') def __cleanupWitnessToon(self): self.__hideWitnessToon() @@ -1583,7 +1578,6 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM): self.witnessToon.removeActive() self.witnessToon.delete() self.witnessToon = None - return def __showWitnessToon(self): if not self.witnessToonOnstage: diff --git a/toontown/suit/DistributedSellbotBossAI.py b/toontown/suit/DistributedSellbotBossAI.py index 40f42cfa..de4b6abf 100755 --- a/toontown/suit/DistributedSellbotBossAI.py +++ b/toontown/suit/DistributedSellbotBossAI.py @@ -30,7 +30,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS self.bossMaxDamage = ToontownGlobals.SellbotBossMaxDamage self.recoverRate = 0 self.recoverStartTime = 0 - self.punishedToons = [] def delete(self): return DistributedBossCogAI.DistributedBossCogAI.delete(self) @@ -197,13 +196,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS return self.invokeSuitPlanner(10, 1) def removeToon(self, avId): - av = self.air.doId2do.get(avId) - if not av is None: - if av.getHp() <= 0: - if avId not in self.punishedToons: - self.air.cogSuitMgr.removeParts(av, self.deptIndex) - self.punishedToons.append(avId) - toon = simbase.air.doId2do.get(avId) if toon: toon.b_setNumPies(0) diff --git a/toontown/suit/Suit.py b/toontown/suit/Suit.py index 004f8f7b..ca0db861 100755 --- a/toontown/suit/Suit.py +++ b/toontown/suit/Suit.py @@ -235,12 +235,12 @@ def loadDialog(level): SuitDialogFiles = ['COG_VO_grunt', 'COG_VO_murmur', 'COG_VO_statement', - 'COG_VO_question'] + 'COG_VO_question', + 'COG_VO_exclaim'] for file in SuitDialogFiles: SuitDialogArray.append(base.loadSfx(loadPath + file + '.ogg')) SuitDialogArray.append(SuitDialogArray[2]) - SuitDialogArray.append(SuitDialogArray[2]) def loadSkelDialog(): @@ -252,11 +252,12 @@ def loadSkelDialog(): murmur = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_murmur.ogg') statement = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_statement.ogg') question = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_question.ogg') + exclaim = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_exclaim.ogg') SkelSuitDialogArray = [grunt, murmur, statement, question, - statement, + exclaim, statement] diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 3c37d63c..794a85fe 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -592,6 +592,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute def setTutorialAck(self, tutorialAck): self.tutorialAck = tutorialAck + + def getTutorialAck(self): + return self.tutorialAck def setEarnedExperience(self, earnedExp): self.earnedExperience = earnedExp @@ -1255,6 +1258,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute def getTotalMoney(self): return self.getBankMoney() + self.getMoney() + + def takeMoney(self, money): + self.sendUpdate('takeMoney', [money]) def setEmblems(self, emblems): if self.emblems != emblems: diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 2def54f5..2c3f9fef 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -5050,7 +5050,7 @@ def maxCogPage(): target.b_setCogStatus(cogStatus * deptCount) target.b_setCogRadar([1, 1, 1, 1]) target.b_setBuildingRadar([1, 1, 1, 1]) - return 'Maxed %s\'s discovered cogs -- Jumble' % (target.getName()) + return 'Maxed %s\'s discovered cogs!' % (target.getName()) @magicWord(category=CATEGORY_PROGRAMMER) def immortal(): diff --git a/toontown/toon/InventoryNew.py b/toontown/toon/InventoryNew.py index 5e2585a8..2cdf5d26 100755 --- a/toontown/toon/InventoryNew.py +++ b/toontown/toon/InventoryNew.py @@ -7,6 +7,7 @@ from toontown.quest import BlinkingArrows from direct.interval.IntervalGlobal import * from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals +from toontown.toontowngui import TTDialog from otp.otpbase import OTPGlobals class InventoryNew(InventoryBase.InventoryBase, DirectFrame): @@ -159,6 +160,8 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): del self.detailAmountLabel del self.detailDataLabel del self.totalLabel + self.cleanupDialog() + for row in self.trackRows: row.destroy() @@ -172,7 +175,11 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): del self.buttons InventoryBase.InventoryBase.unload(self) DirectFrame.destroy(self) - return + + def cleanupDialog(self): + if self.dialog: + self.dialog.cleanup() + self.dialog = None def load(self): self.notify.debug('Loading Inventory for %d' % self.toon.doId) @@ -200,7 +207,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): trashcanGui = loader.loadModel('phase_3/models/gui/trashcan_gui') trashcanImage = (trashcanGui.find('**/TrashCan_CLSD'), trashcanGui.find('**/TrashCan_OPEN'), trashcanGui.find('**/TrashCan_RLVR')) self.deleteEnterButton = DirectButton(parent=self.invFrame, image=trashcanImage, text=('', TTLocalizer.InventoryDelete, TTLocalizer.InventoryDelete), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.1, text_pos=(0, -0.1), text_font=getInterfaceFont(), textMayChange=0, relief=None, pos=(-1, 0, -0.35), scale=1.0) - self.deleteAllButton = DirectButton(parent=self.invFrame, image=trashcanImage, text=('', TTLocalizer.InventoryDeleteAll, TTLocalizer.InventoryDeleteAll), text_fg=(1, 0, 0, 1), text_shadow=(1, 1, 1, 1), text_scale=0.1, text_pos=(0, -0.1), text_font=getInterfaceFont(), textMayChange=0, relief=None, pos=(-0.3, 0, -0.91), scale=0.75, command=self.__zeroInvAndUpdate) + self.deleteAllButton = DirectButton(parent=self.invFrame, image=trashcanImage, text=('', TTLocalizer.InventoryDeleteAll, TTLocalizer.InventoryDeleteAll), text_fg=(1, 0, 0, 1), text_shadow=(1, 1, 1, 1), text_scale=0.1, text_pos=(0, -0.1), text_font=getInterfaceFont(), textMayChange=0, relief=None, pos=(-0.3, 0, -0.91), scale=0.75, command=self.__zeroInvConfirm) self.deleteExitButton = DirectButton(parent=self.invFrame, image=(trashcanGui.find('**/TrashCan_OPEN'), trashcanGui.find('**/TrashCan_CLSD'), trashcanGui.find('**/TrashCan_RLVR')), text=('', TTLocalizer.InventoryDone, TTLocalizer.InventoryDone), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), text_scale=0.1, text_pos=(0, -0.1), text_font=getInterfaceFont(), textMayChange=0, relief=None, pos=(-1, 0, -0.35), scale=1.0) trashcanGui.removeNode() self.deleteHelpText = DirectLabel(parent=self.invFrame, relief=None, pos=(0.272, 0.3, -0.907), text=TTLocalizer.InventoryDeleteHelp, text_fg=(0, 0, 0, 1), text_scale=0.08, textMayChange=0) @@ -212,6 +219,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): self.detailCreditLabel = DirectLabel(parent=self.detailFrame, text=TTLocalizer.InventorySkillCreditNone, text_fg=(0.05, 0.14, 0.4, 1), scale=0.04, pos=(-0.22, 0, -0.365), text_font=getInterfaceFont(), text_align=TextNode.ALeft, relief=None) self.detailCreditLabel.hide() self.totalLabel = DirectLabel(text='', parent=self.detailFrame, pos=(0, 0, -0.095), scale=0.05, text_fg=(0.05, 0.14, 0.4, 1), text_font=getInterfaceFont(), relief=None) + self.dialog = None self.updateTotalPropsText() self.trackRows = [] self.trackNameLabels = [] @@ -277,9 +285,17 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): def __handleBackToPlayground(self): messenger.send('inventory-back-to-playground') - def __zeroInvAndUpdate(self): - self.zeroInv() - self.updateGUI() + def __zeroInvConfirm(self): + self.cleanupDialog() + self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.InventoryDeleteConfirm, command=self.__zeroInvAndUpdate) + self.dialog.show() + + def __zeroInvAndUpdate(self, value): + self.cleanupDialog() + + if value > 0: + self.zeroInv() + self.updateGUI() def showDetail(self, track, level, event = None): self.totalLabel.hide() @@ -391,6 +407,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): self.enableUberGags() def deactivateButtons(self): + self.cleanupDialog() if self.previousActivateMode == 'purchaseDelete': self.purchaseDeleteDeactivateButtons() elif self.previousActivateMode == 'purchase': @@ -411,6 +428,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame): self.plantTreeDeactivateButtons() def __activateButtons(self): + self.cleanupDialog() if hasattr(self, 'activateMode'): if self.activateMode == 'book': self.bookActivateButtons() diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index 5d8e211d..7e80bb59 100755 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -428,9 +428,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): def isLocal(self): return 1 - def canChat(self): - return 1 - def startChat(self): if self.tutorialAck: self.notify.info('calling LocalAvatar.startchat') @@ -938,8 +935,8 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): self.friendsListButtonObscured += increment self.refreshOnscreenButtons() - def obscureMoveFurnitureButton(self, increment): - self.moveFurnitureButtonObscured += increment + def obscureMoveFurnitureButton(self, obscured): + self.moveFurnitureButtonObscured = obscured self.refreshOnscreenButtons() def obscureClarabelleButton(self, increment): @@ -974,7 +971,10 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): self.__catalogNotifyDialog = None else: self.newCatalogNotify() - if self.moveFurnitureButtonObscured <= 0: + if self.moveFurnitureButtonObscured: + if self.__furnitureGui: + self.__furnitureGui.hide() + else: if self.furnitureManager != None and self.furnitureDirector == self.doId: self.loadFurnitureGui() self.__furnitureGui.setPos(0.155, -0.6, -1.045) diff --git a/toontown/toon/NPCToons.py b/toontown/toon/NPCToons.py index db772e0d..5932afd9 100755 --- a/toontown/toon/NPCToons.py +++ b/toontown/toon/NPCToons.py @@ -864,7 +864,8 @@ NPCToonDict = { 11001: (11000, lnames[11001], 'r', 'm', 0, NPC_LAFF_RESTOCK), 12001: (12000, lnames[12001], 'r', 'm', 0, NPC_LAFF_RESTOCK), 12002: (-1, lnames[12002], ('pls', 'ls', 'l', 'f', 3, 0, 3, 3, 111, 27, 97, 27, 45, 27), 'f', 0, NPC_REGULAR), - 13001: (13000, lnames[13001], 'r', 'f', 0, NPC_LAFF_RESTOCK) + 13001: (13000, lnames[13001], 'r', 'f', 0, NPC_LAFF_RESTOCK), + 13002: (-1, lnames[13002], ('bss', 'ss', 'm', 'm', 19, 0, 19, 19, 0, 3, 0, 3, 1, 16), 'm', 0, NPC_REGULAR) } if config.GetBool('want-new-toonhall', 1): diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index d7a6c496..57d71e14 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -12,7 +12,7 @@ ToonFont = 'phase_3/models/fonts/ImpressBT.ttf' SuitFont = 'phase_3/models/fonts/vtRemingtonPortable.ttf' SignFont = 'phase_3/models/fonts/MickeyFont' MinnieFont = 'phase_3/models/fonts/MinnieFont' -FancyFont = 'phase_3/models/fonts/Comedy' +ChalkFont = 'phase_3/models/fonts/Chawp.ttf' BuildingNametagFont = 'phase_3/models/fonts/MickeyFont' BuildingNametagShadow = None NametagFonts = ( @@ -3978,7 +3978,6 @@ EmoteHappy = 'Happy' EmoteSad = 'Sad' EmoteAnnoyed = 'Annoyed' EmoteSleep = 'Sleepy' -StatPageTitle = 'Statistics' SuitBaseNameWithLevel = '%(name)s\n%(dept)s\nLevel %(level)s' HealthForceAcknowledgeMessage = 'You cannot leave the playground until your Laff meter is smiling!' InventoryTotalGags = 'Total gags\n%d / %d' @@ -3987,7 +3986,6 @@ InventoryPinkSlip = '1 Pink Slip' InventoryCrateKeys = '%s Crate Keys' InventoryCrateKey = '1 Crate Key' InventoryDelete = 'DELETE' -InventoryDeleteAll = 'DELETE ALL' InventoryDone = 'DONE' InventoryDeleteHelp = 'Click on a gag to DELETE it.' InventorySkillCredit = 'Skill credit: %s' @@ -6272,7 +6270,8 @@ NPCToonNames = {20000: 'Tutorial Tom', 11001: 'Healer Gabriel', 12001: 'Healer Bill', 12002: 'Mata Hairy', - 13001: 'Healer Clover'} + 13001: 'Healer Clover', + 13002: 'Bumpy Bumblebehr'} zone2TitleDict = {2513: ('Toon Hall', ''), 2514: ('Toontown Bank', ''), 2516: ('Toontown School House', ''), @@ -7596,7 +7595,6 @@ LawbotBossTaunts = ['%s, I find you in contempt of court!', 'Strike that from the record.', 'Your appeal has been rejected. I sentence you to sadness!', 'Order in the court!'] -WitnessToonName = 'Bumpy Bumblebehr' WitnessToonPrepareBattleTwo = "Oh no! They're putting only Cogs on the jury!\x07Quick, use the cannons and shoot some Toon jurors into the jury chairs.\x07We need %d to get a balanced scale." WitnessToonNoJuror = 'Oh oh, no Toon jurors. This will be a tough trial.' WitnessToonOneJuror = 'Cool! There is 1 Toon in the jury!' @@ -8530,9 +8528,12 @@ def convertSecondsToDate(seconds): return '%d:%02d:%02d' % (h, m, s) ToonDefeatedMessage = '%s was defeated!' + BugReportButton = 'Report a Bug' BugReportNotice = 'Attention!\n\nThis button will open a browser which will send you to a third party bug tracker website. This site requires an Ubuntu One account to login. It may ask you to create an account.\n\nAre you sure you want to continue?' + CodeRedemptionWarning = 'NOTICE: All codes can only be entered once!' + CogInterfaceLabelOn = 'The cog battle interface is on.' CogInterfaceLabelOff = 'The cog battle interface is off.' TpTransitionLabelOn = 'The teleport transition is on.' @@ -8540,6 +8541,7 @@ TpTransitionLabelOff = 'The teleport transition is off.' FieldOfViewLabel = 'Field of View:' NametagStyleLabel = 'Nametag Style:' FishingPoleLabel = 'Fishing Rod:' + BossLocations = { 'c': 'Bossbot Clubhouse\nBanquet', 'l': "Lawbot Courthouse\nBumpy Bumblebehr's Trial", @@ -8656,31 +8658,33 @@ CrateClothingPrize = "Congratulations! You've received a new clothing item. Chec CrateAccessoryPrize = 'Congratulations! You found a new accessory for your Toon. Check your mailbox and rock it!' Stats = [ - 'Cogs defeated: %(cog)s', - 'V2.0 cogs defeated: %(v2)s', - 'Skelecogs defeated: %(skele)s', - 'Jellybeans spent: %(beanSpent)s', - 'Jellybeans earnt: %(beanEarnt)s', - 'Tasks completed: %(task)s', - 'Total VP defeats: %(vp)s', - 'Total CFO defeats: %(cfo)s', - 'Total CJ defeats: %(cj)s', - 'Total CEO defeats: %(ceo)s', - 'Gone sad: %(sad)s times', - 'Buildings liberated: %(bldg)s', - 'Field Offices defeated: %(cogdo)s', - 'Items purchased: %(item)s', - 'Fish caught: %(fish)s', - 'Flowers picked: %(flower)s', - 'Races completed: %(race)s', - 'Golf holes played: %(golf)s', - 'Total SOS cards: %(sos)s', - 'Total unites: %(unite)s', - 'Total pink slips: %(slip)s', - 'Total gags used: %(gag)s' + 'Cogs defeated: %s', + 'V2.0 cogs defeated: %s', + 'Skelecogs defeated: %s', + 'Jellybeans spent: %s', + 'Jellybeans earnt: %s', + 'Tasks completed: %s', + 'Total VP defeats: %s', + 'Total CFO defeats: %s', + 'Total CJ defeats: %s', + 'Total CEO defeats: %s', + 'Gone sad: %s times', + 'Buildings liberated: %s', + 'Offices defeated: %s', + 'Items ordered: %s', + 'Fish caught: %s', + 'Flowers picked: %s', + 'Races completed: %s', + 'Golf holes played: %s', + 'Total SOS cards: %s', + 'Total unites: %s', + 'Total pink slips: %s', + 'Total gags used: %s' ] -StatResetAsk = 'Are you sure you want to reset your stats? This is an irreversible action!' -StatResetDone = 'Your stats have been reset.' +StatPageTitle = 'Statistics' +StatPageClear = 'Clear' +StatPageClearAsk = 'Are you sure you want to clear your stats? This is an irreversible action!' +StatPageClearDone = 'Your stats have been cleared.' ChairAskToUse = 'Would you like to sit on this chair?' @@ -8727,6 +8731,9 @@ ShardPageShardTitle = '%s Population: %s' ShardPageTeleport = 'Teleport to\n%s' TeleportButton = 'Teleport' +TeleportButtonNoMoney = 'Sorry, but you need %s jellybeans to teleport!' +TeleportButtonConfirm = 'Would you like to spend %s jellybeans to teleport?' +TeleportButtonTakenOver = 'Sorry, but this shop has been taken over by the Cogs!' BattleCogPopup = '\x01androidGreen\x01Group attacks:\x02\n%s\n\n\x01androidGreen\x01Regular attacks:\x02\n%s' BattleCogPopupAttack = '%s %s HP' @@ -8749,6 +8756,14 @@ TeleportLabelOn = 'Accepting teleports.' TeleportLabelOff = 'Not accepting teleports.' TeleportPanelNoTeleport = '%s needs some time alone right now.' +InventoryDeleteAll = 'DELETE ALL' +InventoryDeleteConfirm = "Are you sure you want to delete all your gags? Don't worry, your level 7 gags are safe!" + +ClothesGUICount = '%s/%s' + +FpsMeterLabelOn = 'The frame rate meter is on.' +FpsMeterLabelOff = 'The frame rate meter is off.' + Blacklist = [ "$1ut", "$h1t", diff --git a/toontown/toonbase/TTLocalizerEnglishProperty.py b/toontown/toonbase/TTLocalizerEnglishProperty.py index 16038f24..c41398de 100755 --- a/toontown/toonbase/TTLocalizerEnglishProperty.py +++ b/toontown/toonbase/TTLocalizerEnglishProperty.py @@ -298,3 +298,33 @@ SellbotFactoryPosPart1 = (0, -0.25) SellbotFactoryScalePart1 = 0.075 SellbotFactoryPosPart2 = (0, -0.34) SellbotFactoryScalePart2 = 0.12 +BattleHoverCog = 0 +BattleHoverGag = 1 +BattleHoverSos = 2 + +BattleHoverAttributes = { + BattleHoverCog: { + 'geom_scale': (0.4, 0, 0.18), + 'text_pos': (0, 0.29), + 'geom_color': (0.5, 0.5, 0.5, 1), + 'pos': (0.6, 0, 0.05), + 'text_fg': (1, 1, 1, 1), + 'suit': True + }, + BattleHoverGag: { + 'geom_scale': (0.5, 0, 0.2), + 'text_pos': (0, 0.0125), + 'geom_color': (0.6, 1.0, 0.4, 1), + 'pos': (0.4, 0, 0), + 'text_fg': (0, 0, 0, 1), + 'suit': False + }, + BattleHoverSos: { + 'geom_scale': (0.5, 0, 0.3), + 'text_pos': (0, 0.08), + 'geom_color': (0.6, 1.0, 0.4, 1), + 'pos': (0.4, 0, 0.1), + 'text_fg': (0, 0, 0, 1), + 'suit': False + } +} \ No newline at end of file diff --git a/toontown/toonbase/ToontownGlobals.py b/toontown/toonbase/ToontownGlobals.py index 5250a993..baa76345 100755 --- a/toontown/toonbase/ToontownGlobals.py +++ b/toontown/toonbase/ToontownGlobals.py @@ -2,8 +2,6 @@ import TTLocalizer from otp.otpbase.OTPGlobals import * from direct.showbase.PythonUtil import Enum, invertDict from pandac.PandaModules import BitMask32, Vec4 -MapHotkeyOn = 'alt' -MapHotkeyOff = 'alt-up' MapHotkey = 'alt' CogHQCameraFov = 60.0 BossBattleCameraFov = 72.0 @@ -1690,4 +1688,17 @@ TV_OK = 2 COLOR_SATURATION_MIN = 0.5 COLOR_SATURATION_MAX = 0.8 COLOR_VALUE_MIN = 0.5 -COLOR_VALUE_MAX = 0.8 \ No newline at end of file +COLOR_VALUE_MAX = 0.8 + +TELEPORT_BUTTON_DEFAULT_COST = 50 +TELEPORT_BUTTON_COSTS = { + ToontownCentral: 5, + DonaldsDock: 15, + DaisyGardens: 30, + MinniesMelodyland: 45, + TheBrrrgh: 60, + DonaldsDreamland: 75 +} + +def getTeleportButtonCost(hoodId): + return TELEPORT_BUTTON_COSTS.get(hoodId, TELEPORT_BUTTON_DEFAULT_COST) \ No newline at end of file diff --git a/toontown/toonbase/ToontownStart.py b/toontown/toonbase/ToontownStart.py index c4a9249e..d620890f 100644 --- a/toontown/toonbase/ToontownStart.py +++ b/toontown/toonbase/ToontownStart.py @@ -116,6 +116,8 @@ if 'fov' not in settings: settings['fov'] = OTPGlobals.DefaultCameraFov if 'talk2speech' not in settings: settings['talk2speech'] = False +if 'fpsMeter' not in settings: + settings['fpsMeter'] = False loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings['res'])) loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen']) @@ -189,6 +191,7 @@ cr = ToontownClientRepository.ToontownClientRepository(serverVersion) cr.music = music del music base.initNametagGlobals() +base.setFrameRateMeter(settings['fpsMeter']) base.cr = cr loader.endBulkLoad('init') from otp.friends import FriendManager diff --git a/toontown/town/TownBattle.py b/toontown/town/TownBattle.py index 4bcd0870..cba7b4c0 100755 --- a/toontown/town/TownBattle.py +++ b/toontown/town/TownBattle.py @@ -14,9 +14,8 @@ import TownBattleCogPanel from toontown.toontowngui import TTDialog from direct.directnotify import DirectNotifyGlobal from toontown.battle import BattleBase -from toontown.toonbase import ToontownTimer from direct.showbase import PythonUtil -from toontown.toonbase import TTLocalizer +from toontown.toonbase import TTLocalizer, ToontownGlobals, ToontownTimer from toontown.pets import PetConstants from direct.gui.DirectGui import * from toontown.battle import FireCogPanel @@ -43,10 +42,7 @@ class TownBattle(StateData.StateData): self.track = -1 self.level = -1 self.target = 0 - self.toonAttacks = [(-1, 0, 0), - (-1, 0, 0), - (-1, 0, 0), - (-1, 0, 0)] + self.toonAttacks = [(-1, 0, 0)] * 4 self.fsm = ClassicFSM.ClassicFSM('TownBattle', [ State.State('Off', self.enterOff, @@ -125,6 +121,8 @@ class TownBattle(StateData.StateData): self.rolloverFrame = DirectFrame(aspect2d, relief=None, geom=DGG.getDefaultDialogGeom(), geom_color=(0.6, 1.0, 0.4, 1), geom_scale=(0.5, 0.3, 0.2), text_scale=0.05, text_pos=(0, 0.0125), text='', text_fg=(0, 0, 0, 1), pos=(0.4, 0, 0)) self.rolloverFrame.setBin('gui-popup', 0) self.rolloverFrame.hide() + self.suitGui = loader.loadModel('phase_3.5/models/gui/suit_detail_panel') + self.suitGui.find('**/avatar_panel/shadow').setColor(1, 1, 1, 0.5) self.toonPanels = [TownBattleToonPanel.TownBattleToonPanel(self) for i in xrange(4)] self.cogPanels = [TownBattleCogPanel.TownBattleCogPanel(self) for i in xrange(4)] self.timer = ToontownTimer.ToontownTimer() @@ -154,6 +152,8 @@ class TownBattle(StateData.StateData): del self.toonPanels del self.cogPanels self.timer.destroy() + self.suitGui.removeNode() + del self.suitGui del self.timer del self.toons @@ -219,11 +219,22 @@ class TownBattle(StateData.StateData): self.timer.setTime(time) return None - def showRolloverFrame(self, parent, scale, textPos, color, pos, text, extra=None): - self.rolloverFrame['geom_scale'] = scale - self.rolloverFrame['text_pos'] = textPos - self.rolloverFrame['geom_color'] = color - self.rolloverFrame.setPos(pos) + def showRolloverFrame(self, parent, type, text, extra=None): + dict = TTLocalizer.BattleHoverAttributes[type] + + for key, value in dict.iteritems(): + if key == 'pos': + self.rolloverFrame.setPos(value) + elif key == 'suit': + if value: + self.rolloverFrame['text_font'] = ToontownGlobals.getSuitFont() + self.rolloverFrame['geom'] = self.suitGui.find('**/avatar_panel') + else: + self.rolloverFrame['text_font'] = ToontownGlobals.getInterfaceFont() + self.rolloverFrame['geom'] = DGG.getDefaultDialogGeom() + else: + self.rolloverFrame[key] = value + self.rolloverFrame.reparentTo(parent) self.rolloverFrame.show() self.rolloverFrame['text'] = text @@ -314,20 +325,14 @@ class TownBattle(StateData.StateData): def enterOff(self): if self.isLoaded: - for toonPanel in self.toonPanels: - toonPanel.hide() + for panel in self.toonPanels + self.cogPanels: + panel.hide() - for cogPanel in self.cogPanels: - cogPanel.hide() - - self.toonAttacks = [(-1, 0, 0), - (-1, 0, 0), - (-1, 0, 0), - (-1, 0, 0)] + self.toonAttacks = [(-1, 0, 0)] * 4 self.target = 0 + if hasattr(self, 'timer'): self.timer.hide() - return None def exitOff(self): if self.isLoaded: @@ -338,17 +343,14 @@ class TownBattle(StateData.StateData): self.track = -1 self.level = -1 self.target = 0 - return None def enterAttack(self): self.attackPanel.enter() self.accept(self.attackPanelDoneEvent, self.__handleAttackPanelDone) - return None def exitAttack(self): self.ignore(self.attackPanelDoneEvent) self.attackPanel.exit() - return None def __handleAttackPanelDone(self, doneStatus): self.notify.debug('doneStatus: %s' % doneStatus) @@ -441,7 +443,7 @@ class TownBattle(StateData.StateData): self.notify.debug('adjustCogsAndToons() numCogs: %s self.numCogs: %s' % (numCogs, self.numCogs)) self.notify.debug('adjustCogsAndToons() luredIndices: %s self.luredIndices: %s' % (luredIndices, self.luredIndices)) self.notify.debug('adjustCogsAndToons() trappedIndices: %s self.trappedIndices: %s' % (trappedIndices, self.trappedIndices)) - toonIds = map(lambda toon: toon.doId, toons) + toonIds = [toon.doId for toon in toons] self.notify.debug('adjustCogsAndToons() toonIds: %s self.toons: %s' % (toonIds, self.toons)) maxSuitLevel = 0 for cog in cogs: @@ -459,16 +461,17 @@ class TownBattle(StateData.StateData): self.localNum = toons.index(base.localAvatar) currStateName = self.fsm.getCurrentState().getName() + if settings['cogInterface']: + self.__enterCogPanels(self.numCogs) + + for i in xrange(len(cogs)): + self.cogPanels[i].setSuit(cogs[i]) + if resetActivateMode: self.__enterPanels(self.numToons, self.localNum) for i in xrange(len(toons)): self.toonPanels[i].setLaffMeter(toons[i]) - if settings['cogInterface']: - self.__enterCogPanels(self.numCogs) - for i in xrange(len(cogs)): - self.cogPanels[i].setSuit(cogs[i]) - if currStateName == 'ChooseCog': self.chooseCogPanel.adjustCogs(self.numCogs, self.luredIndices, self.trappedIndices, self.track) elif currStateName == 'ChooseToon': @@ -481,12 +484,10 @@ class TownBattle(StateData.StateData): self.cog = 0 self.chooseCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track) self.accept(self.chooseCogPanelDoneEvent, self.__handleChooseCogPanelDone) - return None def exitChooseCog(self): self.ignore(self.chooseCogPanelDoneEvent) self.chooseCogPanel.exit() - return None def __handleChooseCogPanelDone(self, doneStatus): mode = doneStatus['mode'] @@ -534,12 +535,10 @@ class TownBattle(StateData.StateData): self.toon = 0 self.chooseToonPanel.enter(self.numToons, localNum=self.localNum) self.accept(self.chooseToonPanelDoneEvent, self.__handleChooseToonPanelDone) - return None def exitChooseToon(self): self.ignore(self.chooseToonPanelDoneEvent) self.chooseToonPanel.exit() - return None def __handleChooseToonPanelDone(self, doneStatus): mode = doneStatus['mode'] @@ -576,12 +575,10 @@ class TownBattle(StateData.StateData): canHeal, canTrap, canLure = self.checkHealTrapLure() self.FireCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track) self.accept(self.fireCogPanelDoneEvent, self.__handleCogFireDone) - return None def exitFire(self): self.ignore(self.fireCogPanelDoneEvent) self.FireCogPanel.exit() - return None def __handleCogFireDone(self, doneStatus): mode = doneStatus['mode'] @@ -602,12 +599,10 @@ class TownBattle(StateData.StateData): canHeal, canTrap, canLure = self.checkHealTrapLure() self.SOSPanel.enter(canLure, canTrap) self.accept(self.SOSPanelDoneEvent, self.__handleSOSPanelDone) - return None def exitSOS(self): self.ignore(self.SOSPanelDoneEvent) self.SOSPanel.exit() - return None def __handleSOSPanelDone(self, doneStatus): mode = doneStatus['mode'] @@ -641,13 +636,11 @@ class TownBattle(StateData.StateData): self.accept(self.proxyGenerateMessage, self.__handleProxyGenerated) self.accept(self.SOSPetSearchPanelDoneEvent, self.__handleSOSPetSearchPanelDone) messenger.send(self.battleEvent, [response]) - return None def exitSOSPetSearch(self): self.ignore(self.proxyGenerateMessage) self.ignore(self.SOSPetSearchPanelDoneEvent) self.SOSPetSearchPanel.exit() - return None def __handleSOSPetSearchPanelDone(self, doneStatus): mode = doneStatus['mode'] @@ -662,12 +655,10 @@ class TownBattle(StateData.StateData): def enterSOSPetInfo(self): self.SOSPetInfoPanel.enter(self.petId) self.accept(self.SOSPetInfoPanelDoneEvent, self.__handleSOSPetInfoPanelDone) - return None def exitSOSPetInfo(self): self.ignore(self.SOSPetInfoPanelDoneEvent) self.SOSPetInfoPanel.exit() - return None def __handleSOSPetInfoPanelDone(self, doneStatus): mode = doneStatus['mode'] @@ -683,15 +674,10 @@ class TownBattle(StateData.StateData): self.fsm.request('SOS') def __isCogChoiceNecessary(self): - if self.numCogs > 1 and not self.__isGroupAttack(self.track, self.level): - return 1 - else: - return 0 + return self.numCogs > 1 and not self.__isGroupAttack(self.track, self.level) def __isGroupAttack(self, trackNum, levelNum): - retval = BattleBase.attackAffectsGroup(trackNum, levelNum) - return retval + return BattleBase.attackAffectsGroup(trackNum, levelNum) def __isGroupHeal(self, levelNum): - retval = BattleBase.attackAffectsGroup(HEAL_TRACK, levelNum) - return retval + return self.__isGroupAttack(HEAL_TRACK, levelNum) diff --git a/toontown/town/TownBattleCogPanel.py b/toontown/town/TownBattleCogPanel.py index 48c4bffe..8335ac2b 100755 --- a/toontown/town/TownBattleCogPanel.py +++ b/toontown/town/TownBattleCogPanel.py @@ -23,7 +23,6 @@ class TownBattleCogPanel(DirectFrame): gui.removeNode() def cleanup(self): - self.ignoreAll() self.cleanupHead() self.levelText.removeNode() self.typeText.removeNode() @@ -42,17 +41,14 @@ class TownBattleCogPanel(DirectFrame): def setSuit(self, suit): if self.suit == suit: - messenger.send(self.suit.uniqueName('hpChange')) return - self.ignoreAll() self.cleanupHead() self.suit = suit self.generateSuitHead(suit.getStyleName()) self.updateHealthBar() self.levelText['text'] = TTLocalizer.CogPanelLevel % suit.getActualLevel() self.typeText['text'] = suit.getTypeText() - self.accept(suit.uniqueName('hpChange'), self.updateHealthBar) self.updateRolloverBind() def updateRolloverBind(self): @@ -67,7 +63,7 @@ class TownBattleCogPanel(DirectFrame): if TTLocalizer.BattleCogPopupDangerColor in info: info = TTLocalizer.BattleCogPopupDanger + info - self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, (0.73, 0, 0.65), (0, 0.26), (0.5, 0.5, 0.5, 1), (0.6, 0, 0.1), info]) + self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, TTLocalizer.BattleHoverCog, info]) def getAttackStrings(self, attacks, level): attackStrings = [] diff --git a/toontown/town/TownBattleToonPanel.py b/toontown/town/TownBattleToonPanel.py index de6426f4..03c7ba6b 100755 --- a/toontown/town/TownBattleToonPanel.py +++ b/toontown/town/TownBattleToonPanel.py @@ -24,8 +24,6 @@ class TownBattleToonPanel(DirectFrame): self.sosText.hide() self.fireText = DirectLabel(parent=self, relief=None, pos=(0.1, 0, 0.015), text=TTLocalizer.TownBattleToonFire, text_scale=0.06) self.fireText.hide() - self.roundsText = DirectLabel(parent=self, relief=None, pos=(0.16, 0, -0.07), text='', text_scale=0.045) - self.roundsText.hide() self.sosHead = None self.undecidedText = DirectLabel(parent=self, relief=None, pos=(0.1, 0, 0.015), text=TTLocalizer.TownBattleUndecided, text_scale=0.1) self.healthText = DirectLabel(parent=self, text='', pos=(-0.06, 0, -0.075), text_scale=0.055) @@ -41,7 +39,7 @@ class TownBattleToonPanel(DirectFrame): passGui.reparentTo(self.passNode) self.passNode.hide() self.laffMeter = None - self.whichText = DirectLabel(parent=self, text='', pos=(0.1, 0, -0.08), text_scale=0.05) + self.whichText = DirectLabel(parent=self, relief=None, text='', pos=(0.1, 0, -0.08), text_scale=0.05) self.hoverButton = DirectButton(parent=self, relief=None, image_scale=(0.07, 0, 0.06), pos=(0.105, 0, 0.05), image='phase_3/maps/invisible.png', pressEffect=0) self.hoverButton.setTransparency(True) self.hoverButton.bind(DGG.EXIT, self.battle.hideRolloverFrame) @@ -102,14 +100,11 @@ class TownBattleToonPanel(DirectFrame): self.undecidedText.hide() self.sosText.hide() self.fireText.hide() - self.roundsText.hide() self.gagNode.hide() self.whichText.hide() self.passNode.hide() self.cleanupSosHead() self.hoverButton.unbind(DGG.ENTER) - self.whichText.setPos(0.1, 0, -0.08) - self.whichText['text_scale'] = 0.05 if self.hasGag: self.gag.removeNode() self.hasGag = 0 @@ -141,7 +136,7 @@ class TownBattleToonPanel(DirectFrame): sosType = TextEncoder.upper(sosType) count = max(0, self.avatar.getNPCFriendCount(targetIndex) - 1) info = TTLocalizer.BattleSOSPopup % (sosType, NPCToons.getNPCName(targetIndex), hpString if hp else '', rarity, count) - self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, (0.5, 0.3, 0.3), (0, 0.08), (0.6, 1.0, 0.4, 1), (0.4, 0, 0.1), info]) + self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, TTLocalizer.BattleHoverSos, info]) elif track == BattleBase.SOS or track == BattleBase.PETSOS: self.sosText.show() elif track >= MIN_TRACK_INDEX and track <= MAX_TRACK_INDEX: @@ -159,24 +154,13 @@ class TownBattleToonPanel(DirectFrame): damage = int(getAvPropDamage(track, level, curExp, organic)) numItems = max(0, self.avatar.inventory.numItem(track, level) - 1) info = TTLocalizer.BattleGagPopup % (self.avatar.inventory.getToonupDmgStr(track, 0), damage, numItems) - self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, (0.5, 0.3, 0.2), (0, 0.0125), (0.6, 1.0, 0.4, 1), (0.4, 0, 0), info]) + self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, TTLocalizer.BattleHoverGag, info]) if self.avatar.checkGagBonus(track, level): self.gag.setColor((1, 0, 0, 1) if track == 1 and level == 5 else (0, 1, 0, 1)) if numTargets is not None and targetIndex is not None and localNum is not None: self.whichText.show() self.whichText['text'] = self.determineWhichText(numTargets, targetIndex, localNum, index) - self.roundsText.setPos(0.16, 0, -0.07) - self.roundsText['text_scale'] = 0.045 - elif track == LURE_TRACK: - self.roundsText['text_scale'] = 0.05 - self.roundsText.setPos(0.1, 0, -0.08) - if track == LURE_TRACK: - self.roundsText.show() - self.roundsText['text'] = str(NumRoundsLured[level]) - self.whichText.setPos(0.085, 0, -0.07) - self.whichText['text_scale'] = 0.045 - else: self.notify.error('Bad track value: %s' % track) @@ -184,6 +168,7 @@ class TownBattleToonPanel(DirectFrame): returnStr = '' targetList = range(numTargets) targetList.reverse() + for i in targetList: if targetIndex == -1: returnStr += 'X' @@ -221,9 +206,8 @@ class TownBattleToonPanel(DirectFrame): self.sosHead = None def cleanupLaffMeter(self): - self.notify.debug('Cleaning up laffmeter!') self.ignore(self.hpChangeEvent) + if self.laffMeter: self.laffMeter.destroy() self.laffMeter = None - return diff --git a/toontown/town/TutorialStreet.py b/toontown/town/TutorialStreet.py index 1385f1db..8d8af0e3 100755 --- a/toontown/town/TutorialStreet.py +++ b/toontown/town/TutorialStreet.py @@ -19,4 +19,4 @@ class TutorialStreet(TTStreet.TTStreet): TTStreet.TTStreet.handleEnterTunnel(self, requestStatus, collEntry) def exitDoorIn(self): - base.localAvatar.obscureMoveFurnitureButton(-1) + base.localAvatar.obscureMoveFurnitureButton(0)