mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
Some phase_3 cleanup
This commit is contained in:
parent
26c85cdded
commit
876868179c
37 changed files with 80 additions and 759 deletions
|
@ -47,7 +47,6 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
self.__normalObscured = 0
|
self.__normalObscured = 0
|
||||||
self.openChatWarning = None
|
self.openChatWarning = None
|
||||||
self.unpaidChatWarning = None
|
self.unpaidChatWarning = None
|
||||||
self.teaser = None
|
|
||||||
self.paidNoParentPassword = None
|
self.paidNoParentPassword = None
|
||||||
self.noSecretChatAtAll = None
|
self.noSecretChatAtAll = None
|
||||||
self.noSecretChatAtAllAndNoWhitelist = None
|
self.noSecretChatAtAllAndNoWhitelist = None
|
||||||
|
@ -80,8 +79,7 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
State.State('problemActivatingChat', self.enterProblemActivatingChat, self.exitProblemActivatingChat),
|
State.State('problemActivatingChat', self.enterProblemActivatingChat, self.exitProblemActivatingChat),
|
||||||
State.State('whiteListOpenChat', self.enterWhiteListOpenChat, self.exitWhiteListOpenChat),
|
State.State('whiteListOpenChat', self.enterWhiteListOpenChat, self.exitWhiteListOpenChat),
|
||||||
State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat),
|
State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat),
|
||||||
State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat),
|
State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat)], 'off', 'off')
|
||||||
State.State('trueFriendTeaserPanel', self.enterTrueFriendTeaserPanel, self.exitTrueFriendTeaserPanel)], 'off', 'off')
|
|
||||||
self.fsm.enterInitialState()
|
self.fsm.enterInitialState()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -101,10 +99,6 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
self.payButton = None
|
self.payButton = None
|
||||||
self.unpaidChatWarning.destroy()
|
self.unpaidChatWarning.destroy()
|
||||||
self.unpaidChatWarning = None
|
self.unpaidChatWarning = None
|
||||||
if self.teaser:
|
|
||||||
self.teaser.cleanup()
|
|
||||||
self.teaser.unload()
|
|
||||||
self.teaser = None
|
|
||||||
if self.noSecretChatAtAll:
|
if self.noSecretChatAtAll:
|
||||||
self.noSecretChatAtAll.destroy()
|
self.noSecretChatAtAll.destroy()
|
||||||
self.noSecretChatAtAll = None
|
self.noSecretChatAtAll = None
|
||||||
|
@ -483,12 +477,6 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
def exitProblemActivatingChat(self):
|
def exitProblemActivatingChat(self):
|
||||||
self.notify.error('called exitProblemActivatingChat() on parent class')
|
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):
|
def __secretFriendsInfoDone(self):
|
||||||
self.fsm.request('activateChat')
|
self.fsm.request('activateChat')
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,7 @@ BothSecrets = 2
|
||||||
|
|
||||||
def showFriendSecret(secretType = AvatarSecret):
|
def showFriendSecret(secretType = AvatarSecret):
|
||||||
global globalFriendSecret
|
global globalFriendSecret
|
||||||
if not base.cr.isPaid():
|
if not base.cr.isParentPasswordSet():
|
||||||
chatMgr = base.localAvatar.chatMgr
|
|
||||||
chatMgr.fsm.request('trueFriendTeaserPanel')
|
|
||||||
elif not base.cr.isParentPasswordSet():
|
|
||||||
chatMgr = base.localAvatar.chatMgr
|
chatMgr = base.localAvatar.chatMgr
|
||||||
if base.cr.productName in ['DisneyOnline-AP',
|
if base.cr.productName in ['DisneyOnline-AP',
|
||||||
'DisneyOnline-UK',
|
'DisneyOnline-UK',
|
||||||
|
|
|
@ -15,7 +15,6 @@ from toontown.toon import GroupPanel
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPartyBase.BoardingPartyBase):
|
class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPartyBase.BoardingPartyBase):
|
||||||
|
@ -410,38 +409,25 @@ class DistributedBoardingParty(DistributedObject.DistributedObject, BoardingPart
|
||||||
self.notify.debug('requestInvite %s' % inviteeId)
|
self.notify.debug('requestInvite %s' % inviteeId)
|
||||||
elevator = base.cr.doId2do.get(self.getElevatorIdList()[0])
|
elevator = base.cr.doId2do.get(self.getElevatorIdList()[0])
|
||||||
if elevator:
|
if elevator:
|
||||||
if elevator.allowedToEnter(self.zoneId):
|
if inviteeId in self.getGroupKickList(localAvatar.doId):
|
||||||
if inviteeId in self.getGroupKickList(localAvatar.doId):
|
if not self.isGroupLeader(localAvatar.doId):
|
||||||
if not self.isGroupLeader(localAvatar.doId):
|
avatar = base.cr.doId2do.get(inviteeId)
|
||||||
avatar = base.cr.doId2do.get(inviteeId)
|
if avatar:
|
||||||
if avatar:
|
avatarNameText = avatar.name
|
||||||
avatarNameText = avatar.name
|
else:
|
||||||
else:
|
avatarNameText = ''
|
||||||
avatarNameText = ''
|
rejectText = TTLocalizer.BoardingInviteeInKickOutList % avatarNameText
|
||||||
rejectText = TTLocalizer.BoardingInviteeInKickOutList % avatarNameText
|
self.showMe(rejectText)
|
||||||
self.showMe(rejectText)
|
return
|
||||||
return
|
if self.inviterPanels.isInvitingPanelUp():
|
||||||
if self.inviterPanels.isInvitingPanelUp():
|
self.showMe(TTLocalizer.BoardingPendingInvite, pos=(0, 0, 0))
|
||||||
self.showMe(TTLocalizer.BoardingPendingInvite, pos=(0, 0, 0))
|
elif len(self.getGroupMemberList(localAvatar.doId)) >= self.maxSize:
|
||||||
elif len(self.getGroupMemberList(localAvatar.doId)) >= self.maxSize:
|
self.showMe(TTLocalizer.BoardingInviteGroupFull)
|
||||||
self.showMe(TTLocalizer.BoardingInviteGroupFull)
|
|
||||||
else:
|
|
||||||
invitee = base.cr.doId2do.get(inviteeId)
|
|
||||||
if invitee:
|
|
||||||
self.inviterPanels.createInvitingPanel(self, inviteeId)
|
|
||||||
self.sendUpdate('requestInvite', [inviteeId])
|
|
||||||
else:
|
else:
|
||||||
place = base.cr.playGame.getPlace()
|
invitee = base.cr.doId2do.get(inviteeId)
|
||||||
if place:
|
if invitee:
|
||||||
place.fsm.request('stopped')
|
self.inviterPanels.createInvitingPanel(self, inviteeId)
|
||||||
self.teaserDialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
|
self.sendUpdate('requestInvite', [inviteeId])
|
||||||
|
|
||||||
def handleOkTeaser(self):
|
|
||||||
self.teaserDialog.destroy()
|
|
||||||
del self.teaserDialog
|
|
||||||
place = base.cr.playGame.getPlace()
|
|
||||||
if place:
|
|
||||||
place.fsm.request('walk')
|
|
||||||
|
|
||||||
def requestCancelInvite(self, inviteeId):
|
def requestCancelInvite(self, inviteeId):
|
||||||
self.sendUpdate('requestCancelInvite', [inviteeId])
|
self.sendUpdate('requestCancelInvite', [inviteeId])
|
||||||
|
|
|
@ -13,7 +13,6 @@ from toontown.hood import ZoneUtil
|
||||||
from toontown.suit import Suit
|
from toontown.suit import Suit
|
||||||
from toontown.toonbase.ToonBaseGlobal import *
|
from toontown.toonbase.ToonBaseGlobal import *
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
from toontown.nametag.NametagGroup import NametagGroup
|
from toontown.nametag.NametagGroup import NametagGroup
|
||||||
from toontown.nametag.Nametag import Nametag
|
from toontown.nametag.Nametag import Nametag
|
||||||
|
|
||||||
|
@ -312,33 +311,8 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
|
||||||
return yToTest
|
return yToTest
|
||||||
|
|
||||||
def enterDoor(self):
|
def enterDoor(self):
|
||||||
if self.allowedToEnter():
|
messenger.send('DistributedDoor_doorTrigger')
|
||||||
messenger.send('DistributedDoor_doorTrigger')
|
self.sendUpdate('requestEnter')
|
||||||
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
|
|
||||||
|
|
||||||
def checkIsDoorHitTaskName(self):
|
def checkIsDoorHitTaskName(self):
|
||||||
return 'checkIsDoorHit' + self.getTriggerName()
|
return 'checkIsDoorHit' + self.getTriggerName()
|
||||||
|
|
|
@ -12,7 +12,6 @@ from toontown.toonbase import TTLocalizer, ToontownGlobals
|
||||||
from direct.task.Task import Task
|
from direct.task.Task import Task
|
||||||
from toontown.distributed import DelayDelete
|
from toontown.distributed import DelayDelete
|
||||||
from toontown.hood import ZoneUtil
|
from toontown.hood import ZoneUtil
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
from toontown.building import BoardingGroupShow
|
from toontown.building import BoardingGroupShow
|
||||||
|
|
||||||
class DistributedElevator(DistributedObject.DistributedObject):
|
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!')
|
self.notify.warning('toon: ' + str(avId) + " doesn't exist, and" + ' cannot exit the elevator!')
|
||||||
return
|
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):
|
def handleEnterSphere(self, collEntry):
|
||||||
self.notify.debug('Entering Elevator Sphere....')
|
self.notify.debug('Entering Elevator Sphere....')
|
||||||
if self.allowedToEnter(self.zoneId):
|
if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId:
|
||||||
if self.elevatorTripId and localAvatar.lastElevatorLeft == self.elevatorTripId:
|
self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE)
|
||||||
self.rejectBoard(base.localAvatar.doId, REJECT_SHUFFLE)
|
elif base.localAvatar.hp > 0:
|
||||||
elif base.localAvatar.hp > 0:
|
self.cr.playGame.getPlace().detectedElevatorCollision(self)
|
||||||
self.cr.playGame.getPlace().detectedElevatorCollision(self)
|
toon = base.localAvatar
|
||||||
toon = base.localAvatar
|
self.sendUpdate('requestBoard', [])
|
||||||
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')
|
|
||||||
|
|
||||||
def rejectBoard(self, avId, reason = 0):
|
def rejectBoard(self, avId, reason = 0):
|
||||||
if hasattr(base.localAvatar, 'elevatorNotifier'):
|
if hasattr(base.localAvatar, 'elevatorNotifier'):
|
||||||
|
|
|
@ -14,8 +14,6 @@ from toontown.nametag.Nametag import Nametag
|
||||||
from toontown.nametag.NametagGroup import NametagGroup
|
from toontown.nametag.NametagGroup import NametagGroup
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedElevatorExt(DistributedElevator.DistributedElevator):
|
class DistributedElevatorExt(DistributedElevator.DistributedElevator):
|
||||||
|
|
||||||
|
@ -97,13 +95,8 @@ class DistributedElevatorExt(DistributedElevator.DistributedElevator):
|
||||||
self.notify.debug('Entering Elevator Sphere....')
|
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:
|
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)
|
base.localAvatar.elevatorNotifier.showMe(TTLocalizer.ElevatorGroupMember)
|
||||||
elif self.allowedToEnter(self.zoneId):
|
|
||||||
self.cr.playGame.getPlace().detectedElevatorCollision(self)
|
|
||||||
else:
|
else:
|
||||||
place = base.cr.playGame.getPlace()
|
self.cr.playGame.getPlace().detectedElevatorCollision(self)
|
||||||
if place:
|
|
||||||
place.fsm.request('stopped')
|
|
||||||
self.dialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
|
|
||||||
|
|
||||||
def handleEnterElevator(self):
|
def handleEnterElevator(self):
|
||||||
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId):
|
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty and localAvatar.boardingParty.getGroupLeader(localAvatar.doId):
|
||||||
|
|
|
@ -11,7 +11,6 @@ from CatalogMouldingItem import getAllMouldings
|
||||||
from CatalogWainscotingItem import getAllWainscotings
|
from CatalogWainscotingItem import getAllWainscotings
|
||||||
from CatalogFurnitureItem import getAllFurnitures
|
from CatalogFurnitureItem import getAllFurnitures
|
||||||
from CatalogFurnitureItem import FLTrunk
|
from CatalogFurnitureItem import FLTrunk
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
from otp.otpbase import OTPGlobals
|
from otp.otpbase import OTPGlobals
|
||||||
CATALOG_PANEL_WORDWRAP = 10
|
CATALOG_PANEL_WORDWRAP = 10
|
||||||
CATALOG_PANEL_CHAT_WORDWRAP = 9
|
CATALOG_PANEL_CHAT_WORDWRAP = 9
|
||||||
|
@ -280,25 +279,9 @@ class CatalogItemPanel(DirectFrame):
|
||||||
self.unload()
|
self.unload()
|
||||||
return
|
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):
|
def updateBuyButton(self):
|
||||||
if not self.loaded:
|
if not self.loaded:
|
||||||
return
|
return
|
||||||
if not base.cr.isPaid():
|
|
||||||
self.buyButton['command'] = self.getTeaserPanel()
|
|
||||||
self.buyButton.show()
|
self.buyButton.show()
|
||||||
typeCode = self['item'].getTypeCode()
|
typeCode = self['item'].getTypeCode()
|
||||||
orderCount = base.localAvatar.onOrder.count(self['item'])
|
orderCount = base.localAvatar.onOrder.count(self['item'])
|
||||||
|
@ -469,8 +452,6 @@ class CatalogItemPanel(DirectFrame):
|
||||||
self.giftButton.show()
|
self.giftButton.show()
|
||||||
if giftUpdate == 0:
|
if giftUpdate == 0:
|
||||||
return
|
return
|
||||||
if not base.cr.isPaid():
|
|
||||||
self.giftButton['command'] = self.getTeaserPanel()
|
|
||||||
self.auxText['text'] = ' '
|
self.auxText['text'] = ' '
|
||||||
numFriends = len(base.localAvatar.friendsList) + len(base.cr.avList) - 1
|
numFriends = len(base.localAvatar.friendsList) + len(base.cr.avList) - 1
|
||||||
if numFriends > 0:
|
if numFriends > 0:
|
||||||
|
|
|
@ -8,7 +8,6 @@ from toontown.parties.PartyGlobals import InviteStatus
|
||||||
from toontown.parties.SimpleMailBase import SimpleMailBase
|
from toontown.parties.SimpleMailBase import SimpleMailBase
|
||||||
from toontown.toonbase import TTLocalizer, ToontownGlobals
|
from toontown.toonbase import TTLocalizer, ToontownGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
from toontown.parties.InviteVisual import InviteVisual
|
from toontown.parties.InviteVisual import InviteVisual
|
||||||
import CatalogItem
|
import CatalogItem
|
||||||
from direct.showbase.PythonUtil import StackTrace
|
from direct.showbase.PythonUtil import StackTrace
|
||||||
|
@ -184,14 +183,11 @@ class MailboxScreen(DirectObject.DirectObject):
|
||||||
isAward = False
|
isAward = False
|
||||||
if isinstance(item, CatalogItem.CatalogItem):
|
if isinstance(item, CatalogItem.CatalogItem):
|
||||||
isAward = item.isAward()
|
isAward = item.isAward()
|
||||||
if not base.cr.isPaid() and not (isinstance(item, InviteInfoBase) or isAward):
|
self.acceptingIndex = self.itemIndex
|
||||||
TeaserPanel(pageName='clothing')
|
self.acceptButton['state'] = DGG.DISABLED
|
||||||
else:
|
self.__showCurrentItem()
|
||||||
self.acceptingIndex = self.itemIndex
|
item = self.items[self.itemIndex]
|
||||||
self.acceptButton['state'] = DGG.DISABLED
|
item.acceptItem(self.mailbox, self.acceptingIndex, self.__acceptItemCallback)
|
||||||
self.__showCurrentItem()
|
|
||||||
item = self.items[self.itemIndex]
|
|
||||||
item.acceptItem(self.mailbox, self.acceptingIndex, self.__acceptItemCallback)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def __handleDiscard(self, buttonValue = None):
|
def __handleDiscard(self, buttonValue = None):
|
||||||
|
|
|
@ -4,7 +4,6 @@ from direct.showbase.PythonUtil import traceFunctionCall
|
||||||
from otp.otpbase import OTPGlobals
|
from otp.otpbase import OTPGlobals
|
||||||
from otp.otpbase import OTPLocalizer
|
from otp.otpbase import OTPLocalizer
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
|
@ -169,19 +168,6 @@ class ToontownChatManager(ChatManager.ChatManager):
|
||||||
self.payButton.hide()
|
self.payButton.hide()
|
||||||
else:
|
else:
|
||||||
self.payButton.show()
|
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()
|
normObs, scObs = self.isObscured()
|
||||||
if not scObs:
|
if not scObs:
|
||||||
self.scButton.show()
|
self.scButton.show()
|
||||||
|
@ -425,33 +411,6 @@ class ToontownChatManager(ChatManager.ChatManager):
|
||||||
def exitNoSecretChatAtAllAndNoWhitelist(self):
|
def exitNoSecretChatAtAllAndNoWhitelist(self):
|
||||||
self.noSecretChatAtAllAndNoWhitelist.hide()
|
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):
|
def __whisperScButtonPressed(self, avatarName, avatarId, playerId):
|
||||||
if base.config.GetBool('want-qa-regression', 0):
|
if base.config.GetBool('want-qa-regression', 0):
|
||||||
self.notify.info('QA-REGRESSION: CHAT: Whisper')
|
self.notify.info('QA-REGRESSION: CHAT: Whisper')
|
||||||
|
|
|
@ -8,7 +8,6 @@ from toontown.hood import ZoneUtil
|
||||||
from toontown.building import FADoorCodes
|
from toontown.building import FADoorCodes
|
||||||
from toontown.building import DoorTypes
|
from toontown.building import DoorTypes
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
|
class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
|
||||||
|
|
||||||
|
@ -81,14 +80,8 @@ class DistributedCogHQDoor(DistributedDoor.DistributedDoor):
|
||||||
self.doorX = 1.0
|
self.doorX = 1.0
|
||||||
|
|
||||||
def enterDoor(self):
|
def enterDoor(self):
|
||||||
if self.allowedToEnter():
|
messenger.send('DistributedDoor_doorTrigger')
|
||||||
messenger.send('DistributedDoor_doorTrigger')
|
self.sendUpdate('requestEnter')
|
||||||
self.sendUpdate('requestEnter')
|
|
||||||
else:
|
|
||||||
place = base.cr.playGame.getPlace()
|
|
||||||
if place:
|
|
||||||
place.fsm.request('stopped')
|
|
||||||
self.dialog = TeaserPanel.TeaserPanel(pageName='cogHQ', doneFunc=self.handleOkTeaser)
|
|
||||||
|
|
||||||
def doorTrigger(self, args = None):
|
def doorTrigger(self, args = None):
|
||||||
if localAvatar.hasActiveBoardingGroup():
|
if localAvatar.hasActiveBoardingGroup():
|
||||||
|
|
|
@ -208,7 +208,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.handler = self.handleMessageType
|
self.handler = self.handleMessageType
|
||||||
self.avChoiceDoneEvent = 'avatarChooserDone'
|
self.avChoiceDoneEvent = 'avatarChooserDone'
|
||||||
self.avChoice = AvatarChooser.AvatarChooser(avList, self.loginFSM, self.avChoiceDoneEvent)
|
self.avChoice = AvatarChooser.AvatarChooser(avList, self.loginFSM, self.avChoiceDoneEvent)
|
||||||
self.avChoice.load(self.isPaid())
|
self.avChoice.load()
|
||||||
self.avChoice.enter()
|
self.avChoice.enter()
|
||||||
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
|
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
|
||||||
return
|
return
|
||||||
|
|
|
@ -4,7 +4,6 @@ from direct.directnotify import DirectNotifyGlobal
|
||||||
from direct.showbase import PythonUtil
|
from direct.showbase import PythonUtil
|
||||||
from toontown.toonbase import ToontownBattleGlobals
|
from toontown.toonbase import ToontownBattleGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
import GardenGlobals
|
import GardenGlobals
|
||||||
import HouseGlobals
|
import HouseGlobals
|
||||||
|
@ -29,15 +28,11 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
|
||||||
self.needToLoad = 0
|
self.needToLoad = 0
|
||||||
self.backupFruits = []
|
self.backupFruits = []
|
||||||
self.signHasBeenStuck2Ground = False
|
self.signHasBeenStuck2Ground = False
|
||||||
self._teaserPanel = None
|
|
||||||
self.setName('DistributedGagTree')
|
self.setName('DistributedGagTree')
|
||||||
return
|
return
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
DistributedPlantBase.DistributedPlantBase.delete(self)
|
DistributedPlantBase.DistributedPlantBase.delete(self)
|
||||||
if self._teaserPanel:
|
|
||||||
self._teaserPanel.destroy()
|
|
||||||
self._teaserPanel = None
|
|
||||||
del self.prop
|
del self.prop
|
||||||
del self.prop2
|
del self.prop2
|
||||||
del self.dirtMound
|
del self.dirtMound
|
||||||
|
@ -130,12 +125,8 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
|
||||||
def handlePicking(self):
|
def handlePicking(self):
|
||||||
messenger.send('wakeup')
|
messenger.send('wakeup')
|
||||||
if self.isFruiting() and self.canBeHarvested():
|
if self.isFruiting() and self.canBeHarvested():
|
||||||
if self.velvetRoped():
|
self.startInteraction()
|
||||||
self._teaserPanel = TeaserPanel(pageName='pickGags')
|
self.doHarvesting()
|
||||||
localAvatar._gagTreeVelvetRoped = None
|
|
||||||
else:
|
|
||||||
self.startInteraction()
|
|
||||||
self.doHarvesting()
|
|
||||||
return
|
return
|
||||||
fullName = self.name
|
fullName = self.name
|
||||||
text = TTLocalizer.ConfirmRemoveTree % {'tree': fullName}
|
text = TTLocalizer.ConfirmRemoveTree % {'tree': fullName}
|
||||||
|
@ -355,10 +346,6 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
|
||||||
return Task.done
|
return Task.done
|
||||||
|
|
||||||
def canBeHarvested(self):
|
def canBeHarvested(self):
|
||||||
if not base.cr.isPaid():
|
|
||||||
if self.velvetRoped():
|
|
||||||
if hasattr(localAvatar, '_gagTreeVelvetRoped'):
|
|
||||||
return False
|
|
||||||
myTrack, myLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
|
myTrack, myLevel = GardenGlobals.getTreeTrackAndLevel(self.typeIndex)
|
||||||
levelsInTrack = []
|
levelsInTrack = []
|
||||||
levelTreeDict = {}
|
levelTreeDict = {}
|
||||||
|
@ -406,14 +393,8 @@ class DistributedGagTree(DistributedPlantBase.DistributedPlantBase):
|
||||||
self.finishInteraction()
|
self.finishInteraction()
|
||||||
return
|
return
|
||||||
|
|
||||||
def velvetRoped(self):
|
|
||||||
return not base.cr.isPaid() and ToontownBattleGlobals.gagIsPaidOnly(self.gagTrack, self.gagLevel)
|
|
||||||
|
|
||||||
def allowedToPick(self):
|
def allowedToPick(self):
|
||||||
retval = True
|
return True
|
||||||
if self.velvetRoped():
|
|
||||||
retval = False
|
|
||||||
return retval
|
|
||||||
|
|
||||||
def unlockPick(self):
|
def unlockPick(self):
|
||||||
retval = True
|
retval = True
|
||||||
|
|
|
@ -3,8 +3,6 @@ from direct.showbase.ShowBase import *
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
import string
|
import string
|
||||||
from direct.fsm import StateData
|
from direct.fsm import StateData
|
||||||
from toontown.toonbase.ToontownBattleGlobals import gagIsPaidOnly
|
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
|
|
||||||
class PlantTreeGUI(StateData.StateData):
|
class PlantTreeGUI(StateData.StateData):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('PlantTreeGUI')
|
notify = DirectNotifyGlobal.directNotify.newCategory('PlantTreeGUI')
|
||||||
|
@ -12,7 +10,6 @@ class PlantTreeGUI(StateData.StateData):
|
||||||
def __init__(self, doneEvent):
|
def __init__(self, doneEvent):
|
||||||
self.doneEvent = doneEvent
|
self.doneEvent = doneEvent
|
||||||
self.oldActivateMode = base.localAvatar.inventory.activateMode
|
self.oldActivateMode = base.localAvatar.inventory.activateMode
|
||||||
self._teaserPanel = None
|
|
||||||
base.localAvatar.inventory.setActivateMode('plantTree')
|
base.localAvatar.inventory.setActivateMode('plantTree')
|
||||||
base.localAvatar.inventory.show()
|
base.localAvatar.inventory.show()
|
||||||
self.accept('inventory-selection', self.__handleInventory)
|
self.accept('inventory-selection', self.__handleInventory)
|
||||||
|
@ -24,15 +21,9 @@ class PlantTreeGUI(StateData.StateData):
|
||||||
self.ignore('inventory-pass')
|
self.ignore('inventory-pass')
|
||||||
base.localAvatar.inventory.setActivateMode(self.oldActivateMode)
|
base.localAvatar.inventory.setActivateMode(self.oldActivateMode)
|
||||||
base.localAvatar.inventory.hide()
|
base.localAvatar.inventory.hide()
|
||||||
if self._teaserPanel:
|
|
||||||
self._teaserPanel.destroy()
|
|
||||||
self._teaserPanel = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def __handleInventory(self, track, level):
|
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:
|
if base.localAvatar.inventory.numItem(track, level) > 0:
|
||||||
messenger.send(self.doneEvent, [True, track, level])
|
messenger.send(self.doneEvent, [True, track, level])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -2,7 +2,6 @@ from pandac.PandaModules import *
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
import ZoneUtil
|
import ZoneUtil
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
class TrialerForceAcknowledge:
|
class TrialerForceAcknowledge:
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ class TrialerForceAcknowledge:
|
||||||
|
|
||||||
doneStatus['mode'] = 'fail'
|
doneStatus['mode'] = 'fail'
|
||||||
self.doneStatus = doneStatus
|
self.doneStatus = doneStatus
|
||||||
self.dialog = TeaserPanel.TeaserPanel(pageName='otherHoods', doneFunc=self.handleOk)
|
|
||||||
|
|
||||||
def exit(self):
|
def exit(self):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
|
|
|
@ -7,7 +7,6 @@ from toontown.toontowngui import TTDialog
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
NAME_ROTATIONS = (7, -11, 1, -5, 3.5, -5)
|
NAME_ROTATIONS = (7, -11, 1, -5, 3.5, -5)
|
||||||
NAME_POSITIONS = ((0, 0, 0.26),
|
NAME_POSITIONS = ((0, 0, 0.26),
|
||||||
(-0.03, 0, 0.25),
|
(-0.03, 0, 0.25),
|
||||||
|
@ -24,36 +23,25 @@ DELETE_POSITIONS = ((0.187, 0, -0.26),
|
||||||
|
|
||||||
class AvatarChoice(DirectButton):
|
class AvatarChoice(DirectButton):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('AvatarChoice')
|
notify = DirectNotifyGlobal.directNotify.newCategory('AvatarChoice')
|
||||||
NEW_TRIALER_OPEN_POS = (1,)
|
|
||||||
OLD_TRIALER_OPEN_POS = (1, 4)
|
|
||||||
MODE_CREATE = 0
|
MODE_CREATE = 0
|
||||||
MODE_CHOOSE = 1
|
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())
|
DirectButton.__init__(self, relief=None, text='', text_font=ToontownGlobals.getSignFont())
|
||||||
self.initialiseoptions(AvatarChoice)
|
self.initialiseoptions(AvatarChoice)
|
||||||
self.hasPaid = paid
|
|
||||||
self.mode = None
|
self.mode = None
|
||||||
if base.restrictTrialers and okToLockout:
|
if not av:
|
||||||
if position not in AvatarChoice.NEW_TRIALER_OPEN_POS:
|
self.mode = AvatarChoice.MODE_CREATE
|
||||||
if not self.hasPaid:
|
self.name = ''
|
||||||
self.mode = AvatarChoice.MODE_LOCKED
|
self.dna = None
|
||||||
self.name = ''
|
else:
|
||||||
self.dna = None
|
self.mode = AvatarChoice.MODE_CHOOSE
|
||||||
if self.mode is not AvatarChoice.MODE_LOCKED:
|
self.name = av.name
|
||||||
if not av:
|
self.dna = ToonDNA.ToonDNA(av.dna)
|
||||||
self.mode = AvatarChoice.MODE_CREATE
|
self.wantName = av.wantName
|
||||||
self.name = ''
|
self.approvedName = av.approvedName
|
||||||
self.dna = None
|
self.rejectedName = av.rejectedName
|
||||||
else:
|
self.allowedName = av.allowedName
|
||||||
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.position = position
|
||||||
self.doneEvent = 'avChoicePanel-' + str(self.position)
|
self.doneEvent = 'avChoicePanel-' + str(self.position)
|
||||||
self.deleteWithPasswordFrame = None
|
self.deleteWithPasswordFrame = None
|
||||||
|
@ -67,26 +55,7 @@ class AvatarChoice(DirectButton):
|
||||||
self.buttonBgs.append(self.pickAToonGui.find('**/tt_t_gui_pat_squareYellow'))
|
self.buttonBgs.append(self.pickAToonGui.find('**/tt_t_gui_pat_squareYellow'))
|
||||||
self['image'] = self.buttonBgs[position]
|
self['image'] = self.buttonBgs[position]
|
||||||
self.setScale(1.01)
|
self.setScale(1.01)
|
||||||
if self.mode is AvatarChoice.MODE_LOCKED:
|
if self.mode is AvatarChoice.MODE_CREATE:
|
||||||
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:
|
|
||||||
self['command'] = self.__handleCreate
|
self['command'] = self.__handleCreate
|
||||||
self['text'] = (TTLocalizer.AvatarChoiceMakeAToon,)
|
self['text'] = (TTLocalizer.AvatarChoiceMakeAToon,)
|
||||||
self['text_pos'] = (0, 0)
|
self['text_pos'] = (0, 0)
|
||||||
|
@ -117,7 +86,7 @@ class AvatarChoice(DirectButton):
|
||||||
elif self.rejectedName != '':
|
elif self.rejectedName != '':
|
||||||
self.nameYourToonButton.hide()
|
self.nameYourToonButton.hide()
|
||||||
self.statusText['text'] = TTLocalizer.AvatarChoiceNameRejected
|
self.statusText['text'] = TTLocalizer.AvatarChoiceNameRejected
|
||||||
elif self.allowedName == 1 and (base.cr.allowFreeNames() or self.hasPaid):
|
elif self.allowedName == 1:
|
||||||
self.nameYourToonButton.show()
|
self.nameYourToonButton.show()
|
||||||
self.statusText['text'] = ''
|
self.statusText['text'] = ''
|
||||||
else:
|
else:
|
||||||
|
@ -152,7 +121,7 @@ class AvatarChoice(DirectButton):
|
||||||
self.pickAToonGui.removeNode()
|
self.pickAToonGui.removeNode()
|
||||||
del self.pickAToonGui
|
del self.pickAToonGui
|
||||||
del self.dna
|
del self.dna
|
||||||
if self.mode in (AvatarChoice.MODE_CREATE, AvatarChoice.MODE_LOCKED):
|
if self.mode == AvatarChoice.MODE_CREATE:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.headModel.stopBlink()
|
self.headModel.stopBlink()
|
||||||
|
@ -267,6 +236,3 @@ class AvatarChoice(DirectButton):
|
||||||
def __handleDeleteWithPasswordCancel(self):
|
def __handleDeleteWithPasswordCancel(self):
|
||||||
self.deleteWithPasswordFrame.hide()
|
self.deleteWithPasswordFrame.hide()
|
||||||
base.transitions.noTransitions()
|
base.transitions.noTransitions()
|
||||||
|
|
||||||
def __handleTrialer(self):
|
|
||||||
TeaserPanel.TeaserPanel(pageName='sixToons')
|
|
||||||
|
|
|
@ -71,10 +71,9 @@ class AvatarChooser(StateData.StateData):
|
||||||
base.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
|
base.setBackgroundColor(ToontownGlobals.DefaultBackgroundColor)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def load(self, isPaid):
|
def load(self):
|
||||||
if self.isLoaded == 1:
|
if self.isLoaded == 1:
|
||||||
return None
|
return None
|
||||||
self.isPaid = isPaid
|
|
||||||
gui = loader.loadModel('phase_3/models/gui/pick_a_toon_gui')
|
gui = loader.loadModel('phase_3/models/gui/pick_a_toon_gui')
|
||||||
gui2 = loader.loadModel('phase_3/models/gui/quit_button')
|
gui2 = loader.loadModel('phase_3/models/gui/quit_button')
|
||||||
newGui = loader.loadModel('phase_3/models/gui/tt_m_gui_pat_mainGui')
|
newGui = loader.loadModel('phase_3/models/gui/tt_m_gui_pat_mainGui')
|
||||||
|
@ -94,20 +93,14 @@ class AvatarChooser(StateData.StateData):
|
||||||
self.panelList = []
|
self.panelList = []
|
||||||
used_position_indexs = []
|
used_position_indexs = []
|
||||||
for av in self.avatarList:
|
for av in self.avatarList:
|
||||||
if base.cr.isPaid():
|
panel = AvatarChoice.AvatarChoice(av, position=av.position)
|
||||||
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.setPos(POSITIONS[av.position])
|
panel.setPos(POSITIONS[av.position])
|
||||||
used_position_indexs.append(av.position)
|
used_position_indexs.append(av.position)
|
||||||
self.panelList.append(panel)
|
self.panelList.append(panel)
|
||||||
|
|
||||||
for panelNum in range(0, MAX_AVATARS):
|
for panelNum in range(0, MAX_AVATARS):
|
||||||
if panelNum not in used_position_indexs:
|
if panelNum not in used_position_indexs:
|
||||||
panel = AvatarChoice.AvatarChoice(position=panelNum, paid=isPaid)
|
panel = AvatarChoice.AvatarChoice(position=panelNum)
|
||||||
panel.setPos(POSITIONS[panelNum])
|
panel.setPos(POSITIONS[panelNum])
|
||||||
self.panelList.append(panel)
|
self.panelList.append(panel)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ from MakeAToonGlobals import *
|
||||||
import random
|
import random
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
import ShuffleButton
|
import ShuffleButton
|
||||||
|
|
||||||
class BodyShop(StateData.StateData):
|
class BodyShop(StateData.StateData):
|
||||||
|
@ -55,7 +54,6 @@ class BodyShop(StateData.StateData):
|
||||||
self.acceptOnce('last', self.__handleBackward)
|
self.acceptOnce('last', self.__handleBackward)
|
||||||
self.accept('next', self.__handleForward)
|
self.accept('next', self.__handleForward)
|
||||||
self.acceptOnce('MAT-newToonCreated', self.shuffleButton.cleanHistory)
|
self.acceptOnce('MAT-newToonCreated', self.shuffleButton.cleanHistory)
|
||||||
self.restrictHeadType(self.dna.head)
|
|
||||||
|
|
||||||
def getSpeciesStart(self):
|
def getSpeciesStart(self):
|
||||||
for species in ToonDNA.toonSpeciesTypes:
|
for species in ToonDNA.toonSpeciesTypes:
|
||||||
|
@ -68,7 +66,6 @@ class BodyShop(StateData.StateData):
|
||||||
|
|
||||||
def hideButtons(self):
|
def hideButtons(self):
|
||||||
self.parentFrame.hide()
|
self.parentFrame.hide()
|
||||||
self.memberButton.hide()
|
|
||||||
|
|
||||||
def exit(self):
|
def exit(self):
|
||||||
try:
|
try:
|
||||||
|
@ -93,8 +90,6 @@ class BodyShop(StateData.StateData):
|
||||||
shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown')
|
shuffleArrowDown = self.gui.find('**/tt_t_gui_mat_shuffleArrowDown')
|
||||||
shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp')
|
shuffleArrowRollover = self.gui.find('**/tt_t_gui_mat_shuffleArrowUp')
|
||||||
shuffleArrowDisabled = self.gui.find('**/tt_t_gui_mat_shuffleArrowDisabled')
|
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 = 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)
|
||||||
|
@ -134,12 +129,7 @@ class BodyShop(StateData.StateData):
|
||||||
shuffleArrowDown,
|
shuffleArrowDown,
|
||||||
shuffleArrowRollover,
|
shuffleArrowRollover,
|
||||||
shuffleArrowDisabled), image_scale=halfButtonInvertScale, image1_scale=halfButtonInvertHoverScale, image2_scale=halfButtonInvertHoverScale, pos=(0.2, 0, 0), command=self.__swapLegs, extraArgs=[1])
|
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.parentFrame.hide()
|
||||||
self.memberButton.hide()
|
|
||||||
self.shuffleFetchMsg = 'BodyShopShuffle'
|
self.shuffleFetchMsg = 'BodyShopShuffle'
|
||||||
self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg)
|
self.shuffleButton = ShuffleButton.ShuffleButton(self, self.shuffleFetchMsg)
|
||||||
return
|
return
|
||||||
|
@ -147,8 +137,6 @@ class BodyShop(StateData.StateData):
|
||||||
def unload(self):
|
def unload(self):
|
||||||
self.gui.removeNode()
|
self.gui.removeNode()
|
||||||
del self.gui
|
del self.gui
|
||||||
self.upsellModel.removeNode()
|
|
||||||
del self.upsellModel
|
|
||||||
self.parentFrame.destroy()
|
self.parentFrame.destroy()
|
||||||
self.speciesFrame.destroy()
|
self.speciesFrame.destroy()
|
||||||
self.headFrame.destroy()
|
self.headFrame.destroy()
|
||||||
|
@ -162,7 +150,6 @@ class BodyShop(StateData.StateData):
|
||||||
self.torsoRButton.destroy()
|
self.torsoRButton.destroy()
|
||||||
self.legLButton.destroy()
|
self.legLButton.destroy()
|
||||||
self.legRButton.destroy()
|
self.legRButton.destroy()
|
||||||
self.memberButton.destroy()
|
|
||||||
del self.parentFrame
|
del self.parentFrame
|
||||||
del self.speciesFrame
|
del self.speciesFrame
|
||||||
del self.headFrame
|
del self.headFrame
|
||||||
|
@ -176,7 +163,6 @@ class BodyShop(StateData.StateData):
|
||||||
del self.torsoRButton
|
del self.torsoRButton
|
||||||
del self.legLButton
|
del self.legLButton
|
||||||
del self.legRButton
|
del self.legRButton
|
||||||
del self.memberButton
|
|
||||||
self.shuffleButton.unload()
|
self.shuffleButton.unload()
|
||||||
self.ignore('MAT-newToonCreated')
|
self.ignore('MAT-newToonCreated')
|
||||||
|
|
||||||
|
@ -280,7 +266,6 @@ class BodyShop(StateData.StateData):
|
||||||
self.toon.swapToonHead(newHead)
|
self.toon.swapToonHead(newHead)
|
||||||
self.toon.loop('neutral', 0)
|
self.toon.loop('neutral', 0)
|
||||||
self.toon.swapToonColor(self.dna)
|
self.toon.swapToonColor(self.dna)
|
||||||
self.restrictHeadType(newHead)
|
|
||||||
|
|
||||||
def __updateScrollButtons(self, choice, length, start, lButton, rButton):
|
def __updateScrollButtons(self, choice, length, start, lButton, rButton):
|
||||||
if choice == (start - 1) % length:
|
if choice == (start - 1) % length:
|
||||||
|
@ -315,16 +300,6 @@ class BodyShop(StateData.StateData):
|
||||||
self.doneStatus = 'last'
|
self.doneStatus = 'last'
|
||||||
messenger.send(self.doneEvent)
|
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):
|
def changeBody(self):
|
||||||
newChoice = self.shuffleButton.getCurrChoice()
|
newChoice = self.shuffleButton.getCurrChoice()
|
||||||
newHead = newChoice[0]
|
newHead = newChoice[0]
|
||||||
|
@ -348,30 +323,19 @@ class BodyShop(StateData.StateData):
|
||||||
def __changeSpeciesName(self, species):
|
def __changeSpeciesName(self, species):
|
||||||
if species == 'd':
|
if species == 'd':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['dog']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['dog']
|
||||||
self.memberButton.hide()
|
|
||||||
elif species == 'c':
|
elif species == 'c':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['cat']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['cat']
|
||||||
self.memberButton.hide()
|
|
||||||
elif species == 'm':
|
elif species == 'm':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['mouse']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['mouse']
|
||||||
self.memberButton.hide()
|
|
||||||
elif species == 'h':
|
elif species == 'h':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['horse']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['horse']
|
||||||
self.memberButton.show()
|
|
||||||
elif species == 'r':
|
elif species == 'r':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['rabbit']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['rabbit']
|
||||||
self.memberButton.hide()
|
|
||||||
elif species == 'f':
|
elif species == 'f':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['duck']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['duck']
|
||||||
self.memberButton.hide()
|
|
||||||
elif species == 'p':
|
elif species == 'p':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['monkey']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['monkey']
|
||||||
self.memberButton.show()
|
|
||||||
elif species == 'b':
|
elif species == 'b':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['bear']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['bear']
|
||||||
self.memberButton.show()
|
|
||||||
elif species == 's':
|
elif species == 's':
|
||||||
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['pig']
|
self.speciesFrame['text'] = TTLocalizer.AnimalToSpecies['pig']
|
||||||
self.memberButton.hide()
|
|
||||||
if base.cr.isPaid():
|
|
||||||
self.memberButton.hide()
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import NameGenerator
|
||||||
import random
|
import random
|
||||||
from otp.distributed import PotentialAvatar
|
from otp.distributed import PotentialAvatar
|
||||||
from otp.namepanel import NameCheck
|
from otp.namepanel import NameCheck
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
from direct.distributed.PyDatagram import PyDatagram
|
from direct.distributed.PyDatagram import PyDatagram
|
||||||
from direct.showbase import PythonUtil
|
from direct.showbase import PythonUtil
|
||||||
from toontown.toon import NPCToons
|
from toontown.toon import NPCToons
|
||||||
|
@ -751,14 +750,6 @@ class NameShop(StateData.StateData):
|
||||||
self.nameEntry['focus'] = 1
|
self.nameEntry['focus'] = 1
|
||||||
|
|
||||||
def __typeAName(self):
|
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':
|
if self.fsm.getCurrentState().getName() == 'TypeAName':
|
||||||
self.typeANameButton['text'] = TTLocalizer.TypeANameButton
|
self.typeANameButton['text'] = TTLocalizer.TypeANameButton
|
||||||
self.typeANameButton.wrtReparentTo(self.namePanel, sort=2)
|
self.typeANameButton.wrtReparentTo(self.namePanel, sort=2)
|
||||||
|
|
|
@ -8,7 +8,6 @@ from direct.task import Task
|
||||||
from direct.fsm import State
|
from direct.fsm import State
|
||||||
from direct.fsm import ClassicFSM, State
|
from direct.fsm import ClassicFSM, State
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
|
|
||||||
class PurchaseBase(StateData.StateData):
|
class PurchaseBase(StateData.StateData):
|
||||||
activateMode = 'purchase'
|
activateMode = 'purchase'
|
||||||
|
@ -33,13 +32,9 @@ class PurchaseBase(StateData.StateData):
|
||||||
if self.toon.getMoney() == 1:
|
if self.toon.getMoney() == 1:
|
||||||
self.statusLabel['text'] = TTLocalizer.GagShopYouHaveOne
|
self.statusLabel['text'] = TTLocalizer.GagShopYouHaveOne
|
||||||
self.isBroke = 0
|
self.isBroke = 0
|
||||||
self._teaserPanel = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
if self._teaserPanel:
|
|
||||||
self._teaserPanel.destroy()
|
|
||||||
self._teaserPanel = None
|
|
||||||
self.jarImage.removeNode()
|
self.jarImage.removeNode()
|
||||||
del self.jarImage
|
del self.jarImage
|
||||||
self.frame.destroy()
|
self.frame.destroy()
|
||||||
|
@ -52,17 +47,8 @@ class PurchaseBase(StateData.StateData):
|
||||||
return
|
return
|
||||||
|
|
||||||
def __handleSelection(self, track, level):
|
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)
|
self.handlePurchase(track, level)
|
||||||
|
|
||||||
def _teaserDone(self):
|
|
||||||
self._teaserPanel.destroy()
|
|
||||||
self._teaserPanel = None
|
|
||||||
return
|
|
||||||
|
|
||||||
def handlePurchase(self, track, level):
|
def handlePurchase(self, track, level):
|
||||||
if self.toon.getMoney() <= 0:
|
if self.toon.getMoney() <= 0:
|
||||||
return
|
return
|
||||||
|
|
|
@ -28,7 +28,6 @@ from toontown.toon import ToonHead
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class PartyPlanner(DirectFrame, FSM):
|
class PartyPlanner(DirectFrame, FSM):
|
||||||
|
|
|
@ -12,7 +12,6 @@ from toontown.toonbase import TTLocalizer
|
||||||
import string, types
|
import string, types
|
||||||
from toontown.toon import LaffMeter
|
from toontown.toon import LaffMeter
|
||||||
from toontown.toonbase.ToontownBattleGlobals import AvPropsNew
|
from toontown.toonbase.ToontownBattleGlobals import AvPropsNew
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from otp.otpbase import OTPLocalizer
|
from otp.otpbase import OTPLocalizer
|
||||||
|
@ -265,15 +264,8 @@ class QuestPoster(DirectFrame):
|
||||||
guiButton.removeNode()
|
guiButton.removeNode()
|
||||||
npcZone = NPCToons.getNPCZone(toNpcId)
|
npcZone = NPCToons.getNPCZone(toNpcId)
|
||||||
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
|
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
|
||||||
if not base.cr.isPaid() and (questId == 401 or hasattr(quest, 'getLocation') and quest.getLocation() == 1000 or hoodId == 1000):
|
self.chooseButton['command'] = callback
|
||||||
|
self.chooseButton['extraArgs'] = [questId]
|
||||||
def showTeaserPanel():
|
|
||||||
TeaserPanel(pageName='getGags')
|
|
||||||
|
|
||||||
self.chooseButton['command'] = showTeaserPanel
|
|
||||||
else:
|
|
||||||
self.chooseButton['command'] = callback
|
|
||||||
self.chooseButton['extraArgs'] = [questId]
|
|
||||||
self.unbind(DGG.WITHIN)
|
self.unbind(DGG.WITHIN)
|
||||||
self.unbind(DGG.WITHOUT)
|
self.unbind(DGG.WITHOUT)
|
||||||
if not quest.getType() == Quests.TrackChoiceQuest:
|
if not quest.getType() == Quests.TrackChoiceQuest:
|
||||||
|
|
|
@ -21,7 +21,6 @@ from toontown.racing.Kart import Kart
|
||||||
from toontown.racing.KartShopGlobals import KartGlobals
|
from toontown.racing.KartShopGlobals import KartGlobals
|
||||||
from toontown.racing import RaceGlobals
|
from toontown.racing import RaceGlobals
|
||||||
from toontown.toontowngui.TTDialog import TTGlobalDialog
|
from toontown.toontowngui.TTDialog import TTGlobalDialog
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
if (__debug__):
|
if (__debug__):
|
||||||
import pdb
|
import pdb
|
||||||
|
|
||||||
|
@ -219,8 +218,6 @@ class DistributedStartingBlock(DistributedObject.DistributedObject, FSM):
|
||||||
self.dialog = TTGlobalDialog(msg, doneEvent, 2)
|
self.dialog = TTGlobalDialog(msg, doneEvent, 2)
|
||||||
self.dialog.accept(doneEvent, handleTicketError)
|
self.dialog.accept(doneEvent, handleTicketError)
|
||||||
self.accept('stoppedAsleep', handleTicketError)
|
self.accept('stoppedAsleep', handleTicketError)
|
||||||
elif errCode == KartGlobals.ERROR_CODE.eUnpaid:
|
|
||||||
self.dialog = TeaserPanel(pageName='karting', doneFunc=handleTicketError)
|
|
||||||
else:
|
else:
|
||||||
self.cr.playGame.getPlace().setState('walk')
|
self.cr.playGame.getPlace().setState('walk')
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,9 @@ from KartShopGlobals import *
|
||||||
from toontown.racing.Kart import Kart
|
from toontown.racing.Kart import Kart
|
||||||
from toontown.shtiker.KartPage import KartViewer
|
from toontown.shtiker.KartPage import KartViewer
|
||||||
from KartDNA import *
|
from KartDNA import *
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
if (__debug__):
|
if (__debug__):
|
||||||
import pdb
|
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)
|
MM_OPTIONS = PythonUtil.Enum('Cancel, BuyAccessory, BuyKart', -1)
|
||||||
BK_OPTIONS = PythonUtil.Enum('Cancel, BuyKart', -1)
|
BK_OPTIONS = PythonUtil.Enum('Cancel, BuyKart', -1)
|
||||||
BA_OPTIONS = PythonUtil.Enum('Cancel, BuyAccessory', -1)
|
BA_OPTIONS = PythonUtil.Enum('Cancel, BuyAccessory', -1)
|
||||||
|
@ -515,12 +514,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
|
||||||
text_scale=KS_TEXT_SIZE_SMALL,
|
text_scale=KS_TEXT_SIZE_SMALL,
|
||||||
pressEffect=False,
|
pressEffect=False,
|
||||||
command=self.__handleBuyAccessory)
|
command=self.__handleBuyAccessory)
|
||||||
if not base.cr.isPaid():
|
|
||||||
|
|
||||||
def showTeaserPanel():
|
|
||||||
TeaserPanel(pageName='kartingAccessories')
|
|
||||||
|
|
||||||
self.buyAccessoryButton['command'] = showTeaserPanel
|
|
||||||
self.ownedAccList = base.localAvatar.getKartAccessoriesOwned()
|
self.ownedAccList = base.localAvatar.getKartAccessoriesOwned()
|
||||||
while -1 in self.ownedAccList:
|
while -1 in self.ownedAccList:
|
||||||
self.ownedAccList.remove(-1)
|
self.ownedAccList.remove(-1)
|
||||||
|
@ -786,8 +779,7 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
|
||||||
MENUS.ConfirmBuyKart: ('ConfirmBuyKartGuiDone', self.__handleConfirmBuyKartDlg, self.ConfirmBuyKartDlg),
|
MENUS.ConfirmBuyKart: ('ConfirmBuyKartGuiDone', self.__handleConfirmBuyKartDlg, self.ConfirmBuyKartDlg),
|
||||||
MENUS.ConfirmBuyAccessory: ('ConfirmBuyAccessoryGuiDone', self.__handleConfirmBuyAccessoryDlg, self.ConfirmBuyAccessoryDlg),
|
MENUS.ConfirmBuyAccessory: ('ConfirmBuyAccessoryGuiDone', self.__handleConfirmBuyAccessoryDlg, self.ConfirmBuyAccessoryDlg),
|
||||||
MENUS.BoughtKart: ('BoughtKartGuiDone', self.__handleBoughtKartDlg, self.BoughtKartDlg),
|
MENUS.BoughtKart: ('BoughtKartGuiDone', self.__handleBoughtKartDlg, self.BoughtKartDlg),
|
||||||
MENUS.BoughtAccessory: ('BoughtAccessoryGuiDone', self.__handleBoughtAccessoryDlg, self.BoughtAccessoryDlg),
|
MENUS.BoughtAccessory: ('BoughtAccessoryGuiDone', self.__handleBoughtAccessoryDlg, self.BoughtAccessoryDlg)}
|
||||||
MENUS.TeaserPanel: ('UnpaidPurchaseAttempt', self.__handleTeaserPanelDlg, TeaserPanel)}
|
|
||||||
self.kartID = -1
|
self.kartID = -1
|
||||||
self.accID = -1
|
self.accID = -1
|
||||||
self.timer = ToontownTimer.ToontownTimer()
|
self.timer = ToontownTimer.ToontownTimer()
|
||||||
|
@ -857,9 +849,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
|
||||||
self.__doDialog(self.dialogStack[-1])
|
self.__doDialog(self.dialogStack[-1])
|
||||||
return
|
return
|
||||||
|
|
||||||
def __doLastMenu(self):
|
|
||||||
self.__doDialog(self.lastMenu)
|
|
||||||
|
|
||||||
def __doDialog(self, dialogType):
|
def __doDialog(self, dialogType):
|
||||||
self.__destroyDialog()
|
self.__destroyDialog()
|
||||||
messenger.send('wakeup')
|
messenger.send('wakeup')
|
||||||
|
@ -876,12 +865,9 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
|
||||||
self.dialog = eventDlg(eventType, self.accID)
|
self.dialog = eventDlg(eventType, self.accID)
|
||||||
elif dialogType == MENUS.BoughtAccessory:
|
elif dialogType == MENUS.BoughtAccessory:
|
||||||
self.dialog = eventDlg(eventType, self.accID)
|
self.dialog = eventDlg(eventType, self.accID)
|
||||||
elif dialogType == MENUS.TeaserPanel:
|
|
||||||
self.dialog = eventDlg(pageName='karting', doneFunc=self.__doLastMenu)
|
|
||||||
else:
|
else:
|
||||||
self.dialog = eventDlg(eventType)
|
self.dialog = eventDlg(eventType)
|
||||||
if not dialogType == MENUS.TeaserPanel:
|
self.lastMenu = dialogType
|
||||||
self.lastMenu = dialogType
|
|
||||||
|
|
||||||
def __handleMainMenuDlg(self, exitType, args = []):
|
def __handleMainMenuDlg(self, exitType, args = []):
|
||||||
self.notify.debug('__handleMainMenuDlg: Handling MainMenu Dialog Selection.')
|
self.notify.debug('__handleMainMenuDlg: Handling MainMenu Dialog Selection.')
|
||||||
|
@ -904,9 +890,6 @@ class KartShopGuiMgr(object, DirectObject.DirectObject):
|
||||||
self.accID = -1
|
self.accID = -1
|
||||||
self.__doDialog(MENUS.BuyAccessory)
|
self.__doDialog(MENUS.BuyAccessory)
|
||||||
|
|
||||||
def __handleTeaserPanelDlg(self):
|
|
||||||
self.__doDialog(MENUS.TeaserPanel)
|
|
||||||
|
|
||||||
def __handleBuyKartDlg(self, exitType, args = []):
|
def __handleBuyKartDlg(self, exitType, args = []):
|
||||||
self.notify.debug('__handleBuyKartDlg: Handling BuyKart Dialog Selection.')
|
self.notify.debug('__handleBuyKartDlg: Handling BuyKart Dialog Selection.')
|
||||||
if exitType == BK_OPTIONS.Cancel:
|
if exitType == BK_OPTIONS.Cancel:
|
||||||
|
|
|
@ -25,7 +25,6 @@ from toontown.toonbase import ToontownTimer
|
||||||
from direct.fsm import ClassicFSM, State
|
from direct.fsm import ClassicFSM, State
|
||||||
from direct.fsm import State
|
from direct.fsm import State
|
||||||
from toontown.hood import ZoneUtil
|
from toontown.hood import ZoneUtil
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
class DistributedFishingSpot(DistributedObject.DistributedObject):
|
class DistributedFishingSpot(DistributedObject.DistributedObject):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedFishingSpot')
|
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedFishingSpot')
|
||||||
|
@ -162,31 +161,13 @@ class DistributedFishingSpot(DistributedObject.DistributedObject):
|
||||||
self.area = self.pond.getArea()
|
self.area = self.pond.getArea()
|
||||||
self.waterLevel = FishingTargetGlobals.getWaterLevel(self.area)
|
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):
|
def __handleEnterSphere(self, collEntry):
|
||||||
if self.allowedToEnter():
|
if base.localAvatar.doId == self.lastAvId and globalClock.getFrameCount() <= self.lastFrame + 1:
|
||||||
if base.localAvatar.doId == self.lastAvId and globalClock.getFrameCount() <= self.lastFrame + 1:
|
self.notify.debug('Ignoring duplicate entry for avatar.')
|
||||||
self.notify.debug('Ignoring duplicate entry for avatar.')
|
return
|
||||||
return
|
if base.localAvatar.hp > 0 and base.cr.playGame.getPlace().fsm.getCurrentState().getName() != 'fishing':
|
||||||
if base.localAvatar.hp > 0 and base.cr.playGame.getPlace().fsm.getCurrentState().getName() != 'fishing':
|
self.cr.playGame.getPlace().detectedFishingCollision()
|
||||||
self.cr.playGame.getPlace().detectedFishingCollision()
|
self.d_requestEnter()
|
||||||
self.d_requestEnter()
|
|
||||||
else:
|
|
||||||
place = base.cr.playGame.getPlace()
|
|
||||||
if place:
|
|
||||||
place.fsm.request('stopped')
|
|
||||||
self.dialog = TeaserPanel.TeaserPanel(pageName='fishing', doneFunc=self.handleOkTeaser)
|
|
||||||
|
|
||||||
def d_requestEnter(self):
|
def d_requestEnter(self):
|
||||||
self.sendUpdate('requestEnter', [])
|
self.sendUpdate('requestEnter', [])
|
||||||
|
|
|
@ -12,7 +12,6 @@ from direct.fsm import State
|
||||||
from toontown.distributed import DelayDelete
|
from toontown.distributed import DelayDelete
|
||||||
from direct.task.Task import Task
|
from direct.task.Task import Task
|
||||||
from direct.showbase import PythonUtil
|
from direct.showbase import PythonUtil
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
from toontown.toon import ToonDNA
|
from toontown.toon import ToonDNA
|
||||||
from toontown.hood import ZoneUtil
|
from toontown.hood import ZoneUtil
|
||||||
|
|
||||||
|
@ -122,27 +121,9 @@ class DistributedGolfKart(DistributedObject.DistributedObject):
|
||||||
self.notify.debug('Entering Trolley Sphere....')
|
self.notify.debug('Entering Trolley Sphere....')
|
||||||
self.loader.place.detectedTrolleyCollision()
|
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):
|
def handleEnterGolfKartSphere(self, collEntry):
|
||||||
self.notify.debug('Entering Golf Kart Sphere.... %s' % self.getDoId())
|
self.notify.debug('Entering Golf Kart Sphere.... %s' % self.getDoId())
|
||||||
if self.allowedToEnter():
|
self.loader.place.detectedGolfKartCollision(self)
|
||||||
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')
|
|
||||||
|
|
||||||
def handleEnterTrolley(self):
|
def handleEnterTrolley(self):
|
||||||
toon = base.localAvatar
|
toon = base.localAvatar
|
||||||
|
|
|
@ -11,7 +11,6 @@ from direct.fsm import State
|
||||||
from toontown.distributed import DelayDelete
|
from toontown.distributed import DelayDelete
|
||||||
from direct.task.Task import Task
|
from direct.task.Task import Task
|
||||||
from toontown.hood import ZoneUtil
|
from toontown.hood import ZoneUtil
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
class DistributedTrolley(DistributedObject.DistributedObject):
|
class DistributedTrolley(DistributedObject.DistributedObject):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrolley')
|
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedTrolley')
|
||||||
|
@ -162,29 +161,11 @@ class DistributedTrolley(DistributedObject.DistributedObject):
|
||||||
def setState(self, state, timestamp):
|
def setState(self, state, timestamp):
|
||||||
self.fsm.request(state, [globalClockDelta.localElapsedTime(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):
|
def handleEnterTrolleySphere(self, collEntry):
|
||||||
self.notify.debug('Entering Trolley Sphere....')
|
self.notify.debug('Entering Trolley Sphere....')
|
||||||
if base.localAvatar.getPos(render).getZ() < self.trolleyCar.getPos(render).getZ():
|
if base.localAvatar.getPos(render).getZ() < self.trolleyCar.getPos(render).getZ():
|
||||||
return
|
return
|
||||||
if self.allowedToEnter():
|
self.loader.place.detectedTrolleyCollision()
|
||||||
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)
|
|
||||||
|
|
||||||
def handleEnterTrolley(self):
|
def handleEnterTrolley(self):
|
||||||
toon = base.localAvatar
|
toon = base.localAvatar
|
||||||
|
|
|
@ -10,7 +10,6 @@ from toontown.minigame import ClerkPurchase
|
||||||
from toontown.nametag.NametagGlobals import *
|
from toontown.nametag.NametagGlobals import *
|
||||||
from toontown.shtiker.PurchaseManagerConstants import *
|
from toontown.shtiker.PurchaseManagerConstants import *
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedNPCClerk(DistributedNPCToonBase):
|
class DistributedNPCClerk(DistributedNPCToonBase):
|
||||||
|
@ -35,16 +34,6 @@ class DistributedNPCClerk(DistributedNPCToonBase):
|
||||||
|
|
||||||
DistributedNPCToonBase.disable(self)
|
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):
|
def handleCollisionSphereEnter(self, collEntry):
|
||||||
base.cr.playGame.getPlace().fsm.request('purchase')
|
base.cr.playGame.getPlace().fsm.request('purchase')
|
||||||
self.sendUpdate('avatarEnter', [])
|
self.sendUpdate('avatarEnter', [])
|
||||||
|
|
|
@ -14,14 +14,8 @@ class DistributedNPCFlippyInToonHall(DistributedNPCToon):
|
||||||
self.setScale(1.25)
|
self.setScale(1.25)
|
||||||
|
|
||||||
def handleCollisionSphereEnter(self, collEntry):
|
def handleCollisionSphereEnter(self, collEntry):
|
||||||
if self.allowedToTalk():
|
base.cr.playGame.getPlace().fsm.request('quest', [self])
|
||||||
base.cr.playGame.getPlace().fsm.request('quest', [self])
|
self.sendUpdate('avatarEnter', [])
|
||||||
self.sendUpdate('avatarEnter', [])
|
self.nametag3d.setDepthTest(0)
|
||||||
self.nametag3d.setDepthTest(0)
|
self.nametag3d.setBin('fixed', 0)
|
||||||
self.nametag3d.setBin('fixed', 0)
|
self.lookAt(base.localAvatar)
|
||||||
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)
|
|
|
@ -11,7 +11,6 @@ from toontown.toon import NPCToons
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedNPCPartyPerson(DistributedNPCToonBase):
|
class DistributedNPCPartyPerson(DistributedNPCToonBase):
|
||||||
|
@ -21,7 +20,6 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
|
||||||
self.av = None
|
self.av = None
|
||||||
self.button = None
|
self.button = None
|
||||||
self.askGui = None
|
self.askGui = None
|
||||||
self.teaserDialog = None
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
|
@ -94,8 +92,7 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
|
||||||
self.detectAvatars()
|
self.detectAvatars()
|
||||||
self.clearMat()
|
self.clearMat()
|
||||||
if self.isInteractingWithLocalToon:
|
if self.isInteractingWithLocalToon:
|
||||||
if hasattr(self, 'teaserDialog') and not self.teaserDialog:
|
self.freeAvatar()
|
||||||
self.freeAvatar()
|
|
||||||
return Task.done
|
return Task.done
|
||||||
|
|
||||||
def setMovie(self, mode, npcId, avId, extraArgs, timestamp):
|
def setMovie(self, mode, npcId, avId, extraArgs, timestamp):
|
||||||
|
@ -180,28 +177,10 @@ class DistributedNPCPartyPerson(DistributedNPCToonBase):
|
||||||
|
|
||||||
def __handleAskDone(self):
|
def __handleAskDone(self):
|
||||||
self.ignore(self.planPartyQuestionGuiDoneEvent)
|
self.ignore(self.planPartyQuestionGuiDoneEvent)
|
||||||
doneStatus = self.askGui.doneStatus
|
self.sendUpdate('answer', [self.askGui.doneStatus == 'ok'])
|
||||||
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.askGui.hide()
|
self.askGui.hide()
|
||||||
|
|
||||||
def popupAskGUI(self, task):
|
def popupAskGUI(self, task):
|
||||||
self.setChatAbsolute('', CFSpeech)
|
self.setChatAbsolute('', CFSpeech)
|
||||||
self.acceptOnce(self.planPartyQuestionGuiDoneEvent, self.__handleAskDone)
|
self.acceptOnce(self.planPartyQuestionGuiDoneEvent, self.__handleAskDone)
|
||||||
self.askGui.show()
|
self.askGui.show()
|
||||||
|
|
||||||
def handleOkTeaser(self):
|
|
||||||
self.teaserDialog.destroy()
|
|
||||||
del self.teaserDialog
|
|
||||||
place = base.cr.playGame.getPlace()
|
|
||||||
if place:
|
|
||||||
place.fsm.request('walk')
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ from toontown.hood import ZoneUtil
|
||||||
from toontown.nametag.NametagGlobals import *
|
from toontown.nametag.NametagGlobals import *
|
||||||
from toontown.pets import PetshopGUI
|
from toontown.pets import PetshopGUI
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
class DistributedNPCPetclerk(DistributedNPCToonBase):
|
class DistributedNPCPetclerk(DistributedNPCToonBase):
|
||||||
|
@ -52,16 +51,6 @@ class DistributedNPCPetclerk(DistributedNPCToonBase):
|
||||||
def getCollSphereRadius(self):
|
def getCollSphereRadius(self):
|
||||||
return 4.0
|
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):
|
def handleCollisionSphereEnter(self, collEntry):
|
||||||
base.cr.playGame.getPlace().fsm.request('purchase')
|
base.cr.playGame.getPlace().fsm.request('purchase')
|
||||||
self.sendUpdate('avatarEnter', [])
|
self.sendUpdate('avatarEnter', [])
|
||||||
|
|
|
@ -9,7 +9,6 @@ from toontown.quest import QuestChoiceGui
|
||||||
from toontown.quest import QuestParser
|
from toontown.quest import QuestParser
|
||||||
from toontown.quest import TrackChoiceGui
|
from toontown.quest import TrackChoiceGui
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
ChoiceTimeout = 20
|
ChoiceTimeout = 20
|
||||||
|
@ -75,13 +74,6 @@ class DistributedNPCSpecialQuestGiver(DistributedNPCToonBase):
|
||||||
self.nametag3d.setDepthTest(0)
|
self.nametag3d.setDepthTest(0)
|
||||||
self.nametag3d.setBin('fixed', 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):
|
def finishMovie(self, av, isLocalToon, elapsedTime):
|
||||||
self.cleanupMovie()
|
self.cleanupMovie()
|
||||||
av.startLookAround()
|
av.startLookAround()
|
||||||
|
|
|
@ -9,7 +9,6 @@ from toontown.quest import QuestChoiceGui
|
||||||
from toontown.quest import QuestParser
|
from toontown.quest import QuestParser
|
||||||
from toontown.quest import TrackChoiceGui
|
from toontown.quest import TrackChoiceGui
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
ChoiceTimeout = 20
|
ChoiceTimeout = 20
|
||||||
|
@ -61,13 +60,6 @@ class DistributedNPCToon(DistributedNPCToonBase):
|
||||||
self.nametag3d.setDepthTest(0)
|
self.nametag3d.setDepthTest(0)
|
||||||
self.nametag3d.setBin('fixed', 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):
|
def finishMovie(self, av, isLocalToon, elapsedTime):
|
||||||
self.cleanupMovie()
|
self.cleanupMovie()
|
||||||
av.startLookAround()
|
av.startLookAround()
|
||||||
|
|
|
@ -8,7 +8,6 @@ from toontown.quest import QuestChoiceGui
|
||||||
from toontown.quest import QuestParser
|
from toontown.quest import QuestParser
|
||||||
from toontown.quest import TrackChoiceGui
|
from toontown.quest import TrackChoiceGui
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toontowngui import TeaserPanel
|
|
||||||
|
|
||||||
|
|
||||||
SPAMMING = 1
|
SPAMMING = 1
|
||||||
|
|
|
@ -13,10 +13,7 @@ import ToonAvatarDetailPanel
|
||||||
import AvatarPanelBase
|
import AvatarPanelBase
|
||||||
import PlayerDetailPanel
|
import PlayerDetailPanel
|
||||||
from otp.otpbase import OTPGlobals
|
from otp.otpbase import OTPGlobals
|
||||||
GAME_LOGO_NAMES = {'Default': 'GameLogo_Unknown',
|
GAME_LOGO_NAMES = {'Default': 'GameLogo_Toontown'}
|
||||||
'Disney XD': 'GameLogo_XD',
|
|
||||||
'Toontown': 'GameLogo_Toontown',
|
|
||||||
'Pirates': 'GameLogo_Pirates'}
|
|
||||||
GAME_LOGO_FILE = 'phase_3/models/misc/game_logo_card'
|
GAME_LOGO_FILE = 'phase_3/models/misc/game_logo_card'
|
||||||
|
|
||||||
class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase):
|
class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase):
|
||||||
|
|
|
@ -4040,36 +4040,6 @@ DownloadForceAcknowledgeVerbList = ['painted',
|
||||||
'inflated',
|
'inflated',
|
||||||
'built']
|
'built']
|
||||||
DownloadForceAcknowledgeMsg = 'Sorry, the %(phase)s area is still being %(verb)s, and will be ready for you in a minute.'
|
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',
|
LauncherPhaseNames = {0: 'Initialization',
|
||||||
1: 'Panda',
|
1: 'Panda',
|
||||||
2: 'Engine',
|
2: 'Engine',
|
||||||
|
@ -6963,7 +6933,6 @@ CatalogPurchasedGiftText = 'Already\nOwned'
|
||||||
CatalogMailboxFull = 'No Room'
|
CatalogMailboxFull = 'No Room'
|
||||||
CatalogNotAGift = 'Not a Gift'
|
CatalogNotAGift = 'Not a Gift'
|
||||||
CatalogNoFit = "Doesn't\nFit"
|
CatalogNoFit = "Doesn't\nFit"
|
||||||
CatalogMembersOnly = 'Members\nOnly!'
|
|
||||||
CatalogSndOnText = 'Snd On'
|
CatalogSndOnText = 'Snd On'
|
||||||
CatalogSndOffText = 'Snd Off'
|
CatalogSndOffText = 'Snd Off'
|
||||||
CatalogPurchasedMaxText = 'Already\nPurchased Max'
|
CatalogPurchasedMaxText = 'Already\nPurchased Max'
|
||||||
|
|
|
@ -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
|
|
|
@ -2,8 +2,6 @@ from pandac.PandaModules import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
import string
|
import string
|
||||||
from direct.fsm import StateData
|
from direct.fsm import StateData
|
||||||
from toontown.toontowngui.TeaserPanel import TeaserPanel
|
|
||||||
from toontown.toonbase.ToontownBattleGlobals import gagIsPaidOnly
|
|
||||||
AttackPanelHidden = 0
|
AttackPanelHidden = 0
|
||||||
|
|
||||||
def hideAttackPanel(flag):
|
def hideAttackPanel(flag):
|
||||||
|
@ -26,7 +24,6 @@ class TownBattleAttackPanel(StateData.StateData):
|
||||||
|
|
||||||
def enter(self):
|
def enter(self):
|
||||||
StateData.StateData.enter(self)
|
StateData.StateData.enter(self)
|
||||||
self._teaserPanel = None
|
|
||||||
if not AttackPanelHidden:
|
if not AttackPanelHidden:
|
||||||
base.localAvatar.inventory.show()
|
base.localAvatar.inventory.show()
|
||||||
self.accept('inventory-selection', self.__handleInventory)
|
self.accept('inventory-selection', self.__handleInventory)
|
||||||
|
@ -46,9 +43,6 @@ class TownBattleAttackPanel(StateData.StateData):
|
||||||
self.ignore('inventory-fire')
|
self.ignore('inventory-fire')
|
||||||
self.ignore('hide-attack-panel')
|
self.ignore('hide-attack-panel')
|
||||||
base.localAvatar.inventory.hide()
|
base.localAvatar.inventory.hide()
|
||||||
if self._teaserPanel:
|
|
||||||
self._teaserPanel.destroy()
|
|
||||||
del self._teaserPanel
|
|
||||||
|
|
||||||
def __handleRun(self):
|
def __handleRun(self):
|
||||||
doneStatus = {'mode': 'Run'}
|
doneStatus = {'mode': 'Run'}
|
||||||
|
@ -67,9 +61,6 @@ class TownBattleAttackPanel(StateData.StateData):
|
||||||
messenger.send(self.doneEvent, [doneStatus])
|
messenger.send(self.doneEvent, [doneStatus])
|
||||||
|
|
||||||
def __handleInventory(self, track, level):
|
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:
|
if base.localAvatar.inventory.numItem(track, level) > 0:
|
||||||
doneStatus = {}
|
doneStatus = {}
|
||||||
doneStatus['mode'] = 'Inventory'
|
doneStatus['mode'] = 'Inventory'
|
||||||
|
|
Loading…
Reference in a new issue