Merge branch 'feature/dan' into 'feature/deployment'

Feature/dan

See merge request !7
This commit is contained in:
Billy Bob 2015-08-29 16:25:51 -04:00
commit e157c01f30
63 changed files with 418 additions and 387 deletions

Binary file not shown.

View file

@ -51,7 +51,7 @@ roles:
max: 399999999 max: 399999999
backend: backend:
type: yaml type: yaml
foldername: ../databases/astrondb directory: ../databases/astrondb
- type: dbss - type: dbss
database: 4003 database: 4003

View file

@ -133,7 +133,7 @@ dclass DistributedAvatar : DistributedSmoothNode {
friendsNotify(DoId avId, int8 status) ownrecv airecv; friendsNotify(DoId avId, int8 status) ownrecv airecv;
checkAvOnShard(DoId) clsend airecv; checkAvOnShard(DoId) clsend airecv;
confirmAvOnShard(DoId avId, int8 isOnShard); 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; 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; setTrackAccess(uint16[] = [0,0,0,0,1,1,0]) required broadcast ownrecv db;
setTrackProgress(int8 = -1, uint32 = 0) required ownrecv db; setTrackProgress(int8 = -1, uint32 = 0) required ownrecv db;
setTrackBonusLevel(int8[] = [-1,-1,-1,-1,-1,-1,-1]) required broadcast 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; 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 ownrecv db; setNPCFriendsDict(FriendEntry[] = []) required broadcast ownrecv db;
setDefaultShard(uint32 = 0) required ownrecv broadcast db; setDefaultShard(uint32 = 0) required ownrecv broadcast db;
setDefaultZone(uint32 = 0) required ownrecv broadcast db; setDefaultZone(uint32 = 0) required ownrecv broadcast db;
setHoodsVisited(uint32[] = [ 2000 ]) required ownrecv db; setHoodsVisited(uint32[] = [ 2000 ]) required ownrecv db;
@ -755,6 +755,7 @@ dclass DistributedToon : DistributedPlayer {
requestNametagStyle(uint8) airecv ownsend; requestNametagStyle(uint8) airecv ownsend;
requestFishingRod(uint8) airecv ownsend; requestFishingRod(uint8) airecv ownsend;
wipeStats() airecv ownsend; wipeStats() airecv ownsend;
takeMoney(int16) airecv ownsend;
}; };
dclass DistributedPartyGate : DistributedObject { dclass DistributedPartyGate : DistributedObject {
@ -2048,7 +2049,6 @@ dclass DistributedCloset : DistributedFurnitureItem {
setDNA(blob, int8, uint8) airecv clsend; setDNA(blob, int8, uint8) airecv clsend;
setState(uint8, uint32, uint32, string, uint8[], uint8[]) broadcast ram; setState(uint8, uint32, uint32, string, uint8[], uint8[]) broadcast ram;
setMovie(uint8, uint32, int16) broadcast ram; setMovie(uint8, uint32, int16) broadcast ram;
resetItemLists() broadcast ram;
setCustomerDNA(uint32, blob) broadcast ram; setCustomerDNA(uint32, blob) broadcast ram;
}; };

View file

@ -1125,9 +1125,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
def d_setParent(self, parentToken): def d_setParent(self, parentToken):
DistributedSmoothNode.DistributedSmoothNode.d_setParent(self, parentToken) DistributedSmoothNode.DistributedSmoothNode.d_setParent(self, parentToken)
def canChat(self):
return 0
@magicWord(category=CATEGORY_COMMUNITY_MANAGER) @magicWord(category=CATEGORY_COMMUNITY_MANAGER)
def run(): def run():

View file

@ -41,12 +41,7 @@ class ChatAgentUD(DistributedObjectGlobalUD):
return return
self.air.writeServerEvent('chat-said', sender, message) self.air.writeServerEvent('chat-said', sender, message)
self.air.send(self.air.dclassesByName['DistributedAvatarUD'].aiFormatUpdate('setTalk', sender, sender, self.air.ourChannel, [message]))
DistributedAvatar = self.air.dclassesByName['DistributedAvatarUD']
dg = DistributedAvatar.aiFormatUpdate('setTalk', sender, sender,
self.air.ourChannel,
[message])
self.air.send(dg)
def detectBadWords(self, sender, message): def detectBadWords(self, sender, message):
words = message.split() words = message.split()

View file

@ -123,7 +123,7 @@ class ChatManager(DirectObject.DirectObject):
def enterMainMenu(self): def enterMainMenu(self):
self.checkObscurred() self.checkObscurred()
if self.localAvatar.canChat(): if base.cr.wantTypedChat():
if self.wantBackgroundFocus: if self.wantBackgroundFocus:
self.chatInputNormal.chatEntry['backgroundFocus'] = 1 self.chatInputNormal.chatEntry['backgroundFocus'] = 1
self.acceptOnce('enterNormalChat', self.fsm.request, ['normalChat']) self.acceptOnce('enterNormalChat', self.fsm.request, ['normalChat'])

View file

@ -76,8 +76,8 @@ InterfaceFont = None
InterfaceFontPath = None InterfaceFontPath = None
SignFont = None SignFont = None
SignFontPath = None SignFontPath = None
FancyFont = None ChalkFont = None
FancyFontPath = None ChalkFontPath = None
NametagFonts = {} NametagFonts = {}
NametagFontPaths = {} NametagFontPaths = {}
DialogClass = None DialogClass = None
@ -115,20 +115,20 @@ def setSignFont(path):
global SignFontPath global SignFontPath
SignFontPath = path SignFontPath = path
def getFancyFont(): def getChalkFont():
global FancyFontPath global ChalkFontPath
global FancyFont global ChalkFont
if FancyFont == None: if ChalkFont == None:
if FancyFontPath == None: if ChalkFontPath == None:
InterfaceFont = TextNode.getDefaultFont() InterfaceFont = TextNode.getDefaultFont()
FancyFont = TextNode.getDefaultFont() ChalkFont = TextNode.getDefaultFont()
else: else:
FancyFont = loader.loadFont(FancyFontPath, lineHeight=1.0) ChalkFont = loader.loadFont(ChalkFontPath, lineHeight=1.0)
return FancyFont return ChalkFont
def setFancyFont(path): def setChalkFont(path):
global FancyFontPath global ChalkFontPath
FancyFontPath = path ChalkFontPath = path
def getNametagFont(index): def getNametagFont(index):
global NametagFontPaths global NametagFontPaths

@ -1 +1 @@
Subproject commit 385716865935081c00f8ebbc53ab2875aef4ef19 Subproject commit 4e2986832f047ae4e8f6256d187a6d111a526f5d

View file

@ -28,8 +28,10 @@ Holidays = {
'endMessage': TTLocalizer.SillySaturdayEnd 'endMessage': TTLocalizer.SillySaturdayEnd
}, },
ToontownGlobals.BLACK_CAT_DAY: { ToontownGlobals.BLACK_CAT_DAY: {
'startDay': 13, 'startMonth': 10,
'endDay': 13, 'startDay': 31,
'endMonth': 10,
'endDay': 31,
'startMessage': TTLocalizer.BlackCatHolidayStart, 'startMessage': TTLocalizer.BlackCatHolidayStart,
'ongoingMessage': TTLocalizer.BlackCatHolidayStart, 'ongoingMessage': TTLocalizer.BlackCatHolidayStart,
'endMessage': TTLocalizer.BlackCatHolidayEnd 'endMessage': TTLocalizer.BlackCatHolidayEnd

View file

@ -52,6 +52,7 @@ from toontown.tutorial.TutorialManagerAI import TutorialManagerAI
from toontown.uberdog.DistributedPartyManagerAI import DistributedPartyManagerAI from toontown.uberdog.DistributedPartyManagerAI import DistributedPartyManagerAI
from toontown.uberdog.TopToonsManagerAI import TopToonsManagerAI from toontown.uberdog.TopToonsManagerAI import TopToonsManagerAI
#from toontown.uberdog.DistributedLobbyManagerAI import DistributedLobbyManagerAI #from toontown.uberdog.DistributedLobbyManagerAI import DistributedLobbyManagerAI
import threading
class ToontownAIRepository(ToontownInternalRepository): class ToontownAIRepository(ToontownInternalRepository):
def __init__(self, baseChannel, stateServerChannel, districtName): def __init__(self, baseChannel, stateServerChannel, districtName):
@ -180,6 +181,9 @@ class ToontownAIRepository(ToontownInternalRepository):
def handleConnected(self): def handleConnected(self):
ToontownInternalRepository.handleConnected(self) ToontownInternalRepository.handleConnected(self)
threading.Thread(target=self.startDistrict).start()
def startDistrict(self):
self.districtId = self.allocateChannel() self.districtId = self.allocateChannel()
self.notify.info('Creating ToontownDistrictAI(%d)...' % self.districtId) self.notify.info('Creating ToontownDistrictAI(%d)...' % self.districtId)
self.distributedDistrict = ToontownDistrictAI(self) self.distributedDistrict = ToontownDistrictAI(self)

View file

@ -229,8 +229,8 @@ class BattleBase:
posA] posA]
suitSpeed = 4.8 suitSpeed = 4.8
toonSpeed = 8.0 toonSpeed = 8.0
maxTimeToon = 10.0 maxTimeToon = 3.0
maxTimeSuit = 11.0 maxTimeSuit = 4.0
def __init__(self): def __init__(self):
self.pos = Point3(0, 0, 0) self.pos = Point3(0, 0, 0)

View file

@ -993,6 +993,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.notify.warning('requestAttack() - no toon: %d' % toonId) self.notify.warning('requestAttack() - no toon: %d' % toonId)
return return
validResponse = 1 validResponse = 1
self.npcAttacks = {k:v for k, v in self.npcAttacks.iteritems() if v != toonId}
if track == SOS: if track == SOS:
self.notify.debug('toon: %d calls for help' % toonId) self.notify.debug('toon: %d calls for help' % toonId)
self.air.writeServerEvent('friendSOS', toonId, '%s' % av) self.air.writeServerEvent('friendSOS', toonId, '%s' % av)
@ -1007,7 +1008,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
npcCollision = 0 npcCollision = 0
if av in self.npcAttacks: if av in self.npcAttacks:
callingToon = self.npcAttacks[av] 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) self.toonAttacks[toonId] = getToonAttack(toonId, track=PASS)
npcCollision = 1 npcCollision = 1
if npcCollision == 0: if npcCollision == 0:

View file

@ -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(): if hasattr(suit, 'battleTrapProp') and suit.battleTrapProp and suit.battleTrapProp.getName() == 'traintrack' and not suit.battleTrapProp.isHidden():
suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs)) suitTrack.append(createTrainTrackAppearTrack(suit, toon, battle, npcs))
deathSuit = suit.getLoseActor() deathSuit = suit.getLoseActor()
suitTrack.append(Func(notify.debug, 'before insertDeathSuit'))
suitTrack.append(Func(insertReviveSuit, suit, deathSuit, battle, suitPos, suitHpr)) 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(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(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.48, duration=0.1))
suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.58)) suitTrack.append(ActorInterval(suit, 'slip-forward', startTime=2.58))
suitTrack.append(Func(suit.loop, 'neutral')) 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') 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)) 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)) 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))

View file

@ -465,7 +465,6 @@ class DistributedElevator(DistributedObject.DistributedObject):
del self.elevatorFSM del self.elevatorFSM
elevator.signalDone(doneStatus) elevator.signalDone(doneStatus)
base.camLens.setMinFov(ToontownGlobals.CBElevatorFov/(4./3.)) base.camLens.setMinFov(ToontownGlobals.CBElevatorFov/(4./3.))
return
def getElevatorModel(self): def getElevatorModel(self):
self.notify.error('getElevatorModel: pure virtual -- inheritors must override') self.notify.error('getElevatorModel: pure virtual -- inheritors must override')
@ -530,10 +529,7 @@ class DistributedElevator(DistributedObject.DistributedObject):
return self.offsetNP.getPos(render) return self.offsetNP.getPos(render)
def canHideBoardingQuitBtn(self, avId): def canHideBoardingQuitBtn(self, avId):
if avId == localAvatar.doId and hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.groupPanel: return avId == localAvatar.doId and hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.groupPanel
return True
else:
return False
def getBoardingTrack(self, toon, seatIndex, wantToonRotation): def getBoardingTrack(self, toon, seatIndex, wantToonRotation):
self.boardingGroupShow = BoardingGroupShow.BoardingGroupShow(toon) self.boardingGroupShow = BoardingGroupShow.BoardingGroupShow(toon)

View file

@ -53,11 +53,7 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
def avatarExit(self, avatarId): def avatarExit(self, avatarId):
if avatarId == self.avatarId: if avatarId == self.avatarId:
for track in self.avatarTracks: self.stopTracks()
track.finish()
DelayDelete.cleanupDelayDeletes(track)
self.avatarTracks = []
def knockKnockTrack(self, avatar, duration): def knockKnockTrack(self, avatar, duration):
if avatar is None: if avatar is None:
@ -96,7 +92,7 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
return track return track
def cleanupTrack(self): def cleanupTrack(self):
avatar = self.cr.doId2do.get(self.avatarId, None) avatar = self.cr.doId2do.get(self.avatarId)
if avatar: if avatar:
avatar.clearChat() avatar.clearChat()
if self.nametag: if self.nametag:
@ -105,7 +101,6 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
self.nametag.destroy() self.nametag.destroy()
self.nametag = None self.nametag = None
self.nametagNP = None self.nametagNP = None
return
def enterOff(self): def enterOff(self):
DistributedAnimatedProp.DistributedAnimatedProp.enterOff(self) DistributedAnimatedProp.DistributedAnimatedProp.enterOff(self)
@ -132,9 +127,13 @@ class DistributedKnockKnockDoor(DistributedAnimatedProp.DistributedAnimatedProp)
def exitPlaying(self): def exitPlaying(self):
DistributedAnimatedProp.DistributedAnimatedProp.exitPlaying(self) DistributedAnimatedProp.DistributedAnimatedProp.exitPlaying(self)
self.stopTracks()
def stopTracks(self):
for track in self.avatarTracks: for track in self.avatarTracks:
track.finish() track.pause()
DelayDelete.cleanupDelayDeletes(track) DelayDelete.cleanupDelayDeletes(track)
self.cleanupTrack()
self.avatarTracks = [] self.avatarTracks = []
self.avatarId = 0 self.avatarId = 0

View file

@ -365,6 +365,7 @@ class DistributedSuitInterior(DistributedObject.DistributedObject):
def enterResting(self, ts = 0): def enterResting(self, ts = 0):
base.playMusic(self.waitMusic, looping=1, volume=0.7) base.playMusic(self.waitMusic, looping=1, volume=0.7)
base.localAvatar.questMap.stop()
self.__closeInElevator() self.__closeInElevator()
def exitResting(self): def exitResting(self):

View file

@ -176,12 +176,13 @@ class ToonInterior(Place.Place):
def enterTeleportIn(self, requestStatus): def enterTeleportIn(self, requestStatus):
modelType = DistributedToonInterior.DistributedToonInterior(base.cr).getModelType(self.getZoneId()) 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) base.localAvatar.setPosHpr(-5.5, -1.5, ToontownGlobals.FloorOffset, 0.0, 0.0, 0.0)
elif ZoneUtil.isPetshop(self.zoneId): elif ZoneUtil.isPetshop(self.zoneId):
base.localAvatar.setPosHpr(0, 0, ToontownGlobals.FloorOffset, 45.0, 0.0, 0.0) base.localAvatar.setPosHpr(0, 0, ToontownGlobals.FloorOffset, 45.0, 0.0, 0.0)
else: elif modelType in InteriorTypes:
if modelType in InteriorTypes:
area = InteriorTypes[modelType] area = InteriorTypes[modelType]
base.localAvatar.setPosHpr(area[0], area[1], ToontownGlobals.FloorOffset, area[2], 0.0, 0.0) base.localAvatar.setPosHpr(area[0], area[1], ToontownGlobals.FloorOffset, area[2], 0.0, 0.0)
else: else:

View file

@ -130,15 +130,9 @@ class ToontownChatManager(ChatManager.ChatManager):
if avatarId: if avatarId:
self.enterWhisperChat(avatarName, avatarId) self.enterWhisperChat(avatarName, avatarId)
self.whisperFrame.hide() self.whisperFrame.hide()
return
def enterNormalChat(self): def enterNormalChat(self):
if not base.cr.wantTypedChat(): if not base.cr.wantTypedChat() or not base.localAvatar.getTutorialAck() or not ChatManager.ChatManager.enterNormalChat(self):
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')
self.fsm.request('mainMenu') self.fsm.request('mainMenu')
def enterWhisperChat(self, avatarName, avatarId): def enterWhisperChat(self, avatarName, avatarId):

View file

@ -23,7 +23,6 @@ class CogdoBarrelRoom:
self.fog = None self.fog = None
self.defaultFar = None self.defaultFar = None
self.stomperSfx = None self.stomperSfx = None
return
def destroy(self): def destroy(self):
self.unload() self.unload()
@ -71,7 +70,6 @@ class CogdoBarrelRoom:
taskMgr.remove(self.rewardUiTaskName) taskMgr.remove(self.rewardUiTaskName)
taskMgr.remove(self.rewardCameraTaskName) taskMgr.remove(self.rewardCameraTaskName)
self._isLoaded = False self._isLoaded = False
return
def isLoaded(self): def isLoaded(self):
return self._isLoaded return self._isLoaded

View file

@ -113,7 +113,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self._movie = None self._movie = None
self.SOSToonName = None self.SOSToonName = None
self.FOType = None self.FOType = None
return
def setShopOwnerNpcId(self, npcId): def setShopOwnerNpcId(self, npcId):
self.shopOwnerNpcId = npcId self.shopOwnerNpcId = npcId
@ -202,13 +201,11 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.shopOwnerNpc.removeActive() self.shopOwnerNpc.removeActive()
self.shopOwnerNpc.delete() self.shopOwnerNpc.delete()
self.shopOwnerNpc = None self.shopOwnerNpc = None
return
def __cleanupPenthouseIntro(self): def __cleanupPenthouseIntro(self):
if hasattr(self, '_movie') and self._movie: if hasattr(self, '_movie') and self._movie:
self._movie.unload() self._movie.unload()
self._movie = None self._movie = None
return
def delete(self): def delete(self):
self._stashEntranceElevatorFC.destroy() self._stashEntranceElevatorFC.destroy()
@ -223,13 +220,9 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
del self.fsm del self.fsm
base.localAvatar.inventory.setBattleCreditMultiplier(1) base.localAvatar.inventory.setBattleCreditMultiplier(1)
DistributedObject.DistributedObject.delete(self) DistributedObject.DistributedObject.delete(self)
return
def isBossFloor(self, floorNum): def isBossFloor(self, floorNum):
if not self.layout.hasBossBattle(): return self.layout.hasBossBattle() and (self.layout.getBossBattleFloor() + 0) == floorNum
return False
return (self.layout.getBossBattleFloor() + 0) == floorNum
def __cleanup(self): def __cleanup(self):
self.toons = [] self.toons = []
@ -251,7 +244,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.rightDoorIn = None self.rightDoorIn = None
self.leftDoorOut = None self.leftDoorOut = None
self.rightDoorOut = None self.rightDoorOut = None
return
def __addToon(self, toon): def __addToon(self, toon):
self.accept(toon.uniqueName('disable'), self.__handleUnexpectedExit, extraArgs=[toon]) self.accept(toon.uniqueName('disable'), self.__handleUnexpectedExit, extraArgs=[toon])
@ -404,7 +396,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
def enterWaitForAllToonsInside(self, ts = 0): def enterWaitForAllToonsInside(self, ts = 0):
base.transitions.fadeOut(0) base.transitions.fadeOut(0)
return None
def exitWaitForAllToonsInside(self): def exitWaitForAllToonsInside(self):
return None return None
@ -568,7 +559,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self._movie.end() self._movie.end()
self.__cleanupPenthouseIntro() self.__cleanupPenthouseIntro()
self.__finishInterval(self.elevatorName) self.__finishInterval(self.elevatorName)
return None
def __setupBarrelRoom(self): def __setupBarrelRoom(self):
self.currentFloor += 1 self.currentFloor += 1
@ -607,7 +597,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.barrelRoomIntroTrack.finish() self.barrelRoomIntroTrack.finish()
DelayDelete.cleanupDelayDeletes(self.barrelRoomIntroTrack) DelayDelete.cleanupDelayDeletes(self.barrelRoomIntroTrack)
self.barrelRoomIntroTrack = None self.barrelRoomIntroTrack = None
return
def __handleLocalToonLeftBarrelRoom(self): def __handleLocalToonLeftBarrelRoom(self):
self.notify.info('Local toon teleported out of barrel room.') self.notify.info('Local toon teleported out of barrel room.')
@ -620,6 +609,7 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.acceptOnce('localToonLeft', self.__handleLocalToonLeftBarrelRoom) self.acceptOnce('localToonLeft', self.__handleLocalToonLeftBarrelRoom)
self.barrelRoom.activate() self.barrelRoom.activate()
base.playMusic(self.waitMusic, looping=1, volume=0.7) base.playMusic(self.waitMusic, looping=1, volume=0.7)
base.localAvatar.questMap.stop()
def exitCollectBarrels(self): def exitCollectBarrels(self):
if self._wantBarrelRoom and not self.isBossFloor(self.currentFloor): if self._wantBarrelRoom and not self.isBossFloor(self.currentFloor):
@ -675,13 +665,11 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.__playCloseElevatorOut(self.uniqueName('close-out-elevator')) self.__playCloseElevatorOut(self.uniqueName('close-out-elevator'))
camera.setPos(0, -15, 6) camera.setPos(0, -15, 6)
camera.headsUp(self.elevatorModelOut) camera.headsUp(self.elevatorModelOut)
return None
def exitBattle(self): def exitBattle(self):
if self.elevatorOutOpen == 1: if self.elevatorOutOpen == 1:
self.__finishInterval(self.uniqueName('close-out-elevator')) self.__finishInterval(self.uniqueName('close-out-elevator'))
self.elevatorOutOpen = 0 self.elevatorOutOpen = 0
return None
def __playReservesJoining(self, ts, name, callback): def __playReservesJoining(self, ts, name, callback):
index = 0 index = 0
@ -698,7 +686,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
def enterReservesJoining(self, ts = 0): def enterReservesJoining(self, ts = 0):
self.__playReservesJoining(ts, self.uniqueName('reserves-joining'), self.__handleReserveJoinDone) self.__playReservesJoining(ts, self.uniqueName('reserves-joining'), self.__handleReserveJoinDone)
return None
def __handleReserveJoinDone(self): def __handleReserveJoinDone(self):
self.joiningReserves = [] self.joiningReserves = []
@ -707,7 +694,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
def exitReservesJoining(self): def exitReservesJoining(self):
self.__finishInterval(self.uniqueName('reserves-joining')) self.__finishInterval(self.uniqueName('reserves-joining'))
return None
def enterResting(self, ts = 0): def enterResting(self, ts = 0):
self._showExitElevator() self._showExitElevator()
@ -734,7 +720,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.penthouseOutroTrack.start(ts) self.penthouseOutroTrack.start(ts)
else: else:
self.exitCogdoBuilding() self.exitCogdoBuilding()
return None
def exitReward(self): def exitReward(self):
self.notify.debug('exitReward') self.notify.debug('exitReward')
@ -747,16 +732,13 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
self.__outroPenthouseChatDone() self.__outroPenthouseChatDone()
self.penthouseOutroChatDoneTrack.finish() self.penthouseOutroChatDoneTrack.finish()
self.penthouseOutroChatDoneTrack = None self.penthouseOutroChatDoneTrack = None
return
def enterFailed(self, ts = 0): def enterFailed(self, ts = 0):
self.exitCogdoBuilding() self.exitCogdoBuilding()
return None
def exitFailed(self): def exitFailed(self):
self.notify.debug('exitFailed()') self.notify.debug('exitFailed()')
self.exitCogdoBuilding() self.exitCogdoBuilding()
return None
def exitCogdoBuilding(self): def exitCogdoBuilding(self):
if base.localAvatar.hp < 0: if base.localAvatar.hp < 0:
@ -771,7 +753,6 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
'avId': -1, 'avId': -1,
'bldgDoId': self.distBldgDoId} 'bldgDoId': self.distBldgDoId}
messenger.send('DSIDoneEvent', [request]) messenger.send('DSIDoneEvent', [request])
return
def displayBadges(self): def displayBadges(self):
numFloors = self.layout.getNumGameFloors() numFloors = self.layout.getNumGameFloors()
@ -796,9 +777,8 @@ class DistributedCogdoInterior(DistributedObject.DistributedObject):
track = Parallel(name=trackName) track = Parallel(name=trackName)
base.cr.playGame.getPlace().fsm.request('stopped') base.cr.playGame.getPlace().fsm.request('stopped')
if self.FOType == "l": if self.FOType == 'l':
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot speech = TTLocalizer.CogdoExecutiveSuiteToonThankYouLawbot
else: else:
speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName speech = TTLocalizer.CogdoExecutiveSuiteToonThankYou % self.SOSToonName

View file

@ -99,7 +99,7 @@ class CogHQExterior(BattlePlace.BattlePlace):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def enterTunnelOut(self, requestStatus): def enterTunnelOut(self, requestStatus):
fromZoneId = self.zoneId - self.zoneId % 100 fromZoneId = self.zoneId - self.zoneId % 100

View file

@ -63,7 +63,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self._playerAvDclass = self.dclassesByName['DistributedToon'] self._playerAvDclass = self.dclassesByName['DistributedToon']
setInterfaceFont(TTLocalizer.InterfaceFont) setInterfaceFont(TTLocalizer.InterfaceFont)
setSignFont(TTLocalizer.SignFont) setSignFont(TTLocalizer.SignFont)
setFancyFont(TTLocalizer.FancyFont) setChalkFont(TTLocalizer.ChalkFont)
for i in xrange(len(TTLocalizer.NametagFonts)): for i in xrange(len(TTLocalizer.NametagFonts)):
setNametagFont(i, TTLocalizer.NametagFonts[i]) setNametagFont(i, TTLocalizer.NametagFonts[i])

View file

@ -11,7 +11,7 @@ from toontown.toonbase import TTLocalizer
class ClosetGUI(ClothesGUI.ClothesGUI): class ClosetGUI(ClothesGUI.ClothesGUI):
notify = directNotify.newCategory('ClosetGUI') 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) ClothesGUI.ClothesGUI.__init__(self, ClothesGUI.CLOTHES_CLOSET, doneEvent, swapEvent)
self.toon = None self.toon = None
self.topsList = topList self.topsList = topList
@ -20,29 +20,31 @@ class ClosetGUI(ClothesGUI.ClothesGUI):
self.deleteEvent = deleteEvent self.deleteEvent = deleteEvent
self.cancelEvent = cancelEvent self.cancelEvent = cancelEvent
self.genderChange = 0 self.genderChange = 0
self.maxClothes = maxClothes
self.verify = None self.verify = None
return
def load(self): def load(self):
ClothesGUI.ClothesGUI.load(self) ClothesGUI.ClothesGUI.load(self)
self.gui = loader.loadModel('phase_3/models/gui/create_a_toon_gui') 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 = 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.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: 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')) 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.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.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.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)) 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() trashcanGui.removeNode()
return
def unload(self): def unload(self):
self.ignore('verifyDone') self.ignore('verifyDone')
ClothesGUI.ClothesGUI.unload(self) ClothesGUI.ClothesGUI.unload(self)
self.cancelButton.destroy() self.cancelButton.destroy()
del self.cancelButton del self.cancelButton
self.countFrame.destroy()
del self.countFrame
if self.isOwner: if self.isOwner:
self.topTrashButton.destroy() self.topTrashButton.destroy()
self.bottomTrashButton.destroy() self.bottomTrashButton.destroy()
@ -108,7 +110,10 @@ class ClosetGUI(ClothesGUI.ClothesGUI):
if self.isOwner: if self.isOwner:
self.updateTrashButtons() self.updateTrashButtons()
self.setupButtons() self.setupButtons()
return self.updateCount()
def updateCount(self, clothes, maxClothes):
self.countFrame['text'] = TTLocalizer.ClothesGUICount % (clothes, maxClothes)
def updateTrashButtons(self): def updateTrashButtons(self):
if len(self.tops) < 2: if len(self.tops) < 2:
@ -124,6 +129,11 @@ class ClosetGUI(ClothesGUI.ClothesGUI):
self.bottomTrashButton['text'] = TTLocalizer.ClosetDeleteSkirt self.bottomTrashButton['text'] = TTLocalizer.ClosetDeleteSkirt
else: else:
self.bottomTrashButton['text'] = TTLocalizer.ClosetDeleteShorts 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): def setGender(self, gender):
self.ownerGender = gender self.ownerGender = gender

View file

@ -13,6 +13,7 @@ from direct.task.Task import Task
import ClosetGlobals import ClosetGlobals
import DistributedFurnitureItem import DistributedFurnitureItem
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.catalog import CatalogFurnitureItem
class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem): class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem):
notify = directNotify.newCategory('DistributedCloset') notify = directNotify.newCategory('DistributedCloset')
@ -235,7 +236,8 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem):
if self.isOwner: if self.isOwner:
self.accept(self.deleteEvent, self.__handleDelete) self.accept(self.deleteEvent, self.__handleDelete)
if not self.closetGUI: 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() self.closetGUI.load()
if self.gender != self.ownerGender: if self.gender != self.ownerGender:
self.closetGUI.setGender(self.ownerGender) self.closetGUI.setGender(self.ownerGender)
@ -320,14 +322,6 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem):
else: else:
self.notify.warning("cant delete this item(type = %s), since we don't have a replacement" % t_or_b) 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): def __proceedToCheckout(self):
if self.topDeleted or self.bottomDeleted: if self.topDeleted or self.bottomDeleted:
self.__popupAreYouSurePanel() self.__popupAreYouSurePanel()
@ -360,7 +354,6 @@ class DistributedCloset(DistributedFurnitureItem.DistributedFurnitureItem):
self.av.swapToonTorso(self.av.style.torso, genClothes=0) self.av.swapToonTorso(self.av.style.torso, genClothes=0)
self.av.loop('neutral', 0) self.av.loop('neutral', 0)
self.av.generateToonClothes() self.av.generateToonClothes()
return
def printInfo(self): def printInfo(self):
print 'avid: %s, gender: %s' % (self.av.doId, self.av.style.gender) 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) 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() buttons.removeNode()
self.popupInfo.reparentTo(aspect2d) self.popupInfo.reparentTo(aspect2d)
return
def __handleTimeoutMessageOK(self): def __handleTimeoutMessageOK(self):
self.popupInfo.reparentTo(hidden) self.popupInfo.reparentTo(hidden)

View file

@ -206,8 +206,5 @@ class DistributedClosetAI(DistributedFurnitureItemAI):
def setMovie(self, todo0, todo1, todo2): def setMovie(self, todo0, todo1, todo2):
pass pass
def resetItemLists(self):
pass
def setCustomerDNA(self, todo0, todo1): def setCustomerDNA(self, todo0, todo1):
pass pass

View file

@ -177,6 +177,7 @@ class DistributedPhone(DistributedFurnitureItem.DistributedFurnitureItem):
self.notify.debug('Entering Phone Sphere....') self.notify.debug('Entering Phone Sphere....')
taskMgr.remove(self.uniqueName('ringDoLater')) taskMgr.remove(self.uniqueName('ringDoLater'))
base.localAvatar.obscureMoveFurnitureButton(1)
self.cr.playGame.getPlace().detectedPhoneCollision() self.cr.playGame.getPlace().detectedPhoneCollision()
self.hasLocalAvatar = 1 self.hasLocalAvatar = 1
self.sendUpdate('avatarEnter', []) self.sendUpdate('avatarEnter', [])
@ -184,6 +185,7 @@ class DistributedPhone(DistributedFurnitureItem.DistributedFurnitureItem):
def __handlePhoneDone(self): def __handlePhoneDone(self):
self.sendUpdate('avatarExit', []) self.sendUpdate('avatarExit', [])
self.ignore(self.phoneGuiDoneEvent) self.ignore(self.phoneGuiDoneEvent)
base.localAvatar.obscureMoveFurnitureButton(0)
self.setPos(self.getPos()) self.setPos(self.getPos())
self.phoneGui = None self.phoneGui = None

View file

@ -231,20 +231,6 @@ class DistributedTrunk(DistributedCloset.DistributedCloset):
else: else:
self.notify.warning("cant delete this item(type = %s), since we don't have a replacement" % which) 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): def __proceedToCheckout(self):
if self.hatDeleted or self.glassesDeleted or self.backpackDeleted or self.shoesDeleted: if self.hatDeleted or self.glassesDeleted or self.backpackDeleted or self.shoesDeleted:
self.__popupAreYouSurePanel() self.__popupAreYouSurePanel()

View file

@ -164,7 +164,7 @@ class House(Place.Place):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopSleepWatch() base.localAvatar.stopSleepWatch()
def enterBanking(self): def enterBanking(self):

View file

@ -31,25 +31,24 @@ class TrunkGUI(StateData.StateData):
self.cancelEvent = cancelEvent self.cancelEvent = cancelEvent
self.genderChange = 0 self.genderChange = 0
self.verify = None self.verify = None
return
def load(self): def load(self):
self.gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') self.matGui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui')
guiRArrowUp = self.gui.find('**/tt_t_gui_mat_arrowUp') guiRArrowUp = self.matGui.find('**/tt_t_gui_mat_arrowUp')
guiRArrowRollover = self.gui.find('**/tt_t_gui_mat_arrowUp') guiRArrowRollover = self.matGui.find('**/tt_t_gui_mat_arrowUp')
guiRArrowDown = self.gui.find('**/tt_t_gui_mat_arrowDown') guiRArrowDown = self.matGui.find('**/tt_t_gui_mat_arrowDown')
guiRArrowDisabled = self.gui.find('**/tt_t_gui_mat_arrowDisabled') guiRArrowDisabled = self.matGui.find('**/tt_t_gui_mat_arrowDisabled')
guiArrowRotateUp = self.gui.find('**/tt_t_gui_mat_arrowRotateUp') guiArrowRotateUp = self.matGui.find('**/tt_t_gui_mat_arrowRotateUp')
guiArrowRotateDown = self.gui.find('**/tt_t_gui_mat_arrowRotateDown') guiArrowRotateDown = self.matGui.find('**/tt_t_gui_mat_arrowRotateDown')
shuffleFrame = self.gui.find('**/tt_t_gui_mat_shuffleFrame') self.shuffleFrame = self.matGui.find('**/tt_t_gui_mat_shuffleFrame')
shuffleArrowUp = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') shuffleArrowUp = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp')
shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown') shuffleArrowDown = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDown')
shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') shuffleArrowRollover = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp')
shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled') 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 = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.216), frameColor=(1, 0, 0, 0))
def addFrame(posZ, text): 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): def addButton(parent, scale, hoverScale, posX, command, extraArg):
return DirectButton(parent=parent, relief=None, image=(shuffleArrowUp, return DirectButton(parent=parent, relief=None, image=(shuffleArrowUp,
@ -57,6 +56,7 @@ class TrunkGUI(StateData.StateData):
shuffleArrowRollover, shuffleArrowRollover,
shuffleArrowDisabled), image_scale=scale, image1_scale=hoverScale, image2_scale=hoverScale, pos=(posX, 0, 0), command=command, extraArgs=[extraArg]) 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.hatFrame = addFrame(0.1, TTLocalizer.TrunkHatGUI)
self.hatLButton = addButton(self.hatFrame, halfButtonScale, halfButtonHoverScale, -0.2, self.swapHat, -1) self.hatLButton = addButton(self.hatFrame, halfButtonScale, halfButtonHoverScale, -0.2, self.swapHat, -1)
self.hatRButton = addButton(self.hatFrame, halfButtonInvertScale, halfButtonInvertHoverScale, 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.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)) 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() trashcanGui.removeNode()
return
def unload(self): def unload(self):
taskMgr.remove(self.taskName('rotateL')) taskMgr.remove(self.taskName('rotateL'))
@ -111,7 +110,11 @@ class TrunkGUI(StateData.StateData):
self.ignore('verifyDone') self.ignore('verifyDone')
self.gui.removeNode() self.gui.removeNode()
del self.gui del self.gui
self.matGui.removeNode()
del self.matGui
del self.shuffleFrame
self.parentFrame.destroy() self.parentFrame.destroy()
self.countFrame.destroy()
self.hatFrame.destroy() self.hatFrame.destroy()
self.glassesFrame.destroy() self.glassesFrame.destroy()
self.backpackFrame.destroy() self.backpackFrame.destroy()
@ -124,6 +127,7 @@ class TrunkGUI(StateData.StateData):
self.backpackRButton.destroy() self.backpackRButton.destroy()
self.shoesLButton.destroy() self.shoesLButton.destroy()
self.shoesRButton.destroy() self.shoesRButton.destroy()
del self.countFrame
del self.parentFrame del self.parentFrame
del self.hatFrame del self.hatFrame
del self.glassesFrame del self.glassesFrame
@ -286,7 +290,7 @@ class TrunkGUI(StateData.StateData):
self.swapShoes(0) self.swapShoes(0)
self.updateTrashButtons() self.updateTrashButtons()
self.setupButtons() self.setupButtons()
return self.updateCountFrame()
def updateTrashButtons(self): def updateTrashButtons(self):
if not self.isOwner: if not self.isOwner:
@ -307,6 +311,11 @@ class TrunkGUI(StateData.StateData):
self.shoesTrashButton['state'] = DGG.DISABLED self.shoesTrashButton['state'] = DGG.DISABLED
else: else:
self.shoesTrashButton['state'] = DGG.NORMAL 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): def rotateToonL(self, task):
self.toon.setH(self.toon.getH() - 4) self.toon.setH(self.toon.getH() - 4)

View file

@ -90,7 +90,7 @@ class DistributedFishingPond(DistributedObject.DistributedObject):
return self.pondBingoMgr return self.pondBingoMgr
def hasPondBingoManager(self): def hasPondBingoManager(self):
return (self.pondBingoMgr and [1] or [0])[0] return self.pondBingoMgr is not None
def handleBingoCatch(self, catch): def handleBingoCatch(self, catch):
if self.pondBingoMgr: if self.pondBingoMgr:

View file

@ -187,7 +187,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.invPage.hideInventoryOnscreen() base.localAvatar.invPage.hideInventoryOnscreen()
base.localAvatar.questMap.hide() base.localAvatar.questMap.hide()
base.localAvatar.questMap.ignoreOnscreenHooks() base.localAvatar.questMap.ignoreOnscreenHooks()
return
def handleWalkDone(self, doneStatus): def handleWalkDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -293,7 +292,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
self.ignore('bookDone') self.ignore('bookDone')
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
target = base.cr.doFind('DistributedTarget') target = base.cr.doFind('DistributedTarget')
if target: if target:
target.showGui() target.showGui()
@ -445,13 +444,13 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
def exitDoorIn(self): def exitDoorIn(self):
NametagGlobals.setMasterArrowsOn(1) NametagGlobals.setMasterArrowsOn(1)
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def enterDoorOut(self): def enterDoorOut(self):
base.localAvatar.obscureMoveFurnitureButton(1) base.localAvatar.obscureMoveFurnitureButton(1)
def exitDoorOut(self): def exitDoorOut(self):
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopQuestMap() base.localAvatar.stopQuestMap()
def handleDoorDoneEvent(self, requestStatus): def handleDoorDoneEvent(self, requestStatus):
@ -495,7 +494,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
self.accept('tunnelOutMovieDone', self.__tunnelOutMovieDone) self.accept('tunnelOutMovieDone', self.__tunnelOutMovieDone)
base.localAvatar.tunnelOut(tunnelOrigin) base.localAvatar.tunnelOut(tunnelOrigin)
base.localAvatar.stopQuestMap() base.localAvatar.stopQuestMap()
return
def __tunnelOutMovieDone(self): def __tunnelOutMovieDone(self):
self.ignore('tunnelOutMovieDone') self.ignore('tunnelOutMovieDone')
@ -512,7 +510,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
def exitTeleportOut(self): def exitTeleportOut(self):
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.stopQuestMap() base.localAvatar.stopQuestMap()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def enterDied(self, requestStatus, callback = None): def enterDied(self, requestStatus, callback = None):
if callback == None: if callback == None:
@ -529,7 +527,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
def exitDied(self): def exitDied(self):
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def getEstateZoneAndGoHome(self, requestStatus): def getEstateZoneAndGoHome(self, requestStatus):
self.doneStatus = requestStatus self.doneStatus = requestStatus
@ -647,7 +645,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
self._tiToken = None self._tiToken = None
NametagGlobals.setMasterArrowsOn(1) NametagGlobals.setMasterArrowsOn(1)
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopUpdateSmartCamera() base.localAvatar.stopUpdateSmartCamera()
base.localAvatar.detachCamera() base.localAvatar.detachCamera()
base.localAvatar.stopPosHprBroadcast() base.localAvatar.stopPosHprBroadcast()
@ -692,7 +690,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def enterPurchase(self): def enterPurchase(self):
base.localAvatar.b_setAnimState('neutral', 1) base.localAvatar.b_setAnimState('neutral', 1)
@ -705,7 +703,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
def enterFishing(self): def enterFishing(self):
base.localAvatar.b_setAnimState('neutral', 1) base.localAvatar.b_setAnimState('neutral', 1)
@ -736,7 +734,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopSleepWatch() base.localAvatar.stopSleepWatch()
def enterPhone(self): def enterPhone(self):
@ -757,7 +755,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopSleepWatch() base.localAvatar.stopSleepWatch()
def enterStopped(self): def enterStopped(self):
@ -783,7 +781,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
base.localAvatar.setTeleportAvailable(0) base.localAvatar.setTeleportAvailable(0)
self.ignore('teleportQuery') self.ignore('teleportQuery')
base.localAvatar.laffMeter.stop() base.localAvatar.laffMeter.stop()
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)
base.localAvatar.stopSleepWatch() base.localAvatar.stopSleepWatch()
messenger.send('exitingStoppedState') messenger.send('exitingStoppedState')

View file

@ -25,20 +25,20 @@ class ClothesGUI(StateData.StateData):
return return
def load(self): def load(self):
self.gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui') self.matGui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui')
guiRArrowUp = self.gui.find('**/tt_t_gui_mat_arrowUp') guiRArrowUp = self.matGui.find('**/tt_t_gui_mat_arrowUp')
guiRArrowRollover = self.gui.find('**/tt_t_gui_mat_arrowUp') guiRArrowRollover = self.matGui.find('**/tt_t_gui_mat_arrowUp')
guiRArrowDown = self.gui.find('**/tt_t_gui_mat_arrowDown') guiRArrowDown = self.matGui.find('**/tt_t_gui_mat_arrowDown')
guiRArrowDisabled = self.gui.find('**/tt_t_gui_mat_arrowDisabled') guiRArrowDisabled = self.matGui.find('**/tt_t_gui_mat_arrowDisabled')
shuffleFrame = self.gui.find('**/tt_t_gui_mat_shuffleFrame') self.shuffleFrame = self.matGui.find('**/tt_t_gui_mat_shuffleFrame')
shuffleArrowUp = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') shuffleArrowUp = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp')
shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown') shuffleArrowDown = self.matGui.find('**/tt_t_gui_mat_shuffleArrowDown')
shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp') shuffleArrowRollover = self.matGui.find('**/tt_t_gui_mat_shuffleArrowUp')
shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled') 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 = 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.setPos(-0.36, 0, -0.5)
self.parentFrame.reparentTo(base.a2dTopRight) 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, self.topLButton = DirectButton(parent=self.shirtFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -47,7 +47,7 @@ class ClothesGUI(StateData.StateData):
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.swapTop, extraArgs=[1]) 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, self.bottomLButton = DirectButton(parent=self.bottomFrame, relief=None, image=(shuffleArrowUp,
shuffleArrowDown, shuffleArrowDown,
shuffleArrowRollover, shuffleArrowRollover,
@ -59,11 +59,10 @@ class ClothesGUI(StateData.StateData):
self.parentFrame.hide() self.parentFrame.hide()
self.shuffleFetchMsg = 'ClothesShopShuffle' self.shuffleFetchMsg = 'ClothesShopShuffle'
self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg) self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg)
return
def unload(self): def unload(self):
self.gui.removeNode() self.matGui.removeNode()
del self.gui del self.matGui
self.parentFrame.destroy() self.parentFrame.destroy()
self.shirtFrame.destroy() self.shirtFrame.destroy()
self.bottomFrame.destroy() self.bottomFrame.destroy()
@ -71,6 +70,7 @@ class ClothesGUI(StateData.StateData):
self.topRButton.destroy() self.topRButton.destroy()
self.bottomLButton.destroy() self.bottomLButton.destroy()
self.bottomRButton.destroy() self.bottomRButton.destroy()
del self.shuffleFrame
del self.parentFrame del self.parentFrame
del self.shirtFrame del self.shirtFrame
del self.bottomFrame del self.bottomFrame

View file

@ -91,7 +91,7 @@ class ColorShop(StateData.StateData):
self.pickContainer.setTransparency(True) 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.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.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.B1PRESS, self.__startPickColor)
self.pickButton.bind(DGG.B1RELEASE, self.__stopPickColor) 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)) 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))

View file

@ -30,9 +30,6 @@ class QuestMap(DirectFrame):
self.cogInfoFrame.setPos(0, 0, 0.6) self.cogInfoFrame.setPos(0, 0, 0.6)
self.buildingMarkers = [] self.buildingMarkers = []
self.av = av self.av = av
self.wantToggle = False
if base.config.GetBool('want-toggle-quest-map', True):
self.wantToggle = True
self.updateMarker = True self.updateMarker = True
self.cornerPosInfo = None self.cornerPosInfo = None
self.hqPosInfo = None self.hqPosInfo = None
@ -47,8 +44,6 @@ class QuestMap(DirectFrame):
tracks = currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_TRACK] tracks = currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_TRACK]
self.suitPercentage[currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_ZONE]] = tracks self.suitPercentage[currHoodInfo[SuitPlannerBase.SuitPlannerBase.SUIT_HOOD_INFO_ZONE]] = tracks
return
def load(self): def load(self):
gui = loader.loadModel('phase_4/models/questmap/questmap_gui') gui = loader.loadModel('phase_4/models/questmap/questmap_gui')
icon = gui.find('**/tt_t_gui_qst_arrow') icon = gui.find('**/tt_t_gui_qst_arrow')
@ -279,7 +274,6 @@ class QuestMap(DirectFrame):
self.obscureButton() self.obscureButton()
self.ignore('questPageUpdated') self.ignore('questPageUpdated')
taskMgr.remove('questMapUpdate') taskMgr.remove('questMapUpdate')
return
def handleMarker(self): def handleMarker(self):
if hasattr(base.cr.playGame.getPlace(), 'isInterior') and base.cr.playGame.getPlace().isInterior: if hasattr(base.cr.playGame.getPlace(), 'isInterior') and base.cr.playGame.getPlace().isInterior:
@ -288,15 +282,9 @@ class QuestMap(DirectFrame):
self.updateMarker = True self.updateMarker = True
def acceptOnscreenHooks(self): def acceptOnscreenHooks(self):
if self.wantToggle:
self.accept(ToontownGlobals.MapHotkey, self.toggle) self.accept(ToontownGlobals.MapHotkey, self.toggle)
else:
self.accept(ToontownGlobals.MapHotkeyOn, self.show)
self.accept(ToontownGlobals.MapHotkeyOff, self.hide)
self.updateMap() self.updateMap()
def ignoreOnscreenHooks(self): def ignoreOnscreenHooks(self):
self.ignore(ToontownGlobals.MapHotkey) self.ignore(ToontownGlobals.MapHotkey)
self.ignore(ToontownGlobals.MapHotkeyOn)
self.ignore(ToontownGlobals.MapHotkeyOff)
self.obscureButton() self.obscureButton()

View file

@ -406,9 +406,12 @@ class NPCMoviePlayer(DirectObject.DirectObject):
self.closePreviousChapter(iList) self.closePreviousChapter(iList)
chapterList = [] chapterList = []
self.currentEvent = nextEvent self.currentEvent = nextEvent
elif command == 'TUTORIAL_ACK_DONE':
iList.append(Func(base.localAvatar.setTutorialAck, True))
else: else:
notify.warning('Unknown command token: %s for scriptId: %s on line: %s' % (command, self.scriptId, lineNum)) notify.warning('Unknown command token: %s for scriptId: %s on line: %s' % (command, self.scriptId, lineNum))
self.closePreviousChapter(chapterList) self.closePreviousChapter(chapterList)
if timeoutList: if timeoutList:
self.timeoutTrack = Sequence(*timeoutList) self.timeoutTrack = Sequence(*timeoutList)

View file

@ -73,12 +73,19 @@ 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 = 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.teleportButton.hide()
self.laffMeter = None self.laffMeter = None
return self.dialog = None
def destroy(self): def destroy(self):
self._deleteGeoms() self._deleteGeoms()
self.destroyDialog()
DirectFrame.destroy(self) 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): def _deleteGeoms(self):
for icon in (self.lQuestIcon, self.rQuestIcon): for icon in (self.lQuestIcon, self.rQuestIcon):
geom = icon['geom'] geom = icon['geom']
@ -153,11 +160,7 @@ class QuestPoster(DirectFrame):
def loadElevator(self, building, numFloors): def loadElevator(self, building, numFloors):
elevatorNodePath = hidden.attachNewNode('elevatorNodePath') elevatorNodePath = hidden.attachNewNode('elevatorNodePath')
elevatorModel = loader.loadModel('phase_4/models/modules/elevator') elevatorModel = loader.loadModel('phase_4/models/modules/elevator')
floorIndicator = [None, floorIndicator = [None] * 5
None,
None,
None,
None]
npc = elevatorModel.findAllMatches('**/floor_light_?;+s') npc = elevatorModel.findAllMatches('**/floor_light_?;+s')
for i in xrange(npc.getNumPaths()): for i in xrange(npc.getNumPaths()):
np = npc.getPath(i) np = npc.getPath(i)
@ -174,6 +177,9 @@ class QuestPoster(DirectFrame):
elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0) elevatorNodePath.setPosHpr(0, 0, 0, 0, 0, 0)
def teleportToShop(self, npcId): def teleportToShop(self, npcId):
if base.cr.playGame.getPlace().getState() != 'walk':
return
npcZone = NPCToons.getNPCZone(npcId) npcZone = NPCToons.getNPCZone(npcId)
npcHood = ZoneUtil.getCanonicalHoodId(npcZone) npcHood = ZoneUtil.getCanonicalHoodId(npcZone)
hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505} hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505}
@ -185,14 +191,31 @@ class QuestPoster(DirectFrame):
npcHood = ZoneUtil.getCanonicalHoodId(zoneId) npcHood = ZoneUtil.getCanonicalHoodId(zoneId)
npcZone = hqZone.get(npcHood, 2520) npcZone = hqZone.get(npcHood, 2520)
base.cr.buildingQueryMgr.d_isSuit(npcZone, lambda isSuit: self.teleportToShopCallback(npcZone, npcHood, isSuit)) cost = ToontownGlobals.getTeleportButtonCost(npcHood)
self.destroyDialog()
base.cr.playGame.getPlace().setState('stopped')
def teleportToShopCallback(self, npcZone, npcHood, flag): 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))
self.dialog.show()
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: 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 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) base.cr.playGame.getPlace().requestTeleport(npcHood, npcZone, base.localAvatar.defaultShard, -1)
def fitGeometry(self, geom, fFlip = 0, dimension = 0.8): def fitGeometry(self, geom, fFlip = 0, dimension = 0.8):
@ -228,6 +251,7 @@ class QuestPoster(DirectFrame):
self.rPictureFrame.hide() self.rPictureFrame.hide()
self.questProgress.hide() self.questProgress.hide()
self.teleportButton.hide() self.teleportButton.hide()
self.destroyDialog()
if hasattr(self, 'chooseButton'): if hasattr(self, 'chooseButton'):
self.chooseButton.destroy() self.chooseButton.destroy()
del self.chooseButton del self.chooseButton

View file

@ -254,6 +254,7 @@ WRTREPARENTTO chatNormalButton topLeft
LERP_POS chatNormalButton 0.068 0 -0.072 0.6 LERP_POS chatNormalButton 0.068 0 -0.072 0.6
LERP_SCALE chatNormalButton 1.179 1.179 1.179 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_7 "CFReversed"
LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_8 1 "CFReversed" LOCAL_CHAT_CONFIRM npc QuestScriptTutorialBlocker_8 1 "CFReversed"
LOOP_ANIM npc "walk" LOOP_ANIM npc "walk"

View file

@ -551,14 +551,14 @@ class DistributedRace(DistributedObject.DistributedObject):
newLapT = (newT - self.startT) / self.curve.getMaxT() % 1.0 newLapT = (newT - self.startT) / self.curve.getMaxT() % 1.0
if newLapT - self.currLapT < -0.5: if newLapT - self.currLapT < -0.5:
self.laps += 1 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.notify.debug('crossed the start line: %s, %s, %s, %s' % (self.laps,
self.startT, self.startT,
self.currT, self.currT,
newT)) newT))
elif newLapT - self.currLapT > 0.5: elif newLapT - self.currLapT > 0.5:
self.laps -= 1 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.notify.debug('crossed the start line - wrong way: %s, %s, %s, %s' % (self.laps,
self.startT, self.startT,
self.currT, self.currT,

View file

@ -33,6 +33,7 @@ class DistributedRaceAI(DistributedObjectAI, FSM):
self.livingGags = [] self.livingGags = []
self.currentlyAffectedByAnvil = {} self.currentlyAffectedByAnvil = {}
self.avatarProgress = {} self.avatarProgress = {}
self.startTime = globalClockDelta.networkToLocalTime(globalClockDelta.getRealNetworkTime()) + 3
def generate(self): def generate(self):
for avatar in self.avatars: for avatar in self.avatars:

View file

@ -568,6 +568,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
self.sellFishConfirmDialog.hide() self.sellFishConfirmDialog.hide()
self.brokeDialog.hide() self.brokeDialog.hide()
self.howToDialog.hide() self.howToDialog.hide()
self.exitButton.hide()
self.castButton.unbind(DGG.B1PRESS) self.castButton.unbind(DGG.B1PRESS)
self.castButton.unbind(DGG.B3PRESS) self.castButton.unbind(DGG.B3PRESS)
self.castButton.unbind(DGG.B1RELEASE) self.castButton.unbind(DGG.B1RELEASE)
@ -592,7 +593,7 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
self.castGui.setPos(0, 1, 0) self.castGui.setPos(0, 1, 0)
for nodeName in ('bucket', 'jar', 'display_bucket', 'display_jar'): for nodeName in ('bucket', 'jar', 'display_bucket', 'display_jar'):
self.castGui.find('**/' + nodeName).reparentTo(self.castGui) 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.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.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() self.castGui.find('**/castButton').removeNode()
@ -1050,9 +1051,4 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
self.fsm.request('waiting', [False]) self.fsm.request('waiting', [False])
def __allowSellFish(self): def __allowSellFish(self):
if base.wantBingo: return base.wantBingo and self.pond.hasPondBingoManager()
if self.pond.hasPondBingoManager():
hoodId = base.cr.playGame.getPlaceId()
if hoodId == ToontownGlobals.MyEstate:
return True
return False

View file

@ -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.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.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.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), 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, 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) thumb_geom=(circleModel.find('**/tt_t_gui_mat_namePanelCircle')), thumb_relief=None, thumb_geom_scale=2)
self.fov_slider.setScale(0.25) 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.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.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), 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)) command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045))
guiButton.removeNode() guiButton.removeNode()
circleModel.removeNode() circleModel.removeNode()
self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 4, self.__updateFishingPole, [False], self.__applyFishingPole) self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 5, self.__updateFishingPole, [False], self.__applyFishingPole)
self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 5, self.__updateNametagStyle, [False], self.__applyNametagStyle) self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 6, self.__updateNametagStyle, [False], self.__applyNametagStyle)
def enter(self): def enter(self):
self.show() self.show()
self.settingsChanged = 0 self.settingsChanged = 0
self.__setCogInterfaceButton() self.__setCogInterfaceButton()
self.__setTpTransitionButton() self.__setTpTransitionButton()
self.__setFpsMeterButton()
self.__setTeleportButton() self.__setTeleportButton()
self.__updateNametagStyle() self.__updateNametagStyle()
self.__updateFishingPole() self.__updateFishingPole()
@ -779,6 +782,10 @@ class ExtraOptionsTabPage(DirectFrame):
del self.tpTransition_label del self.tpTransition_label
self.tpTransition_toggleButton.destroy() self.tpTransition_toggleButton.destroy()
del self.tpTransition_toggleButton del self.tpTransition_toggleButton
self.fpsMeter_label.destroy()
del self.fpsMeter_label
self.fpsMeter_toggleButton.destroy()
del self.fpsMeter_toggleButton
self.teleport_label.destroy() self.teleport_label.destroy()
del self.teleport_label del self.teleport_label
self.teleport_toggleButton.destroy() 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_label['text'] = TTLocalizer.TpTransitionLabelOn if settings['tpTransition'] else TTLocalizer.TpTransitionLabelOff
self.tpTransition_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['tpTransition'] else TTLocalizer.OptionsPageToggleOn 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): def __doToggleTeleport(self):
messenger.send('wakeup') messenger.send('wakeup')
acceptingTeleport = settings.get('acceptingTeleport', {}) acceptingTeleport = settings.get('acceptingTeleport', {})

View file

@ -21,8 +21,7 @@ class ShtikerBook(DirectFrame, StateData.StateData):
self.pages = [] self.pages = []
self.pageTabs = [] self.pageTabs = []
self.currPageTabIndex = None self.currPageTabIndex = None
self.pageTabFrame = DirectFrame(parent=self, relief=None, pos=(0.93, 1, 0.575), scale=1.25) self.pageTabFrames = [self.createPageTabFrame(x) for x in (-0.93, 0.93)]
self.pageTabFrame.hide()
self.currPageIndex = None self.currPageIndex = None
self.entered = 0 self.entered = 0
self.safeMode = 0 self.safeMode = 0
@ -48,6 +47,11 @@ class ShtikerBook(DirectFrame, StateData.StateData):
TTLocalizer.EventsPageName, TTLocalizer.EventsPageName,
TTLocalizer.StatPageTitle] 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): def setSafeMode(self, setting):
self.safeMode = setting self.safeMode = setting
@ -76,7 +80,8 @@ class ShtikerBook(DirectFrame, StateData.StateData):
self.accept('shtiker-page-done', self.__pageDone) self.accept('shtiker-page-done', self.__pageDone)
self.accept(ToontownGlobals.StickerBookHotkey, self.__close) self.accept(ToontownGlobals.StickerBookHotkey, self.__close)
self.accept(ToontownGlobals.OptionsPageHotkey, self.__close) self.accept(ToontownGlobals.OptionsPageHotkey, self.__close)
self.pageTabFrame.show() for tab in self.pageTabFrames:
tab.show()
self.pages[self.currPageIndex].enter() self.pages[self.currPageIndex].enter()
def exit(self): def exit(self):
@ -106,7 +111,8 @@ class ShtikerBook(DirectFrame, StateData.StateData):
self.hide() self.hide()
self.hideButton() self.hideButton()
cleanupDialog('globalDialog') cleanupDialog('globalDialog')
self.pageTabFrame.hide() for tab in self.pageTabFrames:
tab.hide()
self.ignore('shtiker-page-done') self.ignore('shtiker-page-done')
self.ignore(ToontownGlobals.StickerBookHotkey) self.ignore(ToontownGlobals.StickerBookHotkey)
self.ignore(ToontownGlobals.OptionsPageHotkey) self.ignore(ToontownGlobals.OptionsPageHotkey)
@ -178,7 +184,7 @@ class ShtikerBook(DirectFrame, StateData.StateData):
if base.config.GetBool('want-qa-regression', 0): if base.config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: SHTICKERBOOK: Browse tabs %s' % page.pageName) self.notify.info('QA-REGRESSION: SHTICKERBOOK: Browse tabs %s' % page.pageName)
yOffset = 0.07 * pageIndex yOffset = 0.07 * (pageIndex % 16)
iconGeom = None iconGeom = None
iconImage = None iconImage = None
iconScale = 1 iconScale = 1
@ -257,13 +263,14 @@ class ShtikerBook(DirectFrame, StateData.StateData):
iconModels.detachNode() iconModels.detachNode()
if pageName == TTLocalizer.OptionsPageTitle: if pageName == TTLocalizer.OptionsPageTitle:
pageName = TTLocalizer.OptionsTabTitle 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, -0.575,
0.575), borderWidth=(0.05, 0.05), text=('', 0.575), borderWidth=(0.05, 0.05), text=('',
'', '',
pageName, 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) self.pageTabs.insert(pageIndex, pageTab)
return return

View file

@ -1,24 +1,21 @@
from direct.gui.DirectGui import * from direct.gui.DirectGui import *
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
import ShtikerPage 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): class StatPage(ShtikerPage.ShtikerPage):
def __init__(self): def __init__(self):
ShtikerPage.ShtikerPage.__init__(self) ShtikerPage.ShtikerPage.__init__(self)
self.dialog = None self.dialog = None
self.chunkCount = 11
def load(self): def load(self):
guiButton = loader.loadModel('phase_3/models/gui/quit_button') guiButton = loader.loadModel('phase_3/models/gui/quit_button')
self.rows = [None] * 2 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, 0, 0.6)) self.title = DirectLabel(parent=self, relief=None, text=TTLocalizer.StatPageTitle, text_scale=0.12, textMayChange=0, pos=(-0.625, 0, 0.625))
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.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)
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)
guiButton.removeNode() guiButton.removeNode()
def enter(self): def enter(self):
@ -48,24 +45,25 @@ class StatPage(ShtikerPage.ShtikerPage):
self.dialog.destroy() self.dialog.destroy()
self.dialog = None 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): def cutToChunks(self, list, size):
for i in xrange(0, len(list), size): for i in xrange(0, len(list), size):
yield list[i:i+size] yield list[i:i+size]
def updateStats(self): def updateStats(self):
dict = {}
stats = base.localAvatar.stats stats = base.localAvatar.stats
allStats = [TTLocalizer.Stats[i] % '{:,}'.format(stats[i]) for i in xrange(len(stats))]
for i, string in enumerate(STATS): textChunks = list(self.cutToChunks(allStats, self.chunkCount))
dict[string] = "{:,}".format(stats[i])
textChunks = list(self.cutToChunks(TTLocalizer.Stats, 11))
for i, chunk in enumerate(textChunks): 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): 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() self.dialog.show()
def __handleDialogResponse(self, response): def __handleDialogResponse(self, response):
@ -75,5 +73,5 @@ class StatPage(ShtikerPage.ShtikerPage):
return return
base.localAvatar.wipeStats() 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() self.dialog.show()

View file

@ -336,9 +336,12 @@ class SuitPage(ShtikerPage.ShtikerPage):
yStart = -0.18 yStart = -0.18
xOffset = 0.199 xOffset = 0.199
yOffset = 0.284 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.setBin('gui-popup', 0)
self.rolloverFrame.hide() self.rolloverFrame.hide()
gui.removeNode()
for dept in xrange(0, len(SuitDNA.suitDepts)): for dept in xrange(0, len(SuitDNA.suitDepts)):
row = [] row = []
color = PANEL_COLORS[dept] color = PANEL_COLORS[dept]
@ -419,7 +422,6 @@ class SuitPage(ShtikerPage.ShtikerPage):
index = self.panels.index(panel) index = self.panels.index(panel)
if not base.localAvatar.hasCogSummons(index): if not base.localAvatar.hasCogSummons(index):
panel.summonButton.hide() panel.summonButton.hide()
return
def addBuildingRadarLabel(self, button): def addBuildingRadarLabel(self, button):
gui = loader.loadModel('phase_3.5/models/gui/suit_detail_panel') 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()) 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() gui.removeNode()
button.buildingRadarLabel = buildingRadarLabel button.buildingRadarLabel = buildingRadarLabel
return
def resetPanel(self, dept, type): def resetPanel(self, dept, type):
panel = self.panels[dept * SuitDNA.suitsPerDept + 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,)) taskMgr.doMethodLater(RADAR_DELAY * SuitDNA.suitsPerDept, showLabel, 'showBuildingRadarLater', extraArgs=(button,))
else: else:
button.buildingRadarLabel.hide() button.buildingRadarLabel.hide()
return

View file

@ -461,7 +461,8 @@ class BossCog(Avatar.Avatar):
self.doAnimate(None, raised=1, happy=1, queueNeutral=1) self.doAnimate(None, raised=1, happy=1, queueNeutral=1)
ival = Sequence() ival = Sequence()
if self.dna.dept == 'm': 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)))) 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: if self.twoFaced:
self.happy = 0 self.happy = 0

View file

@ -561,7 +561,7 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI):
damage *= self.getDamageMultiplier() damage *= self.getDamageMultiplier()
self.damageToon(toon, damage) self.damageToon(toon, damage)
currState = self.getCurrentOrNextState() 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 bpy < 0 and abs(bpx / bpy) > 0.5:
if bpx < 0: if bpx < 0:
self.b_setAttackCode(ToontownGlobals.BossCogSwatRight) self.b_setAttackCode(ToontownGlobals.BossCogSwatRight)
@ -600,7 +600,6 @@ class DistributedBossCogAI(DistributedAvatarAI.DistributedAvatarAI):
if self.dept == 'm' and attackCode == ToontownGlobals.BossCogAreaAttack: if self.dept == 'm' and attackCode == ToontownGlobals.BossCogAreaAttack:
delayTime += 5.0 delayTime += 5.0
self.waitForNextAttack(delayTime) self.waitForNextAttack(delayTime)
return
def d_setAttackCode(self, attackCode, avId = 0): def d_setAttackCode(self, attackCode, avId = 0):
self.sendUpdate('setAttackCode', [attackCode, avId]) self.sendUpdate('setAttackCode', [attackCode, avId])

View file

@ -145,7 +145,7 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
def doNextAttack(self, task): def doNextAttack(self, task):
if random.random() <= 0.2: if random.random() <= 0.2:
self.b_setAttackCode(ToontownGlobals.BossCogAreaAttack) self.b_setAttackCode(ToontownGlobals.BossCogAreaAttack)
taskMgr.doMethodLater(9.36, self.__reviveGoons, self.uniqueName('reviveGoons')) taskMgr.doMethodLater(7.36, self.__reviveGoons, self.uniqueName('reviveGoons'))
else: else:
self.__doDirectedAttack() self.__doDirectedAttack()
if self.heldObject == None and not self.waitingForHelmet: if self.heldObject == None and not self.waitingForHelmet:

View file

@ -23,10 +23,9 @@ from toontown.building import ElevatorConstants
from toontown.building import ElevatorUtils from toontown.building import ElevatorUtils
from toontown.coghq import CogDisguiseGlobals from toontown.coghq import CogDisguiseGlobals
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from otp.nametag import NametagGroup
from otp.nametag.NametagConstants import * from otp.nametag.NametagConstants import *
from otp.nametag import NametagGlobals from otp.nametag import NametagGlobals
from toontown.toon import Toon from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownBattleGlobals
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -1567,15 +1566,11 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
return bossTrack return bossTrack
def __makeWitnessToon(self): def __makeWitnessToon(self):
dnaNetString = 't\x1b\x00\x01\x01\x00\x03\x00\x03\x01\x10\x13\x00\x13\x13' if self.witnessToon:
npc = Toon.Toon() return
npc.setDNAString(dnaNetString) self.witnessToon = NPCToons.createLocalNPC(13002)
npc.setName(TTLocalizer.WitnessToonName)
npc.setPickable(0)
npc.setPlayerType(NametagGroup.CCNonPlayer)
npc.animFSM.request('Sit')
self.witnessToon = npc
self.witnessToon.setPosHpr(*ToontownGlobals.LawbotBossWitnessStandPosHpr) self.witnessToon.setPosHpr(*ToontownGlobals.LawbotBossWitnessStandPosHpr)
self.witnessToon.animFSM.request('Sit')
def __cleanupWitnessToon(self): def __cleanupWitnessToon(self):
self.__hideWitnessToon() self.__hideWitnessToon()
@ -1583,7 +1578,6 @@ class DistributedLawbotBoss(DistributedBossCog.DistributedBossCog, FSM.FSM):
self.witnessToon.removeActive() self.witnessToon.removeActive()
self.witnessToon.delete() self.witnessToon.delete()
self.witnessToon = None self.witnessToon = None
return
def __showWitnessToon(self): def __showWitnessToon(self):
if not self.witnessToonOnstage: if not self.witnessToonOnstage:

View file

@ -30,7 +30,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
self.bossMaxDamage = ToontownGlobals.SellbotBossMaxDamage self.bossMaxDamage = ToontownGlobals.SellbotBossMaxDamage
self.recoverRate = 0 self.recoverRate = 0
self.recoverStartTime = 0 self.recoverStartTime = 0
self.punishedToons = []
def delete(self): def delete(self):
return DistributedBossCogAI.DistributedBossCogAI.delete(self) return DistributedBossCogAI.DistributedBossCogAI.delete(self)
@ -197,13 +196,6 @@ class DistributedSellbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS
return self.invokeSuitPlanner(10, 1) return self.invokeSuitPlanner(10, 1)
def removeToon(self, avId): 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) toon = simbase.air.doId2do.get(avId)
if toon: if toon:
toon.b_setNumPies(0) toon.b_setNumPies(0)

View file

@ -235,12 +235,12 @@ def loadDialog(level):
SuitDialogFiles = ['COG_VO_grunt', SuitDialogFiles = ['COG_VO_grunt',
'COG_VO_murmur', 'COG_VO_murmur',
'COG_VO_statement', 'COG_VO_statement',
'COG_VO_question'] 'COG_VO_question',
'COG_VO_exclaim']
for file in SuitDialogFiles: for file in SuitDialogFiles:
SuitDialogArray.append(base.loadSfx(loadPath + file + '.ogg')) SuitDialogArray.append(base.loadSfx(loadPath + file + '.ogg'))
SuitDialogArray.append(SuitDialogArray[2]) SuitDialogArray.append(SuitDialogArray[2])
SuitDialogArray.append(SuitDialogArray[2])
def loadSkelDialog(): def loadSkelDialog():
@ -252,11 +252,12 @@ def loadSkelDialog():
murmur = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_murmur.ogg') murmur = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_murmur.ogg')
statement = loader.loadSfx('phase_5/audio/sfx/Skel_COG_VO_statement.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') 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, SkelSuitDialogArray = [grunt,
murmur, murmur,
statement, statement,
question, question,
statement, exclaim,
statement] statement]

View file

@ -593,6 +593,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def setTutorialAck(self, tutorialAck): def setTutorialAck(self, tutorialAck):
self.tutorialAck = tutorialAck self.tutorialAck = tutorialAck
def getTutorialAck(self):
return self.tutorialAck
def setEarnedExperience(self, earnedExp): def setEarnedExperience(self, earnedExp):
self.earnedExperience = earnedExp self.earnedExperience = earnedExp
@ -1256,6 +1259,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def getTotalMoney(self): def getTotalMoney(self):
return self.getBankMoney() + self.getMoney() return self.getBankMoney() + self.getMoney()
def takeMoney(self, money):
self.sendUpdate('takeMoney', [money])
def setEmblems(self, emblems): def setEmblems(self, emblems):
if self.emblems != emblems: if self.emblems != emblems:
self.emblems = emblems self.emblems = emblems

View file

@ -5050,7 +5050,7 @@ def maxCogPage():
target.b_setCogStatus(cogStatus * deptCount) target.b_setCogStatus(cogStatus * deptCount)
target.b_setCogRadar([1, 1, 1, 1]) target.b_setCogRadar([1, 1, 1, 1])
target.b_setBuildingRadar([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) @magicWord(category=CATEGORY_PROGRAMMER)
def immortal(): def immortal():

View file

@ -7,6 +7,7 @@ from toontown.quest import BlinkingArrows
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
class InventoryNew(InventoryBase.InventoryBase, DirectFrame): class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
@ -159,6 +160,8 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
del self.detailAmountLabel del self.detailAmountLabel
del self.detailDataLabel del self.detailDataLabel
del self.totalLabel del self.totalLabel
self.cleanupDialog()
for row in self.trackRows: for row in self.trackRows:
row.destroy() row.destroy()
@ -172,7 +175,11 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
del self.buttons del self.buttons
InventoryBase.InventoryBase.unload(self) InventoryBase.InventoryBase.unload(self)
DirectFrame.destroy(self) DirectFrame.destroy(self)
return
def cleanupDialog(self):
if self.dialog:
self.dialog.cleanup()
self.dialog = None
def load(self): def load(self):
self.notify.debug('Loading Inventory for %d' % self.toon.doId) 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') trashcanGui = loader.loadModel('phase_3/models/gui/trashcan_gui')
trashcanImage = (trashcanGui.find('**/TrashCan_CLSD'), trashcanGui.find('**/TrashCan_OPEN'), trashcanGui.find('**/TrashCan_RLVR')) 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.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) 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() 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) 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 = 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.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.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.updateTotalPropsText()
self.trackRows = [] self.trackRows = []
self.trackNameLabels = [] self.trackNameLabels = []
@ -277,7 +285,15 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
def __handleBackToPlayground(self): def __handleBackToPlayground(self):
messenger.send('inventory-back-to-playground') messenger.send('inventory-back-to-playground')
def __zeroInvAndUpdate(self): 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.zeroInv()
self.updateGUI() self.updateGUI()
@ -391,6 +407,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
self.enableUberGags() self.enableUberGags()
def deactivateButtons(self): def deactivateButtons(self):
self.cleanupDialog()
if self.previousActivateMode == 'purchaseDelete': if self.previousActivateMode == 'purchaseDelete':
self.purchaseDeleteDeactivateButtons() self.purchaseDeleteDeactivateButtons()
elif self.previousActivateMode == 'purchase': elif self.previousActivateMode == 'purchase':
@ -411,6 +428,7 @@ class InventoryNew(InventoryBase.InventoryBase, DirectFrame):
self.plantTreeDeactivateButtons() self.plantTreeDeactivateButtons()
def __activateButtons(self): def __activateButtons(self):
self.cleanupDialog()
if hasattr(self, 'activateMode'): if hasattr(self, 'activateMode'):
if self.activateMode == 'book': if self.activateMode == 'book':
self.bookActivateButtons() self.bookActivateButtons()

View file

@ -428,9 +428,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
def isLocal(self): def isLocal(self):
return 1 return 1
def canChat(self):
return 1
def startChat(self): def startChat(self):
if self.tutorialAck: if self.tutorialAck:
self.notify.info('calling LocalAvatar.startchat') self.notify.info('calling LocalAvatar.startchat')
@ -938,8 +935,8 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.friendsListButtonObscured += increment self.friendsListButtonObscured += increment
self.refreshOnscreenButtons() self.refreshOnscreenButtons()
def obscureMoveFurnitureButton(self, increment): def obscureMoveFurnitureButton(self, obscured):
self.moveFurnitureButtonObscured += increment self.moveFurnitureButtonObscured = obscured
self.refreshOnscreenButtons() self.refreshOnscreenButtons()
def obscureClarabelleButton(self, increment): def obscureClarabelleButton(self, increment):
@ -974,7 +971,10 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
self.__catalogNotifyDialog = None self.__catalogNotifyDialog = None
else: else:
self.newCatalogNotify() 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: if self.furnitureManager != None and self.furnitureDirector == self.doId:
self.loadFurnitureGui() self.loadFurnitureGui()
self.__furnitureGui.setPos(0.155, -0.6, -1.045) self.__furnitureGui.setPos(0.155, -0.6, -1.045)

View file

@ -864,7 +864,8 @@ NPCToonDict = {
11001: (11000, lnames[11001], 'r', 'm', 0, NPC_LAFF_RESTOCK), 11001: (11000, lnames[11001], 'r', 'm', 0, NPC_LAFF_RESTOCK),
12001: (12000, lnames[12001], '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), 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): if config.GetBool('want-new-toonhall', 1):

View file

@ -12,7 +12,7 @@ ToonFont = 'phase_3/models/fonts/ImpressBT.ttf'
SuitFont = 'phase_3/models/fonts/vtRemingtonPortable.ttf' SuitFont = 'phase_3/models/fonts/vtRemingtonPortable.ttf'
SignFont = 'phase_3/models/fonts/MickeyFont' SignFont = 'phase_3/models/fonts/MickeyFont'
MinnieFont = 'phase_3/models/fonts/MinnieFont' 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' BuildingNametagFont = 'phase_3/models/fonts/MickeyFont'
BuildingNametagShadow = None BuildingNametagShadow = None
NametagFonts = ( NametagFonts = (
@ -3978,7 +3978,6 @@ EmoteHappy = 'Happy'
EmoteSad = 'Sad' EmoteSad = 'Sad'
EmoteAnnoyed = 'Annoyed' EmoteAnnoyed = 'Annoyed'
EmoteSleep = 'Sleepy' EmoteSleep = 'Sleepy'
StatPageTitle = 'Statistics'
SuitBaseNameWithLevel = '%(name)s\n%(dept)s\nLevel %(level)s' SuitBaseNameWithLevel = '%(name)s\n%(dept)s\nLevel %(level)s'
HealthForceAcknowledgeMessage = 'You cannot leave the playground until your Laff meter is smiling!' HealthForceAcknowledgeMessage = 'You cannot leave the playground until your Laff meter is smiling!'
InventoryTotalGags = 'Total gags\n%d / %d' InventoryTotalGags = 'Total gags\n%d / %d'
@ -3987,7 +3986,6 @@ InventoryPinkSlip = '1 Pink Slip'
InventoryCrateKeys = '%s Crate Keys' InventoryCrateKeys = '%s Crate Keys'
InventoryCrateKey = '1 Crate Key' InventoryCrateKey = '1 Crate Key'
InventoryDelete = 'DELETE' InventoryDelete = 'DELETE'
InventoryDeleteAll = 'DELETE ALL'
InventoryDone = 'DONE' InventoryDone = 'DONE'
InventoryDeleteHelp = 'Click on a gag to DELETE it.' InventoryDeleteHelp = 'Click on a gag to DELETE it.'
InventorySkillCredit = 'Skill credit: %s' InventorySkillCredit = 'Skill credit: %s'
@ -6272,7 +6270,8 @@ NPCToonNames = {20000: 'Tutorial Tom',
11001: 'Healer Gabriel', 11001: 'Healer Gabriel',
12001: 'Healer Bill', 12001: 'Healer Bill',
12002: 'Mata Hairy', 12002: 'Mata Hairy',
13001: 'Healer Clover'} 13001: 'Healer Clover',
13002: 'Bumpy Bumblebehr'}
zone2TitleDict = {2513: ('Toon Hall', ''), zone2TitleDict = {2513: ('Toon Hall', ''),
2514: ('Toontown Bank', ''), 2514: ('Toontown Bank', ''),
2516: ('Toontown School House', ''), 2516: ('Toontown School House', ''),
@ -7596,7 +7595,6 @@ LawbotBossTaunts = ['%s, I find you in contempt of court!',
'Strike that from the record.', 'Strike that from the record.',
'Your appeal has been rejected. I sentence you to sadness!', 'Your appeal has been rejected. I sentence you to sadness!',
'Order in the court!'] '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." 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.' WitnessToonNoJuror = 'Oh oh, no Toon jurors. This will be a tough trial.'
WitnessToonOneJuror = 'Cool! There is 1 Toon in the jury!' WitnessToonOneJuror = 'Cool! There is 1 Toon in the jury!'
@ -8530,9 +8528,12 @@ def convertSecondsToDate(seconds):
return '%d:%02d:%02d' % (h, m, s) return '%d:%02d:%02d' % (h, m, s)
ToonDefeatedMessage = '%s was defeated!' ToonDefeatedMessage = '%s was defeated!'
BugReportButton = 'Report a Bug' 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?' 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!' CodeRedemptionWarning = 'NOTICE: All codes can only be entered once!'
CogInterfaceLabelOn = 'The cog battle interface is on.' CogInterfaceLabelOn = 'The cog battle interface is on.'
CogInterfaceLabelOff = 'The cog battle interface is off.' CogInterfaceLabelOff = 'The cog battle interface is off.'
TpTransitionLabelOn = 'The teleport transition is on.' TpTransitionLabelOn = 'The teleport transition is on.'
@ -8540,6 +8541,7 @@ TpTransitionLabelOff = 'The teleport transition is off.'
FieldOfViewLabel = 'Field of View:' FieldOfViewLabel = 'Field of View:'
NametagStyleLabel = 'Nametag Style:' NametagStyleLabel = 'Nametag Style:'
FishingPoleLabel = 'Fishing Rod:' FishingPoleLabel = 'Fishing Rod:'
BossLocations = { BossLocations = {
'c': 'Bossbot Clubhouse\nBanquet', 'c': 'Bossbot Clubhouse\nBanquet',
'l': "Lawbot Courthouse\nBumpy Bumblebehr's Trial", '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!' CrateAccessoryPrize = 'Congratulations! You found a new accessory for your Toon. Check your mailbox and rock it!'
Stats = [ Stats = [
'Cogs defeated: %(cog)s', 'Cogs defeated: %s',
'V2.0 cogs defeated: %(v2)s', 'V2.0 cogs defeated: %s',
'Skelecogs defeated: %(skele)s', 'Skelecogs defeated: %s',
'Jellybeans spent: %(beanSpent)s', 'Jellybeans spent: %s',
'Jellybeans earnt: %(beanEarnt)s', 'Jellybeans earnt: %s',
'Tasks completed: %(task)s', 'Tasks completed: %s',
'Total VP defeats: %(vp)s', 'Total VP defeats: %s',
'Total CFO defeats: %(cfo)s', 'Total CFO defeats: %s',
'Total CJ defeats: %(cj)s', 'Total CJ defeats: %s',
'Total CEO defeats: %(ceo)s', 'Total CEO defeats: %s',
'Gone sad: %(sad)s times', 'Gone sad: %s times',
'Buildings liberated: %(bldg)s', 'Buildings liberated: %s',
'Field Offices defeated: %(cogdo)s', 'Offices defeated: %s',
'Items purchased: %(item)s', 'Items ordered: %s',
'Fish caught: %(fish)s', 'Fish caught: %s',
'Flowers picked: %(flower)s', 'Flowers picked: %s',
'Races completed: %(race)s', 'Races completed: %s',
'Golf holes played: %(golf)s', 'Golf holes played: %s',
'Total SOS cards: %(sos)s', 'Total SOS cards: %s',
'Total unites: %(unite)s', 'Total unites: %s',
'Total pink slips: %(slip)s', 'Total pink slips: %s',
'Total gags used: %(gag)s' 'Total gags used: %s'
] ]
StatResetAsk = 'Are you sure you want to reset your stats? This is an irreversible action!' StatPageTitle = 'Statistics'
StatResetDone = 'Your stats have been reset.' 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?' ChairAskToUse = 'Would you like to sit on this chair?'
@ -8727,6 +8731,9 @@ ShardPageShardTitle = '%s Population: %s'
ShardPageTeleport = 'Teleport to\n%s' ShardPageTeleport = 'Teleport to\n%s'
TeleportButton = 'Teleport' 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' BattleCogPopup = '\x01androidGreen\x01Group attacks:\x02\n%s\n\n\x01androidGreen\x01Regular attacks:\x02\n%s'
BattleCogPopupAttack = '%s %s HP' BattleCogPopupAttack = '%s %s HP'
@ -8749,6 +8756,14 @@ TeleportLabelOn = 'Accepting teleports.'
TeleportLabelOff = 'Not accepting teleports.' TeleportLabelOff = 'Not accepting teleports.'
TeleportPanelNoTeleport = '%s needs some time alone right now.' 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 = [ Blacklist = [
"$1ut", "$1ut",
"$h1t", "$h1t",

View file

@ -298,3 +298,33 @@ SellbotFactoryPosPart1 = (0, -0.25)
SellbotFactoryScalePart1 = 0.075 SellbotFactoryScalePart1 = 0.075
SellbotFactoryPosPart2 = (0, -0.34) SellbotFactoryPosPart2 = (0, -0.34)
SellbotFactoryScalePart2 = 0.12 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
}
}

View file

@ -2,8 +2,6 @@ import TTLocalizer
from otp.otpbase.OTPGlobals import * from otp.otpbase.OTPGlobals import *
from direct.showbase.PythonUtil import Enum, invertDict from direct.showbase.PythonUtil import Enum, invertDict
from pandac.PandaModules import BitMask32, Vec4 from pandac.PandaModules import BitMask32, Vec4
MapHotkeyOn = 'alt'
MapHotkeyOff = 'alt-up'
MapHotkey = 'alt' MapHotkey = 'alt'
CogHQCameraFov = 60.0 CogHQCameraFov = 60.0
BossBattleCameraFov = 72.0 BossBattleCameraFov = 72.0
@ -1691,3 +1689,16 @@ COLOR_SATURATION_MIN = 0.5
COLOR_SATURATION_MAX = 0.8 COLOR_SATURATION_MAX = 0.8
COLOR_VALUE_MIN = 0.5 COLOR_VALUE_MIN = 0.5
COLOR_VALUE_MAX = 0.8 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)

View file

@ -116,6 +116,8 @@ if 'fov' not in settings:
settings['fov'] = OTPGlobals.DefaultCameraFov settings['fov'] = OTPGlobals.DefaultCameraFov
if 'talk2speech' not in settings: if 'talk2speech' not in settings:
settings['talk2speech'] = False settings['talk2speech'] = False
if 'fpsMeter' not in settings:
settings['fpsMeter'] = False
loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings['res'])) loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings['res']))
loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen']) loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen'])
@ -189,6 +191,7 @@ cr = ToontownClientRepository.ToontownClientRepository(serverVersion)
cr.music = music cr.music = music
del music del music
base.initNametagGlobals() base.initNametagGlobals()
base.setFrameRateMeter(settings['fpsMeter'])
base.cr = cr base.cr = cr
loader.endBulkLoad('init') loader.endBulkLoad('init')
from otp.friends import FriendManager from otp.friends import FriendManager

View file

@ -14,9 +14,8 @@ import TownBattleCogPanel
from toontown.toontowngui import TTDialog from toontown.toontowngui import TTDialog
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from toontown.battle import BattleBase from toontown.battle import BattleBase
from toontown.toonbase import ToontownTimer
from direct.showbase import PythonUtil from direct.showbase import PythonUtil
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer, ToontownGlobals, ToontownTimer
from toontown.pets import PetConstants from toontown.pets import PetConstants
from direct.gui.DirectGui import * from direct.gui.DirectGui import *
from toontown.battle import FireCogPanel from toontown.battle import FireCogPanel
@ -43,10 +42,7 @@ class TownBattle(StateData.StateData):
self.track = -1 self.track = -1
self.level = -1 self.level = -1
self.target = 0 self.target = 0
self.toonAttacks = [(-1, 0, 0), self.toonAttacks = [(-1, 0, 0)] * 4
(-1, 0, 0),
(-1, 0, 0),
(-1, 0, 0)]
self.fsm = ClassicFSM.ClassicFSM('TownBattle', [ self.fsm = ClassicFSM.ClassicFSM('TownBattle', [
State.State('Off', State.State('Off',
self.enterOff, 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 = 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.setBin('gui-popup', 0)
self.rolloverFrame.hide() 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.toonPanels = [TownBattleToonPanel.TownBattleToonPanel(self) for i in xrange(4)]
self.cogPanels = [TownBattleCogPanel.TownBattleCogPanel(self) for i in xrange(4)] self.cogPanels = [TownBattleCogPanel.TownBattleCogPanel(self) for i in xrange(4)]
self.timer = ToontownTimer.ToontownTimer() self.timer = ToontownTimer.ToontownTimer()
@ -154,6 +152,8 @@ class TownBattle(StateData.StateData):
del self.toonPanels del self.toonPanels
del self.cogPanels del self.cogPanels
self.timer.destroy() self.timer.destroy()
self.suitGui.removeNode()
del self.suitGui
del self.timer del self.timer
del self.toons del self.toons
@ -219,11 +219,22 @@ class TownBattle(StateData.StateData):
self.timer.setTime(time) self.timer.setTime(time)
return None return None
def showRolloverFrame(self, parent, scale, textPos, color, pos, text, extra=None): def showRolloverFrame(self, parent, type, text, extra=None):
self.rolloverFrame['geom_scale'] = scale dict = TTLocalizer.BattleHoverAttributes[type]
self.rolloverFrame['text_pos'] = textPos
self.rolloverFrame['geom_color'] = color for key, value in dict.iteritems():
self.rolloverFrame.setPos(pos) 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.reparentTo(parent)
self.rolloverFrame.show() self.rolloverFrame.show()
self.rolloverFrame['text'] = text self.rolloverFrame['text'] = text
@ -314,20 +325,14 @@ class TownBattle(StateData.StateData):
def enterOff(self): def enterOff(self):
if self.isLoaded: if self.isLoaded:
for toonPanel in self.toonPanels: for panel in self.toonPanels + self.cogPanels:
toonPanel.hide() panel.hide()
for cogPanel in self.cogPanels: self.toonAttacks = [(-1, 0, 0)] * 4
cogPanel.hide()
self.toonAttacks = [(-1, 0, 0),
(-1, 0, 0),
(-1, 0, 0),
(-1, 0, 0)]
self.target = 0 self.target = 0
if hasattr(self, 'timer'): if hasattr(self, 'timer'):
self.timer.hide() self.timer.hide()
return None
def exitOff(self): def exitOff(self):
if self.isLoaded: if self.isLoaded:
@ -338,17 +343,14 @@ class TownBattle(StateData.StateData):
self.track = -1 self.track = -1
self.level = -1 self.level = -1
self.target = 0 self.target = 0
return None
def enterAttack(self): def enterAttack(self):
self.attackPanel.enter() self.attackPanel.enter()
self.accept(self.attackPanelDoneEvent, self.__handleAttackPanelDone) self.accept(self.attackPanelDoneEvent, self.__handleAttackPanelDone)
return None
def exitAttack(self): def exitAttack(self):
self.ignore(self.attackPanelDoneEvent) self.ignore(self.attackPanelDoneEvent)
self.attackPanel.exit() self.attackPanel.exit()
return None
def __handleAttackPanelDone(self, doneStatus): def __handleAttackPanelDone(self, doneStatus):
self.notify.debug('doneStatus: %s' % 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() numCogs: %s self.numCogs: %s' % (numCogs, self.numCogs))
self.notify.debug('adjustCogsAndToons() luredIndices: %s self.luredIndices: %s' % (luredIndices, self.luredIndices)) self.notify.debug('adjustCogsAndToons() luredIndices: %s self.luredIndices: %s' % (luredIndices, self.luredIndices))
self.notify.debug('adjustCogsAndToons() trappedIndices: %s self.trappedIndices: %s' % (trappedIndices, self.trappedIndices)) 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)) self.notify.debug('adjustCogsAndToons() toonIds: %s self.toons: %s' % (toonIds, self.toons))
maxSuitLevel = 0 maxSuitLevel = 0
for cog in cogs: for cog in cogs:
@ -459,16 +461,17 @@ class TownBattle(StateData.StateData):
self.localNum = toons.index(base.localAvatar) self.localNum = toons.index(base.localAvatar)
currStateName = self.fsm.getCurrentState().getName() 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: if resetActivateMode:
self.__enterPanels(self.numToons, self.localNum) self.__enterPanels(self.numToons, self.localNum)
for i in xrange(len(toons)): for i in xrange(len(toons)):
self.toonPanels[i].setLaffMeter(toons[i]) 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': if currStateName == 'ChooseCog':
self.chooseCogPanel.adjustCogs(self.numCogs, self.luredIndices, self.trappedIndices, self.track) self.chooseCogPanel.adjustCogs(self.numCogs, self.luredIndices, self.trappedIndices, self.track)
elif currStateName == 'ChooseToon': elif currStateName == 'ChooseToon':
@ -481,12 +484,10 @@ class TownBattle(StateData.StateData):
self.cog = 0 self.cog = 0
self.chooseCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track) self.chooseCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track)
self.accept(self.chooseCogPanelDoneEvent, self.__handleChooseCogPanelDone) self.accept(self.chooseCogPanelDoneEvent, self.__handleChooseCogPanelDone)
return None
def exitChooseCog(self): def exitChooseCog(self):
self.ignore(self.chooseCogPanelDoneEvent) self.ignore(self.chooseCogPanelDoneEvent)
self.chooseCogPanel.exit() self.chooseCogPanel.exit()
return None
def __handleChooseCogPanelDone(self, doneStatus): def __handleChooseCogPanelDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -534,12 +535,10 @@ class TownBattle(StateData.StateData):
self.toon = 0 self.toon = 0
self.chooseToonPanel.enter(self.numToons, localNum=self.localNum) self.chooseToonPanel.enter(self.numToons, localNum=self.localNum)
self.accept(self.chooseToonPanelDoneEvent, self.__handleChooseToonPanelDone) self.accept(self.chooseToonPanelDoneEvent, self.__handleChooseToonPanelDone)
return None
def exitChooseToon(self): def exitChooseToon(self):
self.ignore(self.chooseToonPanelDoneEvent) self.ignore(self.chooseToonPanelDoneEvent)
self.chooseToonPanel.exit() self.chooseToonPanel.exit()
return None
def __handleChooseToonPanelDone(self, doneStatus): def __handleChooseToonPanelDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -576,12 +575,10 @@ class TownBattle(StateData.StateData):
canHeal, canTrap, canLure = self.checkHealTrapLure() canHeal, canTrap, canLure = self.checkHealTrapLure()
self.FireCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track) self.FireCogPanel.enter(self.numCogs, luredIndices=self.luredIndices, trappedIndices=self.trappedIndices, track=self.track)
self.accept(self.fireCogPanelDoneEvent, self.__handleCogFireDone) self.accept(self.fireCogPanelDoneEvent, self.__handleCogFireDone)
return None
def exitFire(self): def exitFire(self):
self.ignore(self.fireCogPanelDoneEvent) self.ignore(self.fireCogPanelDoneEvent)
self.FireCogPanel.exit() self.FireCogPanel.exit()
return None
def __handleCogFireDone(self, doneStatus): def __handleCogFireDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -602,12 +599,10 @@ class TownBattle(StateData.StateData):
canHeal, canTrap, canLure = self.checkHealTrapLure() canHeal, canTrap, canLure = self.checkHealTrapLure()
self.SOSPanel.enter(canLure, canTrap) self.SOSPanel.enter(canLure, canTrap)
self.accept(self.SOSPanelDoneEvent, self.__handleSOSPanelDone) self.accept(self.SOSPanelDoneEvent, self.__handleSOSPanelDone)
return None
def exitSOS(self): def exitSOS(self):
self.ignore(self.SOSPanelDoneEvent) self.ignore(self.SOSPanelDoneEvent)
self.SOSPanel.exit() self.SOSPanel.exit()
return None
def __handleSOSPanelDone(self, doneStatus): def __handleSOSPanelDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -641,13 +636,11 @@ class TownBattle(StateData.StateData):
self.accept(self.proxyGenerateMessage, self.__handleProxyGenerated) self.accept(self.proxyGenerateMessage, self.__handleProxyGenerated)
self.accept(self.SOSPetSearchPanelDoneEvent, self.__handleSOSPetSearchPanelDone) self.accept(self.SOSPetSearchPanelDoneEvent, self.__handleSOSPetSearchPanelDone)
messenger.send(self.battleEvent, [response]) messenger.send(self.battleEvent, [response])
return None
def exitSOSPetSearch(self): def exitSOSPetSearch(self):
self.ignore(self.proxyGenerateMessage) self.ignore(self.proxyGenerateMessage)
self.ignore(self.SOSPetSearchPanelDoneEvent) self.ignore(self.SOSPetSearchPanelDoneEvent)
self.SOSPetSearchPanel.exit() self.SOSPetSearchPanel.exit()
return None
def __handleSOSPetSearchPanelDone(self, doneStatus): def __handleSOSPetSearchPanelDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -662,12 +655,10 @@ class TownBattle(StateData.StateData):
def enterSOSPetInfo(self): def enterSOSPetInfo(self):
self.SOSPetInfoPanel.enter(self.petId) self.SOSPetInfoPanel.enter(self.petId)
self.accept(self.SOSPetInfoPanelDoneEvent, self.__handleSOSPetInfoPanelDone) self.accept(self.SOSPetInfoPanelDoneEvent, self.__handleSOSPetInfoPanelDone)
return None
def exitSOSPetInfo(self): def exitSOSPetInfo(self):
self.ignore(self.SOSPetInfoPanelDoneEvent) self.ignore(self.SOSPetInfoPanelDoneEvent)
self.SOSPetInfoPanel.exit() self.SOSPetInfoPanel.exit()
return None
def __handleSOSPetInfoPanelDone(self, doneStatus): def __handleSOSPetInfoPanelDone(self, doneStatus):
mode = doneStatus['mode'] mode = doneStatus['mode']
@ -683,15 +674,10 @@ class TownBattle(StateData.StateData):
self.fsm.request('SOS') self.fsm.request('SOS')
def __isCogChoiceNecessary(self): def __isCogChoiceNecessary(self):
if self.numCogs > 1 and not self.__isGroupAttack(self.track, self.level): return self.numCogs > 1 and not self.__isGroupAttack(self.track, self.level)
return 1
else:
return 0
def __isGroupAttack(self, trackNum, levelNum): def __isGroupAttack(self, trackNum, levelNum):
retval = BattleBase.attackAffectsGroup(trackNum, levelNum) return BattleBase.attackAffectsGroup(trackNum, levelNum)
return retval
def __isGroupHeal(self, levelNum): def __isGroupHeal(self, levelNum):
retval = BattleBase.attackAffectsGroup(HEAL_TRACK, levelNum) return self.__isGroupAttack(HEAL_TRACK, levelNum)
return retval

View file

@ -23,7 +23,6 @@ class TownBattleCogPanel(DirectFrame):
gui.removeNode() gui.removeNode()
def cleanup(self): def cleanup(self):
self.ignoreAll()
self.cleanupHead() self.cleanupHead()
self.levelText.removeNode() self.levelText.removeNode()
self.typeText.removeNode() self.typeText.removeNode()
@ -42,17 +41,14 @@ class TownBattleCogPanel(DirectFrame):
def setSuit(self, suit): def setSuit(self, suit):
if self.suit == suit: if self.suit == suit:
messenger.send(self.suit.uniqueName('hpChange'))
return return
self.ignoreAll()
self.cleanupHead() self.cleanupHead()
self.suit = suit self.suit = suit
self.generateSuitHead(suit.getStyleName()) self.generateSuitHead(suit.getStyleName())
self.updateHealthBar() self.updateHealthBar()
self.levelText['text'] = TTLocalizer.CogPanelLevel % suit.getActualLevel() self.levelText['text'] = TTLocalizer.CogPanelLevel % suit.getActualLevel()
self.typeText['text'] = suit.getTypeText() self.typeText['text'] = suit.getTypeText()
self.accept(suit.uniqueName('hpChange'), self.updateHealthBar)
self.updateRolloverBind() self.updateRolloverBind()
def updateRolloverBind(self): def updateRolloverBind(self):
@ -67,7 +63,7 @@ class TownBattleCogPanel(DirectFrame):
if TTLocalizer.BattleCogPopupDangerColor in info: if TTLocalizer.BattleCogPopupDangerColor in info:
info = TTLocalizer.BattleCogPopupDanger + 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): def getAttackStrings(self, attacks, level):
attackStrings = [] attackStrings = []

View file

@ -24,8 +24,6 @@ class TownBattleToonPanel(DirectFrame):
self.sosText.hide() 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 = DirectLabel(parent=self, relief=None, pos=(0.1, 0, 0.015), text=TTLocalizer.TownBattleToonFire, text_scale=0.06)
self.fireText.hide() 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.sosHead = None
self.undecidedText = DirectLabel(parent=self, relief=None, pos=(0.1, 0, 0.015), text=TTLocalizer.TownBattleUndecided, text_scale=0.1) 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) 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) passGui.reparentTo(self.passNode)
self.passNode.hide() self.passNode.hide()
self.laffMeter = None 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 = 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.setTransparency(True)
self.hoverButton.bind(DGG.EXIT, self.battle.hideRolloverFrame) self.hoverButton.bind(DGG.EXIT, self.battle.hideRolloverFrame)
@ -102,14 +100,11 @@ class TownBattleToonPanel(DirectFrame):
self.undecidedText.hide() self.undecidedText.hide()
self.sosText.hide() self.sosText.hide()
self.fireText.hide() self.fireText.hide()
self.roundsText.hide()
self.gagNode.hide() self.gagNode.hide()
self.whichText.hide() self.whichText.hide()
self.passNode.hide() self.passNode.hide()
self.cleanupSosHead() self.cleanupSosHead()
self.hoverButton.unbind(DGG.ENTER) self.hoverButton.unbind(DGG.ENTER)
self.whichText.setPos(0.1, 0, -0.08)
self.whichText['text_scale'] = 0.05
if self.hasGag: if self.hasGag:
self.gag.removeNode() self.gag.removeNode()
self.hasGag = 0 self.hasGag = 0
@ -141,7 +136,7 @@ class TownBattleToonPanel(DirectFrame):
sosType = TextEncoder.upper(sosType) sosType = TextEncoder.upper(sosType)
count = max(0, self.avatar.getNPCFriendCount(targetIndex) - 1) count = max(0, self.avatar.getNPCFriendCount(targetIndex) - 1)
info = TTLocalizer.BattleSOSPopup % (sosType, NPCToons.getNPCName(targetIndex), hpString if hp else '', rarity, count) 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: elif track == BattleBase.SOS or track == BattleBase.PETSOS:
self.sosText.show() self.sosText.show()
elif track >= MIN_TRACK_INDEX and track <= MAX_TRACK_INDEX: elif track >= MIN_TRACK_INDEX and track <= MAX_TRACK_INDEX:
@ -159,24 +154,13 @@ class TownBattleToonPanel(DirectFrame):
damage = int(getAvPropDamage(track, level, curExp, organic)) damage = int(getAvPropDamage(track, level, curExp, organic))
numItems = max(0, self.avatar.inventory.numItem(track, level) - 1) numItems = max(0, self.avatar.inventory.numItem(track, level) - 1)
info = TTLocalizer.BattleGagPopup % (self.avatar.inventory.getToonupDmgStr(track, 0), damage, numItems) 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): if self.avatar.checkGagBonus(track, level):
self.gag.setColor((1, 0, 0, 1) if track == 1 and level == 5 else (0, 1, 0, 1)) 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: if numTargets is not None and targetIndex is not None and localNum is not None:
self.whichText.show() self.whichText.show()
self.whichText['text'] = self.determineWhichText(numTargets, targetIndex, localNum, index) 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: else:
self.notify.error('Bad track value: %s' % track) self.notify.error('Bad track value: %s' % track)
@ -184,6 +168,7 @@ class TownBattleToonPanel(DirectFrame):
returnStr = '' returnStr = ''
targetList = range(numTargets) targetList = range(numTargets)
targetList.reverse() targetList.reverse()
for i in targetList: for i in targetList:
if targetIndex == -1: if targetIndex == -1:
returnStr += 'X' returnStr += 'X'
@ -221,9 +206,8 @@ class TownBattleToonPanel(DirectFrame):
self.sosHead = None self.sosHead = None
def cleanupLaffMeter(self): def cleanupLaffMeter(self):
self.notify.debug('Cleaning up laffmeter!')
self.ignore(self.hpChangeEvent) self.ignore(self.hpChangeEvent)
if self.laffMeter: if self.laffMeter:
self.laffMeter.destroy() self.laffMeter.destroy()
self.laffMeter = None self.laffMeter = None
return

View file

@ -19,4 +19,4 @@ class TutorialStreet(TTStreet.TTStreet):
TTStreet.TTStreet.handleEnterTunnel(self, requestStatus, collEntry) TTStreet.TTStreet.handleEnterTunnel(self, requestStatus, collEntry)
def exitDoorIn(self): def exitDoorIn(self):
base.localAvatar.obscureMoveFurnitureButton(-1) base.localAvatar.obscureMoveFurnitureButton(0)