Some phase_3 cleanup

This commit is contained in:
Daniel 2015-03-09 22:47:59 +02:00
parent 26c85cdded
commit 876868179c
37 changed files with 80 additions and 759 deletions

View file

@ -47,7 +47,6 @@ class ChatManager(DirectObject.DirectObject):
self.__normalObscured = 0
self.openChatWarning = None
self.unpaidChatWarning = None
self.teaser = None
self.paidNoParentPassword = None
self.noSecretChatAtAll = None
self.noSecretChatAtAllAndNoWhitelist = None
@ -80,8 +79,7 @@ class ChatManager(DirectObject.DirectObject):
State.State('problemActivatingChat', self.enterProblemActivatingChat, self.exitProblemActivatingChat),
State.State('whiteListOpenChat', self.enterWhiteListOpenChat, self.exitWhiteListOpenChat),
State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat),
State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat),
State.State('trueFriendTeaserPanel', self.enterTrueFriendTeaserPanel, self.exitTrueFriendTeaserPanel)], 'off', 'off')
State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat)], 'off', 'off')
self.fsm.enterInitialState()
return
@ -101,10 +99,6 @@ class ChatManager(DirectObject.DirectObject):
self.payButton = None
self.unpaidChatWarning.destroy()
self.unpaidChatWarning = None
if self.teaser:
self.teaser.cleanup()
self.teaser.unload()
self.teaser = None
if self.noSecretChatAtAll:
self.noSecretChatAtAll.destroy()
self.noSecretChatAtAll = None
@ -483,12 +477,6 @@ class ChatManager(DirectObject.DirectObject):
def exitProblemActivatingChat(self):
self.notify.error('called exitProblemActivatingChat() on parent class')
def enterTrueFriendTeaserPanel(self):
self.notify.error('called enterTrueFriendTeaserPanel () on parent class')
def exitTrueFriendTeaserPanel(self):
self.notify.error('called exitTrueFriendTeaserPanel () on parent class')
def __secretFriendsInfoDone(self):
self.fsm.request('activateChat')

View file

@ -14,10 +14,7 @@ BothSecrets = 2
def showFriendSecret(secretType = AvatarSecret):
global globalFriendSecret
if not base.cr.isPaid():
chatMgr = base.localAvatar.chatMgr
chatMgr.fsm.request('trueFriendTeaserPanel')
elif not base.cr.isParentPasswordSet():
if not base.cr.isParentPasswordSet():
chatMgr = base.localAvatar.chatMgr
if base.cr.productName in ['DisneyOnline-AP',
'DisneyOnline-UK',

View file

@ -15,7 +15,6 @@ from toontown.toon import GroupPanel
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
from toontown.toontowngui import TeaserPanel
class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPartyBase.BoardingPartyBase):
@ -410,38 +409,25 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
self.notify.debug('requestInvite %s' % inviteeId)
elevator = base.cr.doId2do.get(self.getElevatorIdList()[0])
if elevator:
if elevator.allowedToEnter(self.zoneId):
if inviteeId in self.getGroupKickList(localAvatar.doId):
if not self.isGroupLeader(localAvatar.doId):
avatar = base.cr.doId2do.get(inviteeId)
if avatar:
avatarNameText = avatar.name
else:
avatarNameText = ''
rejectText = TTLocalizer.BoardingInviteeInKickOutList % avatarNameText
self.showMe(rejectText)
return
if self.inviterPanels.isInvitingPanelUp():
self.showMe(TTLocalizer.BoardingPendingInvite, pos=(0, 0, 0))
elif len(self.getGroupMemberList(localAvatar.doId)) >= self.maxSize:
self.showMe(TTLocalizer.BoardingInviteGroupFull)
else:
invitee = base.cr.doId2do.get(inviteeId)
if invitee:
self.inviterPanels.createInvitingPanel(self, inviteeId)
self.sendUpdate('requestInvite', [inviteeId])
if inviteeId in self.getGroupKickList(localAvatar.doId):
if not self.isGroupLeader(localAvatar.doId):
avatar = base.cr.doId2do.get(inviteeId)
if avatar:
avatarNameText = avatar.name
else:
avatarNameText = ''
rejectText = TTLocalizer.BoardingInviteeInKickOutList % avatarNameText
self.showMe(rejectText)
return
if self.inviterPanels.isInvitingPanelUp():
self.showMe(TTLocalizer.BoardingPendingInvite, pos=(0, 0, 0))
elif len(self.getGroupMemberList(localAvatar.doId)) >= self.maxSize:
self.showMe(TTLocalizer.BoardingInviteGroupFull)
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.teaserDialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
def handleOkTeaser(self):
self.teaserDialog.destroy()
del self.teaserDialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
invitee = base.cr.doId2do.get(inviteeId)
if invitee:
self.inviterPanels.createInvitingPanel(self, inviteeId)
self.sendUpdate('requestInvite', [inviteeId])
def requestCancelInvite(self, inviteeId):
self.sendUpdate('requestCancelInvite', [inviteeId])

View file

@ -13,7 +13,6 @@ from toontown.hood import ZoneUtil
from toontown.suit import Suit
from toontown.toonbase.ToonBaseGlobal import *
from toontown.toontowngui import TTDialog
from toontown.toontowngui import TeaserPanel
from toontown.nametag.NametagGroup import NametagGroup
from toontown.nametag.Nametag import Nametag
@ -312,33 +311,8 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
return yToTest
def enterDoor(self):
if self.allowedToEnter():
messenger.send('DistributedDoor_doorTrigger')
self.sendUpdate('requestEnter')
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName = 'otherHoods', doneFunc = self.handleOkTeaser)
def handleOkTeaser(self):
self.accept(self.getEnterTriggerEvent(), self.doorTrigger)
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def allowedToEnter(self):
if base.cr.isPaid():
return True
place = base.cr.playGame.getPlace()
myHoodId = ZoneUtil.getCanonicalHoodId(place.zoneId)
if hasattr(place, 'id'):
myHoodId = place.id
if myHoodId in (ToontownGlobals.ToontownCentral, ToontownGlobals.MyEstate, ToontownGlobals.GoofySpeedway, ToontownGlobals.Tutorial):
return True
return False
messenger.send('DistributedDoor_doorTrigger')
self.sendUpdate('requestEnter')
def checkIsDoorHitTaskName(self):
return 'checkIsDoorHit' + self.getTriggerName()

View file

@ -12,7 +12,6 @@ from toontown.toonbase import TTLocalizer, ToontownGlobals
from direct.task.Task import Task
from toontown.distributed import DelayDelete
from toontown.hood import ZoneUtil
from toontown.toontowngui import TeaserPanel
from toontown.building import BoardingGroupShow
class DistributedElevator(DistributedObject.DistributedObject):
@ -332,36 +331,14 @@ class DistributedElevator(DistributedObject.DistributedObject):
self.notify.warning('toon: ' + str(avId) + " doesn't exist, and" + ' cannot exit the elevator!')
return
def allowedToEnter(self, zoneId = None):
allowed = False
if hasattr(base, 'ttAccess') and base.ttAccess:
if zoneId:
allowed = base.ttAccess.canAccess(zoneId)
else:
allowed = base.ttAccess.canAccess()
return allowed
def handleEnterSphere(self, collEntry):
self.notify.debug('Entering Elevator Sphere....')
if self.allowedToEnter(self.zoneId):
if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId:
self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE)
elif base.localAvatar.hp > 0:
self.cr.playGame.getPlace().detectedElevatorCollision(self)
toon = base.localAvatar
self.sendUpdate('requestBoard', [])
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId:
self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE)
elif base.localAvatar.hp > 0:
self.cr.playGame.getPlace().detectedElevatorCollision(self)
toon = base.localAvatar
self.sendUpdate('requestBoard', [])
def rejectBoard(self, avId, reason = 0):
if hasattr(base.localAvatar, 'elevatorNotifier'):

View file

@ -14,8 +14,6 @@ from toontown.nametag.Nametag import Nametag
from toontown.nametag.NametagGroup import NametagGroup
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TeaserPanel
class DistributedElevatorExt(DistributedElevator.DistributedElevator):
@ -97,13 +95,8 @@ class DistributedElevatorExt(DistributedElevator.DistributedElevator):
self.notify.debug('Entering Elevator Sphere....')
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId) and localAvatar.boardingParty.getGroupLeader(localAvatar.doId) != localAvatar.doId:
base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorGroupMember)
elif self.allowedToEnter(self.zoneId):
self.cr.playGame.getPlace().detectedElevatorCollision(self)
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
self.cr.playGame.getPlace().detectedElevatorCollision(self)
def handleEnterElevator(self):
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId):

View file

@ -11,7 +11,6 @@ from CatalogMouldingItem import getAllMouldings
from CatalogWainscotingItem import getAllWainscotings
from CatalogFurnitureItem import getAllFurnitures
from CatalogFurnitureItem import FLTrunk
from toontown.toontowngui.TeaserPanel import TeaserPanel
from otp.otpbase import OTPGlobals
CATALOG_PANEL_WORDWRAP = 10
CATALOG_PANEL_CHAT_WORDWRAP = 9
@ -280,25 +279,9 @@ class CatalogItemPanel(DirectFrame):
self.unload()
return
def getTeaserPanel(self):
typeName = self['item'].getTypeName()
if typeName == TTLocalizer.EmoteTypeName or typeName == TTLocalizer.ChatTypeName:
page = 'emotions'
elif typeName == TTLocalizer.GardenTypeName or typeName == TTLocalizer.GardenStarterTypeName:
page = 'gardening'
else:
page = 'clothing'
def showTeaserPanel():
TeaserPanel(pageName=page)
return showTeaserPanel
def updateBuyButton(self):
if not self.loaded:
return
if not base.cr.isPaid():
self.buyButton['command'] = self.getTeaserPanel()
self.buyButton.show()
typeCode = self['item'].getTypeCode()
orderCount = base.localAvatar.onOrder.count(self['item'])
@ -469,8 +452,6 @@ class CatalogItemPanel(DirectFrame):
self.giftButton.show()
if giftUpdate == 0:
return
if not base.cr.isPaid():
self.giftButton['command'] = self.getTeaserPanel()
self.auxText['text'] = ' '
numFriends = len(base.localAvatar.friendsList) + len(base.cr.avList) - 1
if numFriends > 0:

View file

@ -8,7 +8,6 @@ from toontown.parties.PartyGlobals import InviteStatus
from toontown.parties.SimpleMailBase import SimpleMailBase
from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.toontowngui import TTDialog
from toontown.toontowngui.TeaserPanel import TeaserPanel
from toontown.parties.InviteVisual import InviteVisual
import CatalogItem
from direct.showbase.PythonUtil import StackTrace
@ -184,14 +183,11 @@ class MailboxScreen(DirectObject.DirectObject):
isAward = False
if isinstance(item, CatalogItem.CatalogItem):
isAward = item.isAward()
if not base.cr.isPaid() and not (isinstance(item, InviteInfoBase) or isAward):
TeaserPanel(pageName='clothing')
else:
self.acceptingIndex = self.itemIndex
self.acceptButton['state'] = DGG.DISABLED
self.__showCurrentItem()
item = self.items[self.itemIndex]
item.acceptItem(self.mailbox, self.acceptingIndex, self.__acceptItemCallback)
self.acceptingIndex = self.itemIndex
self.acceptButton['state'] = DGG.DISABLED
self.__showCurrentItem()
item = self.items[self.itemIndex]
item.acceptItem(self.mailbox, self.acceptingIndex, self.__acceptItemCallback)
return
def __handleDiscard(self, buttonValue = None):

View file

@ -4,7 +4,6 @@ from direct.showbase.PythonUtil import traceFunctionCall
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from pandac.PandaModules import *
@ -169,19 +168,6 @@ class ToontownChatManager(ChatManager.ChatManager):
self.payButton.hide()
else:
self.payButton.show()
if base.cr.productName not in ['ES',
'JP',
'DE',
'BR',
'FR']:
self.unpaidChatWarning.show()
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.teaser = TeaserPanel.TeaserPanel('secretChat', self.__handleUnpaidChatWarningDone)
if base.localAvatar.inTutorial:
self.teaser.hidePay()
normObs, scObs = self.isObscured()
if not scObs:
self.scButton.show()
@ -425,33 +411,6 @@ class ToontownChatManager(ChatManager.ChatManager):
def exitNoSecretChatAtAllAndNoWhitelist(self):
self.noSecretChatAtAllAndNoWhitelist.hide()
def enterTrueFriendTeaserPanel(self):
self.previousStateBeforeTeaser = None
place = base.cr.playGame.getPlace()
if place:
if place.fsm.hasStateNamed('stopped'):
self.previousStateBeforeTeaser = place.fsm.getCurrentState().getName()
place.fsm.request('stopped')
else:
self.notify.warning("Enter: %s has no 'stopped' state." % place)
self.teaser = TeaserPanel.TeaserPanel(pageName='secretChat', doneFunc=self.handleOkTeaser)
return
def exitTrueFriendTeaserPanel(self):
self.teaser.destroy()
place = base.cr.playGame.getPlace()
if place:
if place.fsm.hasStateNamed('stopped'):
if self.previousStateBeforeTeaser:
place.fsm.request(self.previousStateBeforeTeaser, force=1)
else:
place.fsm.request('walk')
else:
self.notify.warning("Exit: %s has no 'stopped' state." % place)
def handleOkTeaser(self):
self.fsm.request('mainMenu')
def __whisperScButtonPressed(self, avatarName, avatarId, playerId):
if base.config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: CHAT: Whisper')

View file

@ -8,7 +8,6 @@ from toontown.hood import ZoneUtil
from toontown.building import FADoorCodes
from toontown.building import DoorTypes
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
@ -81,14 +80,8 @@ class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
self.doorX = 1.0
def enterDoor(self):
if self.allowedToEnter():
messenger.send('DistributedDoor_doorTrigger')
self.sendUpdate('requestEnter')
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
messenger.send('DistributedDoor_doorTrigger')
self.sendUpdate('requestEnter')
def doorTrigger(self, args = None):
if localAvatar.hasActiveBoardingGroup():

View file

@ -208,7 +208,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.handler = self.handleMessageType
self.avChoiceDoneEvent = 'avatarChooserDone'
self.avChoice = AvatarChooser.AvatarChooser(avList, self.loginFSM, self.avChoiceDoneEvent)
self.avChoice.load(self.isPaid())
self.avChoice.load()
self.avChoice.enter()
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
return

View file

@ -4,7 +4,6 @@ from direct.directnotify import DirectNotifyGlobal
from direct.showbase import PythonUtil
from toontown.toonbase import ToontownBattleGlobals
from toontown.toontowngui import TTDialog
from toontown.toontowngui.TeaserPanel import TeaserPanel
from toontown.toonbase import TTLocalizer
import GardenGlobals
import HouseGlobals
@ -29,15 +28,11 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
self.needToLoad = 0
self.backupFruits = []
self.signHasBeenStuck2Ground = False
self._teaserPanel = None
self.setName('DistributedGagTree')
return
def delete(self):
DistributedPlantBase.DistributedPlantBase.delete(self)
if self._teaserPanel:
self._teaserPanel.destroy()
self._teaserPanel = None
del self.prop
del self.prop2
del self.dirtMound
@ -130,12 +125,8 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
def handlePicking(self):
messenger.send('wakeup')
if self.isFruiting() and self.canBeHarvested():
if self.velvetRoped():
self._teaserPanel = TeaserPanel(pageName='pickGags')
localAvatar._gagTreeVelvetRoped = None
else:
self.startInteraction()
self.doHarvesting()
self.startInteraction()
self.doHarvesting()
return
fullName = self.name
text = TTLocalizer.ConfirmRemoveTree % {'tree': fullName}
@ -355,10 +346,6 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
return Task.done
def canBeHarvested(self):
if not base.cr.isPaid():
if self.velvetRoped():
if hasattr(localAvatar, '_gagTreeVelvetRoped'):
return False
myTrack, myLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
levelsInTrack = []
levelTreeDict = {}
@ -406,14 +393,8 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
self.finishInteraction()
return
def velvetRoped(self):
return not base.cr.isPaid() and ToontownBattleGlobals.gagIsPaidOnly(self.gagTrack, self.gagLevel)
def allowedToPick(self):
retval = True
if self.velvetRoped():
retval = False
return retval
return True
def unlockPick(self):
retval = True

View file

@ -3,8 +3,6 @@ from direct.showbase.ShowBase import *
from toontown.toonbase import TTLocalizer
import string
from direct.fsm import StateData
from toontown.toonbase.ToontownBattleGlobals import gagIsPaidOnly
from toontown.toontowngui.TeaserPanel import TeaserPanel
class PlantTreeGUI(StateData.StateData):
notify = DirectNotifyGlobal.directNotify.newCategory('PlantTreeGUI')
@ -12,7 +10,6 @@ class PlantTreeGUI(StateData.StateData):
def __init__(self, doneEvent):
self.doneEvent = doneEvent
self.oldActivateMode = base.localAvatar.inventory.activateMode
self._teaserPanel = None
base.localAvatar.inventory.setActivateMode('plantTree')
base.localAvatar.inventory.show()
self.accept('inventory-selection', self.__handleInventory)
@ -24,15 +21,9 @@ class PlantTreeGUI(StateData.StateData):
self.ignore('inventory-pass')
base.localAvatar.inventory.setActivateMode(self.oldActivateMode)
base.localAvatar.inventory.hide()
if self._teaserPanel:
self._teaserPanel.destroy()
self._teaserPanel = None
return
def __handleInventory(self, track, level):
if gagIsPaidOnly(track, level) and not base.cr.isPaid():
self._teaserPanel = TeaserPanel('plantGags')
return
if base.localAvatar.inventory.numItem(track, level) > 0:
messenger.send(self.doneEvent, [True, track, level])
else:

View file

@ -2,7 +2,6 @@ from pandac.PandaModules import *
from toontown.toonbase import TTLocalizer
import ZoneUtil
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TeaserPanel
class TrialerForceAcknowledge:
@ -38,7 +37,6 @@ class TrialerForceAcknowledge:
doneStatus['mode'] = 'fail'
self.doneStatus = doneStatus
self.dialog = TeaserPanel.TeaserPanel(pageName='otherHoods', doneFunc=self.handleOk)
def exit(self):
if self.dialog:

View file

@ -7,7 +7,6 @@ from toontown.toontowngui import TTDialog
from direct.gui.DirectGui import *
from toontown.toonbase import TTLocalizer
from direct.directnotify import DirectNotifyGlobal
from toontown.toontowngui import TeaserPanel
NAME_ROTATIONS = (7, -11, 1, -5, 3.5, -5)
NAME_POSITIONS = ((0, 0, 0.26),
(-0.03, 0, 0.25),
@ -24,36 +23,25 @@ DELETE_POSITIONS = ((0.187, 0, -0.26),
class AvatarChoice(DirectButton):
notify = DirectNotifyGlobal.directNotify.newCategory('AvatarChoice')
NEW_TRIALER_OPEN_POS = (1,)
OLD_TRIALER_OPEN_POS = (1, 4)
MODE_CREATE = 0
MODE_CHOOSE = 1
MODE_LOCKED = 2
def __init__(self, av = None, position = 0, paid = 0, okToLockout = 1):
def __init__(self, av = None, position = 0):
DirectButton.__init__(self, relief=None, text='', text_font=ToontownGlobals.getSignFont())
self.initialiseoptions(AvatarChoice)
self.hasPaid = paid
self.mode = None
if base.restrictTrialers and okToLockout:
if position not in AvatarChoice.NEW_TRIALER_OPEN_POS:
if not self.hasPaid:
self.mode = AvatarChoice.MODE_LOCKED
self.name = ''
self.dna = None
if self.mode is not AvatarChoice.MODE_LOCKED:
if not av:
self.mode = AvatarChoice.MODE_CREATE
self.name = ''
self.dna = None
else:
self.mode = AvatarChoice.MODE_CHOOSE
self.name = av.name
self.dna = ToonDNA.ToonDNA(av.dna)
self.wantName = av.wantName
self.approvedName = av.approvedName
self.rejectedName = av.rejectedName
self.allowedName = av.allowedName
if not av:
self.mode = AvatarChoice.MODE_CREATE
self.name = ''
self.dna = None
else:
self.mode = AvatarChoice.MODE_CHOOSE
self.name = av.name
self.dna = ToonDNA.ToonDNA(av.dna)
self.wantName = av.wantName
self.approvedName = av.approvedName
self.rejectedName = av.rejectedName
self.allowedName = av.allowedName
self.position = position
self.doneEvent = 'avChoicePanel-' + str(self.position)
self.deleteWithPasswordFrame = None
@ -67,26 +55,7 @@ class AvatarChoice(DirectButton):
self.buttonBgs.append(self.pickAToonGui.find('**/tt_t_gui_pat_squareYellow'))
self['image'] = self.buttonBgs[position]
self.setScale(1.01)
if self.mode is AvatarChoice.MODE_LOCKED:
self['command'] = self.__handleTrialer
self['text'] = TTLocalizer.AvatarChoiceSubscribersOnly
self['text0_scale'] = 0.1
self['text1_scale'] = TTLocalizer.ACsubscribersOnly
self['text2_scale'] = TTLocalizer.ACsubscribersOnly
self['text0_fg'] = (0, 1, 0.8, 0.0)
self['text1_fg'] = (0, 1, 0.8, 1)
self['text2_fg'] = (0.3, 1, 0.9, 1)
self['text_pos'] = (0, 0.19)
upsellModel = loader.loadModel('phase_3/models/gui/tt_m_gui_ups_mainGui')
upsellTex = upsellModel.find('**/tt_t_gui_ups_logo_noBubbles')
self.logoModelImage = loader.loadModel('phase_3/models/gui/members_only_gui').find('**/MembersOnly')
logo = DirectFrame(state=DGG.DISABLED, parent=self, relief=None, image=upsellTex, image_scale=(0.9, 0, 0.9), image_pos=(0, 0, 0), scale=0.45)
logo.reparentTo(self.stateNodePath[0], 20)
logo.instanceTo(self.stateNodePath[1], 20)
logo.instanceTo(self.stateNodePath[2], 20)
self.logo = logo
upsellModel.removeNode()
elif self.mode is AvatarChoice.MODE_CREATE:
if self.mode is AvatarChoice.MODE_CREATE:
self['command'] = self.__handleCreate
self['text'] = (TTLocalizer.AvatarChoiceMakeAToon,)
self['text_pos'] = (0, 0)
@ -117,7 +86,7 @@ class AvatarChoice(DirectButton):
elif self.rejectedName != '':
self.nameYourToonButton.hide()
self.statusText['text'] = TTLocalizer.AvatarChoiceNameRejected
elif self.allowedName == 1 and (base.cr.allowFreeNames() or self.hasPaid):
elif self.allowedName == 1:
self.nameYourToonButton.show()
self.statusText['text'] = ''
else:
@ -152,7 +121,7 @@ class AvatarChoice(DirectButton):
self.pickAToonGui.removeNode()
del self.pickAToonGui
del self.dna
if self.mode in (AvatarChoice.MODE_CREATE, AvatarChoice.MODE_LOCKED):
if self.mode == AvatarChoice.MODE_CREATE:
pass
else:
self.headModel.stopBlink()
@ -267,6 +236,3 @@ class AvatarChoice(DirectButton):
def __handleDeleteWithPasswordCancel(self):
self.deleteWithPasswordFrame.hide()
base.transitions.noTransitions()
def __handleTrialer(self):
TeaserPanel.TeaserPanel(pageName='sixToons')

View file

@ -71,10 +71,9 @@ class AvatarChooser(StateData.StateData):
base.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
return None
def load(self, isPaid):
def load(self):
if self.isLoaded == 1:
return None
self.isPaid = isPaid
gui = loader.loadModel('phase_3/models/gui/pick_a_toon_gui')
gui2 = loader.loadModel('phase_3/models/gui/quit_button')
newGui = loader.loadModel('phase_3/models/gui/tt_m_gui_pat_mainGui')
@ -94,20 +93,14 @@ class AvatarChooser(StateData.StateData):
self.panelList = []
used_position_indexs = []
for av in self.avatarList:
if base.cr.isPaid():
okToLockout = 0
else:
okToLockout = 1
if av.position in AvatarChoice.AvatarChoice.OLD_TRIALER_OPEN_POS:
okToLockout = 0
panel = AvatarChoice.AvatarChoice(av, position=av.position, paid=isPaid, okToLockout=okToLockout)
panel = AvatarChoice.AvatarChoice(av, position=av.position)
panel.setPos(POSITIONS[av.position])
used_position_indexs.append(av.position)
self.panelList.append(panel)
for panelNum in range(0, MAX_AVATARS):
if panelNum not in used_position_indexs:
panel = AvatarChoice.AvatarChoice(position=panelNum, paid=isPaid)
panel = AvatarChoice.AvatarChoice(position=panelNum)
panel.setPos(POSITIONS[panelNum])
self.panelList.append(panel)

View file

@ -6,7 +6,6 @@ from MakeAToonGlobals import *
import random
from toontown.toonbase import TTLocalizer
from direct.directnotify import DirectNotifyGlobal
from toontown.toontowngui import TeaserPanel
import ShuffleButton
class BodyShop(StateData.StateData):
@ -55,7 +54,6 @@ class BodyShop(StateData.StateData):
self.acceptOnce('last', self.__handleBackward)
self.accept('next', self.__handleForward)
self.acceptOnce('MAT-newToonCreated', self.shuffleButton.cleanHistory)
self.restrictHeadType(self.dna.head)
def getSpeciesStart(self):
for species in ToonDNA.toonSpeciesTypes:
@ -68,7 +66,6 @@ class BodyShop(StateData.StateData):
def hideButtons(self):
self.parentFrame.hide()
self.memberButton.hide()
def exit(self):
try:
@ -93,8 +90,6 @@ class BodyShop(StateData.StateData):
shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown')
shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp')
shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled')
self.upsellModel = loader.loadModel('phase_3/models/gui/tt_m_gui_ups_mainGui')
upsellTex = self.upsellModel.find('**/tt_t_gui_ups_banner')
self.parentFrame = DirectFrame(relief=DGG.RAISED, pos=(0.98, 0, 0.416), frameColor=(1, 0, 0, 0))
self.parentFrame.setPos(-0.36, 0, -0.5)
self.parentFrame.reparentTo(base.a2dTopRight)
@ -134,12 +129,7 @@ class BodyShop(StateData.StateData):
shuffleArrowDown,
shuffleArrowRollover,
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapLegs, extraArgs=[1])
self.memberButton = DirectButton(relief=None, image=(upsellTex,
upsellTex,
upsellTex,
upsellTex), image_scale=halfButtonScale, image1_scale=halfButtonHoverScale, image2_scale=halfButtonHoverScale, scale=0.9, pos=(0, 0, -0.84), command=self.__restrictForward)
self.parentFrame.hide()
self.memberButton.hide()
self.shuffleFetchMsg = 'BodyShopShuffle'
self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg)
return
@ -147,8 +137,6 @@ class BodyShop(StateData.StateData):
def unload(self):
self.gui.removeNode()
del self.gui
self.upsellModel.removeNode()
del self.upsellModel
self.parentFrame.destroy()
self.speciesFrame.destroy()
self.headFrame.destroy()
@ -162,7 +150,6 @@ class BodyShop(StateData.StateData):
self.torsoRButton.destroy()
self.legLButton.destroy()
self.legRButton.destroy()
self.memberButton.destroy()
del self.parentFrame
del self.speciesFrame
del self.headFrame
@ -176,7 +163,6 @@ class BodyShop(StateData.StateData):
del self.torsoRButton
del self.legLButton
del self.legRButton
del self.memberButton
self.shuffleButton.unload()
self.ignore('MAT-newToonCreated')
@ -280,7 +266,6 @@ class BodyShop(StateData.StateData):
self.toon.swapToonHead(newHead)
self.toon.loop('neutral', 0)
self.toon.swapToonColor(self.dna)
self.restrictHeadType(newHead)
def __updateScrollButtons(self, choice, length, start, lButton, rButton):
if choice == (start - 1) % length:
@ -315,16 +300,6 @@ class BodyShop(StateData.StateData):
self.doneStatus = 'last'
messenger.send(self.doneEvent)
def restrictHeadType(self, head):
if not base.cr.isPaid():
if head[0] in ('h', 'p', 'b'):
self.accept('next', self.__restrictForward)
else:
self.accept('next', self.__handleForward)
def __restrictForward(self):
TeaserPanel.TeaserPanel(pageName='species')
def changeBody(self):
newChoice = self.shuffleButton.getCurrChoice()
newHead = newChoice[0]
@ -348,30 +323,19 @@ class BodyShop(StateData.StateData):
def __changeSpeciesName(self, species):
if species == 'd':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['dog']
self.memberButton.hide()
elif species == 'c':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['cat']
self.memberButton.hide()
elif species == 'm':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['mouse']
self.memberButton.hide()
elif species == 'h':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['horse']
self.memberButton.show()
elif species == 'r':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['rabbit']
self.memberButton.hide()
elif species == 'f':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['duck']
self.memberButton.hide()
elif species == 'p':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['monkey']
self.memberButton.show()
elif species == 'b':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['bear']
self.memberButton.show()
elif species == 's':
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['pig']
self.memberButton.hide()
if base.cr.isPaid():
self.memberButton.hide()

View file

@ -18,7 +18,6 @@ import NameGenerator
import random
from otp.distributed import PotentialAvatar
from otp.namepanel import NameCheck
from toontown.toontowngui import TeaserPanel
from direct.distributed.PyDatagram import PyDatagram
from direct.showbase import PythonUtil
from toontown.toon import NPCToons
@ -751,14 +750,6 @@ class NameShop(StateData.StateData):
self.nameEntry['focus'] = 1
def __typeAName(self):
if base.cr.productName in ['JP',
'DE',
'BR',
'FR']:
if base.restrictTrialers:
if not base.cr.isPaid():
dialog = TeaserPanel.TeaserPanel(pageName='typeAName')
return
if self.fsm.getCurrentState().getName() == 'TypeAName':
self.typeANameButton['text'] = TTLocalizer.TypeANameButton
self.typeANameButton.wrtReparentTo(self.namePanel, sort=2)

View file

@ -8,7 +8,6 @@ from direct.task import Task
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.toonbase import TTLocalizer
from toontown.toontowngui.TeaserPanel import TeaserPanel
class PurchaseBase(StateData.StateData):
activateMode = 'purchase'
@ -33,13 +32,9 @@ class PurchaseBase(StateData.StateData):
if self.toon.getMoney() == 1:
self.statusLabel['text'] = TTLocalizer.GagShopYouHaveOne
self.isBroke = 0
self._teaserPanel = None
return
def unload(self):
if self._teaserPanel:
self._teaserPanel.destroy()
self._teaserPanel = None
self.jarImage.removeNode()
del self.jarImage
self.frame.destroy()
@ -52,17 +47,8 @@ class PurchaseBase(StateData.StateData):
return
def __handleSelection(self, track, level):
if gagIsPaidOnly(track, level):
if not base.cr.isPaid():
self._teaserPanel = TeaserPanel('restockGags', self._teaserDone)
return
self.handlePurchase(track, level)
def _teaserDone(self):
self._teaserPanel.destroy()
self._teaserPanel = None
return
def handlePurchase(self, track, level):
if self.toon.getMoney() <= 0:
return

View file

@ -28,7 +28,6 @@ from toontown.toon import ToonHead
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
from toontown.toontowngui.TeaserPanel import TeaserPanel
class PartyPlanner(DirectFrame, FSM):

View file

@ -12,7 +12,6 @@ from toontown.toonbase import TTLocalizer
import string, types
from toontown.toon import LaffMeter
from toontown.toonbase.ToontownBattleGlobals import AvPropsNew
from toontown.toontowngui.TeaserPanel import TeaserPanel
from direct.directnotify import DirectNotifyGlobal
from toontown.toontowngui import TTDialog
from otp.otpbase import OTPLocalizer
@ -265,15 +264,8 @@ class QuestPoster(DirectFrame):
guiButton.removeNode()
npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
if not base.cr.isPaid() and (questId == 401 or hasattr(quest, 'getLocation') and quest.getLocation() == 1000 or hoodId == 1000):
def showTeaserPanel():
TeaserPanel(pageName='getGags')
self.chooseButton['command'] = showTeaserPanel
else:
self.chooseButton['command'] = callback
self.chooseButton['extraArgs'] = [questId]
self.chooseButton['command'] = callback
self.chooseButton['extraArgs'] = [questId]
self.unbind(DGG.WITHIN)
self.unbind(DGG.WITHOUT)
if not quest.getType() == Quests.TrackChoiceQuest:

View file

@ -21,7 +21,6 @@ from toontown.racing.Kart import Kart
from toontown.racing.KartShopGlobals import KartGlobals
from toontown.racing import RaceGlobals
from toontown.toontowngui.TTDialog import TTGlobalDialog
from toontown.toontowngui.TeaserPanel import TeaserPanel
if (__debug__):
import pdb
@ -219,8 +218,6 @@ class DistributedStartingBlock(DistributedObject.DistributedObject, FSM):
self.dialog = TTGlobalDialog(msg, doneEvent, 2)
self.dialog.accept(doneEvent, handleTicketError)
self.accept('stoppedAsleep', handleTicketError)
elif errCode == KartGlobals.ERROR_CODE.eUnpaid:
self.dialog = TeaserPanel(pageName='karting', doneFunc=handleTicketError)
else:
self.cr.playGame.getPlace().setState('walk')

View file

@ -12,10 +12,9 @@ from KartShopGlobals import *
from toontown.racing.Kart import Kart
from toontown.shtiker.KartPage import KartViewer
from KartDNA import *
from toontown.toontowngui.TeaserPanel import TeaserPanel
if (__debug__):
import pdb
MENUS = PythonUtil.Enum('MainMenu, BuyKart, BuyAccessory, ReturnKart, ConfirmBuyAccessory, ConfirmBuyKart, BoughtKart, BoughtAccessory, TeaserPanel')
MENUS = PythonUtil.Enum('MainMenu, BuyKart, BuyAccessory, ReturnKart, ConfirmBuyAccessory, ConfirmBuyKart, BoughtKart, BoughtAccessory')
MM_OPTIONS = PythonUtil.Enum('Cancel, BuyAccessory, BuyKart', -1)
BK_OPTIONS = PythonUtil.Enum('Cancel, BuyKart', -1)
BA_OPTIONS = PythonUtil.Enum('Cancel, BuyAccessory', -1)
@ -515,12 +514,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
text_scale=KS_TEXT_SIZE_SMALL,
pressEffect=False,
command=self.__handleBuyAccessory)
if not base.cr.isPaid():
def showTeaserPanel():
TeaserPanel(pageName='kartingAccessories')
self.buyAccessoryButton['command'] = showTeaserPanel
self.ownedAccList = base.localAvatar.getKartAccessoriesOwned()
while -1 in self.ownedAccList:
self.ownedAccList.remove(-1)
@ -786,8 +779,7 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
MENUS.ConfirmBuyKart: ('ConfirmBuyKartGuiDone', self.__handleConfirmBuyKartDlg, self.ConfirmBuyKartDlg),
MENUS.ConfirmBuyAccessory: ('ConfirmBuyAccessoryGuiDone', self.__handleConfirmBuyAccessoryDlg, self.ConfirmBuyAccessoryDlg),
MENUS.BoughtKart: ('BoughtKartGuiDone', self.__handleBoughtKartDlg, self.BoughtKartDlg),
MENUS.BoughtAccessory: ('BoughtAccessoryGuiDone', self.__handleBoughtAccessoryDlg, self.BoughtAccessoryDlg),
MENUS.TeaserPanel: ('UnpaidPurchaseAttempt', self.__handleTeaserPanelDlg, TeaserPanel)}
MENUS.BoughtAccessory: ('BoughtAccessoryGuiDone', self.__handleBoughtAccessoryDlg, self.BoughtAccessoryDlg)}
self.kartID = -1
self.accID = -1
self.timer = ToontownTimer.ToontownTimer()
@ -857,9 +849,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
self.__doDialog(self.dialogStack[-1])
return
def __doLastMenu(self):
self.__doDialog(self.lastMenu)
def __doDialog(self, dialogType):
self.__destroyDialog()
messenger.send('wakeup')
@ -876,12 +865,9 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
self.dialog = eventDlg(eventType, self.accID)
elif dialogType == MENUS.BoughtAccessory:
self.dialog = eventDlg(eventType, self.accID)
elif dialogType == MENUS.TeaserPanel:
self.dialog = eventDlg(pageName='karting', doneFunc=self.__doLastMenu)
else:
self.dialog = eventDlg(eventType)
if not dialogType == MENUS.TeaserPanel:
self.lastMenu = dialogType
self.lastMenu = dialogType
def __handleMainMenuDlg(self, exitType, args = []):
self.notify.debug('__handleMainMenuDlg: Handling MainMenu Dialog Selection.')
@ -904,9 +890,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
self.accID = -1
self.__doDialog(MENUS.BuyAccessory)
def __handleTeaserPanelDlg(self):
self.__doDialog(MENUS.TeaserPanel)
def __handleBuyKartDlg(self, exitType, args = []):
self.notify.debug('__handleBuyKartDlg: Handling BuyKart Dialog Selection.')
if exitType == BK_OPTIONS.Cancel:

View file

@ -25,7 +25,6 @@ from toontown.toonbase import ToontownTimer
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.hood import ZoneUtil
from toontown.toontowngui import TeaserPanel
class DistributedFishingSpot(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedFishingSpot')
@ -162,31 +161,13 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
self.area = self.pond.getArea()
self.waterLevel = FishingTargetGlobals.getWaterLevel(self.area)
def allowedToEnter(self):
if hasattr(base, 'ttAccess') and base.ttAccess and base.ttAccess.canAccess():
return True
return False
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def __handleEnterSphere(self, collEntry):
if self.allowedToEnter():
if base.localAvatar.doId == self.lastAvId and globalClock.getFrameCount() <= self.lastFrame + 1:
self.notify.debug('Ignoring duplicate entry for avatar.')
return
if base.localAvatar.hp > 0 and base.cr.playGame.getPlace().fsm.getCurrentState().getName() != 'fishing':
self.cr.playGame.getPlace().detectedFishingCollision()
self.d_requestEnter()
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='fishing', doneFunc=self.handleOkTeaser)
if base.localAvatar.doId == self.lastAvId and globalClock.getFrameCount() <= self.lastFrame + 1:
self.notify.debug('Ignoring duplicate entry for avatar.')
return
if base.localAvatar.hp > 0 and base.cr.playGame.getPlace().fsm.getCurrentState().getName() != 'fishing':
self.cr.playGame.getPlace().detectedFishingCollision()
self.d_requestEnter()
def d_requestEnter(self):
self.sendUpdate('requestEnter', [])

View file

@ -12,7 +12,6 @@ from direct.fsm import State
from toontown.distributed import DelayDelete
from direct.task.Task import Task
from direct.showbase import PythonUtil
from toontown.toontowngui import TeaserPanel
from toontown.toon import ToonDNA
from toontown.hood import ZoneUtil
@ -122,27 +121,9 @@ class DistributedGolfKart(DistributedObject.DistributedObject):
self.notify.debug('Entering Trolley Sphere....')
self.loader.place.detectedTrolleyCollision()
def allowedToEnter(self):
if hasattr(base, 'ttAccess') and base.ttAccess and base.ttAccess.canAccess():
return True
return False
def handleEnterGolfKartSphere(self, collEntry):
self.notify.debug('Entering Golf Kart Sphere.... %s' % self.getDoId())
if self.allowedToEnter():
self.loader.place.detectedGolfKartCollision(self)
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='golf', doneFunc=self.handleOkTeaser)
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
self.loader.place.detectedGolfKartCollision(self)
def handleEnterTrolley(self):
toon = base.localAvatar

View file

@ -11,7 +11,6 @@ from direct.fsm import State
from toontown.distributed import DelayDelete
from direct.task.Task import Task
from toontown.hood import ZoneUtil
from toontown.toontowngui import TeaserPanel
class DistributedTrolley(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrolley')
@ -162,29 +161,11 @@ class DistributedTrolley(DistributedObject.DistributedObject):
def setState(self, state, timestamp):
self.fsm.request(state, [globalClockDelta.localElapsedTime(timestamp)])
def allowedToEnter(self):
if hasattr(base, 'ttAccess') and base.ttAccess and base.ttAccess.canAccess():
return True
return False
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def handleEnterTrolleySphere(self, collEntry):
self.notify.debug('Entering Trolley Sphere....')
if base.localAvatar.getPos(render).getZ() < self.trolleyCar.getPos(render).getZ():
return
if self.allowedToEnter():
self.loader.place.detectedTrolleyCollision()
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='minigames', doneFunc=self.handleOkTeaser)
self.loader.place.detectedTrolleyCollision()
def handleEnterTrolley(self):
toon = base.localAvatar

View file

@ -10,7 +10,6 @@ from toontown.minigame import ClerkPurchase
from toontown.nametag.NametagGlobals import *
from toontown.shtiker.PurchaseManagerConstants import *
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
class DistributedNPCClerk(DistributedNPCToonBase):
@ -35,16 +34,6 @@ class DistributedNPCClerk(DistributedNPCToonBase):
DistributedNPCToonBase.disable(self)
def allowedToEnter(self):
return True
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def handleCollisionSphereEnter(self, collEntry):
base.cr.playGame.getPlace().fsm.request('purchase')
self.sendUpdate('avatarEnter', [])

View file

@ -14,14 +14,8 @@ class DistributedNPCFlippyInToonHall(DistributedNPCToon):
self.setScale(1.25)
def handleCollisionSphereEnter(self, collEntry):
if self.allowedToTalk():
base.cr.playGame.getPlace().fsm.request('quest', [self])
self.sendUpdate('avatarEnter', [])
self.nametag3d.setDepthTest(0)
self.nametag3d.setBin('fixed', 0)
self.lookAt(base.localAvatar)
else:
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped')
self.dialog = TeaserPanel.TeaserPanel(pageName='quests', doneFunc=self.handleOkTeaser)
base.cr.playGame.getPlace().fsm.request('quest', [self])
self.sendUpdate('avatarEnter', [])
self.nametag3d.setDepthTest(0)
self.nametag3d.setBin('fixed', 0)
self.lookAt(base.localAvatar)

View file

@ -11,7 +11,6 @@ from toontown.toon import NPCToons
from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals
from toontown.toontowngui import TTDialog
from toontown.toontowngui import TeaserPanel
class DistributedNPCPartyPerson(DistributedNPCToonBase):
@ -21,7 +20,6 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
self.av = None
self.button = None
self.askGui = None
self.teaserDialog = None
return
def disable(self):
@ -94,8 +92,7 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
self.detectAvatars()
self.clearMat()
if self.isInteractingWithLocalToon:
if hasattr(self, 'teaserDialog') and not self.teaserDialog:
self.freeAvatar()
self.freeAvatar()
return Task.done
def setMovie(self, mode, npcId, avId, extraArgs, timestamp):
@ -180,28 +177,10 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
def __handleAskDone(self):
self.ignore(self.planPartyQuestionGuiDoneEvent)
doneStatus = self.askGui.doneStatus
if doneStatus == 'ok':
wantsToPlan = 1
if localAvatar.getGameAccess() != ToontownGlobals.AccessFull:
wantsToPlan = 0
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('stopped', force=1)
self.teaserDialog = TeaserPanel.TeaserPanel(pageName='parties', doneFunc=self.handleOkTeaser)
else:
wantsToPlan = 0
self.sendUpdate('answer', [wantsToPlan])
self.sendUpdate('answer', [self.askGui.doneStatus == 'ok'])
self.askGui.hide()
def popupAskGUI(self, task):
self.setChatAbsolute('', CFSpeech)
self.acceptOnce(self.planPartyQuestionGuiDoneEvent, self.__handleAskDone)
self.askGui.show()
def handleOkTeaser(self):
self.teaserDialog.destroy()
del self.teaserDialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')

View file

@ -10,7 +10,6 @@ from toontown.hood import ZoneUtil
from toontown.nametag.NametagGlobals import *
from toontown.pets import PetshopGUI
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
class DistributedNPCPetclerk(DistributedNPCToonBase):
@ -52,16 +51,6 @@ class DistributedNPCPetclerk(DistributedNPCToonBase):
def getCollSphereRadius(self):
return 4.0
def allowedToEnter(self):
return True
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def handleCollisionSphereEnter(self, collEntry):
base.cr.playGame.getPlace().fsm.request('purchase')
self.sendUpdate('avatarEnter', [])

View file

@ -9,7 +9,6 @@ from toontown.quest import QuestChoiceGui
from toontown.quest import QuestParser
from toontown.quest import TrackChoiceGui
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
ChoiceTimeout = 20
@ -75,13 +74,6 @@ class DistributedNPCSpecialQuestGiver(DistributedNPCToonBase):
self.nametag3d.setDepthTest(0)
self.nametag3d.setBin('fixed', 0)
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def finishMovie(self, av, isLocalToon, elapsedTime):
self.cleanupMovie()
av.startLookAround()

View file

@ -9,7 +9,6 @@ from toontown.quest import QuestChoiceGui
from toontown.quest import QuestParser
from toontown.quest import TrackChoiceGui
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
ChoiceTimeout = 20
@ -61,13 +60,6 @@ class DistributedNPCToon(DistributedNPCToonBase):
self.nametag3d.setDepthTest(0)
self.nametag3d.setBin('fixed', 0)
def handleOkTeaser(self):
self.dialog.destroy()
del self.dialog
place = base.cr.playGame.getPlace()
if place:
place.fsm.request('walk')
def finishMovie(self, av, isLocalToon, elapsedTime):
self.cleanupMovie()
av.startLookAround()

View file

@ -8,7 +8,6 @@ from toontown.quest import QuestChoiceGui
from toontown.quest import QuestParser
from toontown.quest import TrackChoiceGui
from toontown.toonbase import TTLocalizer
from toontown.toontowngui import TeaserPanel
SPAMMING = 1

View file

@ -13,10 +13,7 @@ import ToonAvatarDetailPanel
import AvatarPanelBase
import PlayerDetailPanel
from otp.otpbase import OTPGlobals
GAME_LOGO_NAMES = {'Default': 'GameLogo_Unknown',
'Disney XD': 'GameLogo_XD',
'Toontown': 'GameLogo_Toontown',
'Pirates': 'GameLogo_Pirates'}
GAME_LOGO_NAMES = {'Default': 'GameLogo_Toontown'}
GAME_LOGO_FILE = 'phase_3/models/misc/game_logo_card'
class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase):

View file

@ -4040,36 +4040,6 @@ DownloadForceAcknowledgeVerbList = ['painted',
'inflated',
'built']
DownloadForceAcknowledgeMsg = 'Sorry, the %(phase)s area is still being %(verb)s, and will be ready for you in a minute.'
TeaserTop = ''
TeaserBottom = ''
TeaserDefault = ',\nyou need to become a Member.\n\nJoin us!'
TeaserOtherHoods = 'For unlimited adventures in all 6 neighborhoods'
TeaserTypeAName = 'Type in your favorite name for your Toon!'
TeaserSixToons = 'To play more than one Toon'
TeaserClothing = 'To buy items from the Cattlelog \nto customize your toon'
TeaserCogHQ = 'To access awesome Cog HQs'
TeaserSecretChat = 'To use the True Friends Chat feature'
TeaserSpecies = 'To pick this type of Toon'
TeaserFishing = 'To fish in all 6 neighborhoods'
TeaserGolf = 'To play Toon MiniGolf'
TeaserParties = 'To plan a party'
TeaserSubscribe = 'Subscribe'
TeaserContinue = 'Return To Game'
TeaserEmotions = 'To make your Toon more expressive'
TeaserKarting = 'To access unlimited Kart Racing'
TeaserKartingAccessories = 'To customize your Kart'
TeaserGardening = 'To continue gardening at your Toon Estate'
TeaserHaveFun = 'Have more fun!'
TeaserJoinUs = 'Join us!'
TeaserPlantGags = 'To plant these gags'
TeaserPickGags = 'To pick these gags'
TeaserRestockGags = 'To restock these gags'
TeaserGetGags = 'To get these gags'
TeaserUseGags = 'To use these gags'
TeaserMinigames = TeaserOtherHoods
TeaserQuests = TeaserOtherHoods
TeaserOtherGags = TeaserOtherHoods
TeaserTricks = TeaserOtherHoods
LauncherPhaseNames = {0: 'Initialization',
1: 'Panda',
2: 'Engine',
@ -6963,7 +6933,6 @@ CatalogPurchasedGiftText = 'Already\nOwned'
CatalogMailboxFull = 'No Room'
CatalogNotAGift = 'Not a Gift'
CatalogNoFit = "Doesn't\nFit"
CatalogMembersOnly = 'Members\nOnly!'
CatalogSndOnText = 'Snd On'
CatalogSndOffText = 'Snd Off'
CatalogPurchasedMaxText = 'Already\nPurchased Max'

View file

@ -1,198 +0,0 @@
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from direct.gui import DirectGuiGlobals
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
import TTDialog
from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil
from direct.showbase.DirectObject import DirectObject
Pages = {'otherHoods': (TTLocalizer.TeaserOtherHoods,),
'typeAName': (TTLocalizer.TeaserTypeAName,),
'sixToons': (TTLocalizer.TeaserSixToons,),
'otherGags': (TTLocalizer.TeaserOtherGags,),
'clothing': (TTLocalizer.TeaserClothing,),
'cogHQ': (TTLocalizer.TeaserCogHQ,),
'secretChat': (TTLocalizer.TeaserSecretChat,),
'quests': (TTLocalizer.TeaserQuests,),
'emotions': (TTLocalizer.TeaserEmotions,),
'minigames': (TTLocalizer.TeaserMinigames,),
'karting': (TTLocalizer.TeaserKarting,),
'kartingAccessories': (TTLocalizer.TeaserKartingAccessories,),
'gardening': (TTLocalizer.TeaserGardening,),
'tricks': (TTLocalizer.TeaserTricks,),
'species': (TTLocalizer.TeaserSpecies,),
'golf': (TTLocalizer.TeaserGolf,),
'fishing': (TTLocalizer.TeaserFishing,),
'parties': (TTLocalizer.TeaserParties,),
'plantGags': (TTLocalizer.TeaserPlantGags,),
'pickGags': (TTLocalizer.TeaserPickGags,),
'restockGags': (TTLocalizer.TeaserRestockGags,),
'getGags': (TTLocalizer.TeaserGetGags,),
'useGags': (TTLocalizer.TeaserUseGags,)}
PageOrder = ['sixToons',
'typeAName',
'species',
'otherHoods',
'otherGags',
'clothing',
'parties',
'tricks',
'cogHQ',
'secretChat',
'quests',
'emotions',
'minigames',
'karting',
'kartingAccessories',
'gardening',
'golf',
'fishing',
'plantGags',
'pickGags',
'restockGags',
'getGags',
'useGags']
class TeaserPanel(DirectObject):
notify = DirectNotifyGlobal.directNotify.newCategory('TeaserPanel')
def __init__(self, pageName, doneFunc = None):
self.doneFunc = doneFunc
if not hasattr(self, 'browser'):
self.browser = FeatureBrowser()
self.browser.load()
self.browser.setPos(0, 0, TTLocalizer.TPbrowserPosZ)
self.browser.setScale(0.75)
self.browser.reparentTo(hidden)
self.upsellBackground = loader.loadModel('phase_3/models/gui/tt_m_gui_ups_panelBg')
self.leaveDialog = None
self.showPage(pageName)
self.ignore('exitingStoppedState')
self.accept('exitingStoppedState', self.cleanup)
return
def __handleDone(self, choice = 0):
self.cleanup()
self.unload()
if choice == 1:
self.__handlePay()
else:
self.__handleContinue()
def __handleContinue(self):
if self.doneFunc:
self.notify.debug('calling doneFunc')
self.doneFunc()
def __handlePay(self):
pass
def destroy(self):
self.cleanup()
def cleanup(self):
if hasattr(self, 'browser'):
self.browser.reparentTo(hidden)
self.browser.ignoreAll()
if hasattr(self, 'dialog'):
base.transitions.noTransitions()
self.dialog.cleanup()
del self.dialog
if self.leaveDialog:
self.leaveDialog.destroy()
self.leaveDialog = None
self.ignoreAll()
return
def unload(self):
if hasattr(self, 'browser'):
self.browser.destroy()
del self.browser
def showPage(self, pageName):
if pageName not in PageOrder:
self.notify.error("unknown page '%s'" % pageName)
self.browser.scrollTo(PageOrder.index(pageName))
self.cleanup()
self.dialog = TTDialog.TTDialog(parent=aspect2dp, text=TTLocalizer.TeaserTop, text_scale=TTLocalizer.TPdialog, text_align=TextNode.ACenter, text_wordwrap=TTLocalizer.TPdialogWordwrap, topPad=-0.15, midPad=1.25, sidePad=0.25, pad=(0.25, 0.25), command=self.__handleDone, fadeScreen=0.5, style=TTDialog.TwoChoice, buttonTextList=[TTLocalizer.TeaserSubscribe, TTLocalizer.TeaserContinue], button_text_scale=TTLocalizer.TPbuttonTextList, buttonPadSF=5.5, sortOrder=NO_FADE_SORT_INDEX, image=self.upsellBackground)
self.dialog.setPos(0, 0, 0.75)
self.browser.reparentTo(self.dialog)
base.transitions.fadeScreen(0.5)
if base.config.GetBool('want-teaser-scroll-keys', 0):
self.accept('arrow_right', self.showNextPage)
self.accept('arrow_left', self.showPrevPage)
self.accept('stoppedAsleep', self.__handleDone)
def showNextPage(self):
self.notify.debug('show next')
self.browser.scrollBy(1)
def showPrevPage(self):
self.notify.debug('show prev')
self.browser.scrollBy(-1)
def showPay(self):
self.dialog.buttonList[0].show()
def hidePay(self):
self.dialog.buttonList[0].hide()
def removed(self):
if hasattr(self, 'dialog') and self.dialog:
return self.dialog.removed()
elif hasattr(self, 'leaveDialog') and self.leaveDialog:
return self.leaveDialog.removed()
else:
return 1
class FeatureBrowser(DirectScrolledList):
def __init__(self, parent = aspect2dp, **kw):
self.parent = parent
optiondefs = (('parent', self.parent, None),
('relief', None, None),
('numItemsVisible', 1, None),
('items', [], None))
self.defineoptions(kw, optiondefs)
DirectScrolledList.__init__(self, parent)
self.incButton.hide()
self.decButton.hide()
self.initialiseoptions(FeatureBrowser)
return
def destroy(self):
DirectScrolledList.destroy(self)
def load(self):
guiModel = loader.loadModel('phase_3/models/gui/tt_m_gui_ups_logo_noText')
leftLocator = guiModel.find('**/bubbleLeft_locator')
rightLocator = guiModel.find('**/bubbleRight_locator')
haveFunNode = TextNode('Have Fun')
haveFunNode.setText(TTLocalizer.TeaserHaveFun)
haveFunNode.setTextColor(0, 0, 0, 1)
haveFunNode.setWordwrap(6)
haveFunNode.setAlign(TextNode.ACenter)
haveFunNode.setFont(DirectGuiGlobals.getDefaultFont())
haveFun = NodePath(haveFunNode)
haveFun.reparentTo(rightLocator)
haveFun.setScale(TTLocalizer.TPhaveFun)
JoinUsNode = TextNode('Join Us')
JoinUsNode.setText(TTLocalizer.TeaserJoinUs)
JoinUsNode.setTextColor(0, 0, 0, 1)
JoinUsNode.setWordwrap(6)
JoinUsNode.setAlign(TextNode.ACenter)
JoinUsNode.setFont(DirectGuiGlobals.getDefaultFont())
JoinUs = NodePath(JoinUsNode)
JoinUs.reparentTo(leftLocator)
JoinUs.setPos(0, 0, -0.025)
JoinUs.setScale(TTLocalizer.TPjoinUs)
for page in PageOrder:
textInfo = Pages.get(page)
textInfo = textInfo[0] + TTLocalizer.TeaserDefault
panel = DirectFrame(parent=self, relief=None, image=guiModel, image_scale=(0.65, 0.65, 0.65), image_pos=(0, 0, 0.0), text_align=TextNode.ACenter, text=textInfo, text_scale=TTLocalizer.TPpanel, text_pos=TTLocalizer.TPpanelPos)
self.addItem(panel)
guiModel.removeNode()
return

View file

@ -2,8 +2,6 @@ from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
import string
from direct.fsm import StateData
from toontown.toontowngui.TeaserPanel import TeaserPanel
from toontown.toonbase.ToontownBattleGlobals import gagIsPaidOnly
AttackPanelHidden = 0
def hideAttackPanel(flag):
@ -26,7 +24,6 @@ class TownBattleAttackPanel(StateData.StateData):
def enter(self):
StateData.StateData.enter(self)
self._teaserPanel = None
if not AttackPanelHidden:
base.localAvatar.inventory.show()
self.accept('inventory-selection', self.__handleInventory)
@ -46,9 +43,6 @@ class TownBattleAttackPanel(StateData.StateData):
self.ignore('inventory-fire')
self.ignore('hide-attack-panel')
base.localAvatar.inventory.hide()
if self._teaserPanel:
self._teaserPanel.destroy()
del self._teaserPanel
def __handleRun(self):
doneStatus = {'mode': 'Run'}
@ -67,9 +61,6 @@ class TownBattleAttackPanel(StateData.StateData):
messenger.send(self.doneEvent, [doneStatus])
def __handleInventory(self, track, level):
if not base.cr.isPaid() and gagIsPaidOnly(track, level):
self._teaserPanel = TeaserPanel(pageName='useGags')
return
if base.localAvatar.inventory.numItem(track, level) > 0:
doneStatus = {}
doneStatus['mode'] = 'Inventory'