This commit is contained in:
John 2015-07-17 17:51:43 +03:00
parent 2de7c4d6ca
commit 50297ca489
13 changed files with 19 additions and 115 deletions

View file

@ -594,7 +594,6 @@ dclass DistributedToon : DistributedPlayer {
setMaxClothes(uint32 = 10) required ownrecv db;
setClothesTopsList(uint8[] = []) required ownrecv db;
setClothesBottomsList(uint8[] = []) required ownrecv db;
setMaxAccessories(uint32 = 0) required ownrecv db;
setHatList(uint8[] = []) required ownrecv db;
setGlassesList(uint8[] = []) required ownrecv db;
setBackpackList(uint8[] = []) required ownrecv db;

View file

@ -120,9 +120,6 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def recordPurchase(self, avatar, optional):
if avatar.isTrunkFull():
if avatar.getMaxAccessories() == 0:
return ToontownGlobals.P_NoTrunk
else:
return ToontownGlobals.P_NoRoomForItem
str = AccessoryTypes[self.accessoryType][ATString]
if self.isHat():
@ -269,9 +266,6 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
if avatar.isTrunkFull(accessoriesOnOrder):
self.requestPurchaseCleanup()
buttonCallback = PythonUtil.Functor(self.__handleFullPurchaseDialog, phone, callback)
if avatar.getMaxAccessories() == 0:
text = TTLocalizer.CatalogPurchaseNoTrunk
else:
text = TTLocalizer.CatalogPurchaseTrunkFull
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=text, text_wordwrap=15, command=buttonCallback)
self.dialog.show()
@ -303,8 +297,6 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
return TTLocalizer.CatalogAcceptShoes
elif retcode == ToontownGlobals.P_NoRoomForItem:
return TTLocalizer.CatalogAcceptTrunkFull
elif retcode == ToontownGlobals.P_NoTrunk:
return TTLocalizer.CatalogAcceptNoTrunk
return CatalogItem.CatalogItem.getAcceptItemErrorText(self, retcode)
def isHat(self):

View file

@ -70,7 +70,6 @@ for closetId, maxClothes in ClosetToClothes.items():
ClothesToCloset[maxClothes] += (closetId,)
MaxClosetIds = (508, 518)
MaxTrunkIds = (4000, 4010)
TvToPosScale = {
1530: ((-1.15, -0.5, 1.1), (2.5, 1.7, 1.4)),
@ -910,7 +909,7 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
return 1
def replacesExisting(self):
return self.getFlags() & (FLCloset | FLBank | FLTrunk) != 0
return self.getFlags() & (FLCloset | FLBank) != 0
def hasExisting(self):
return 1
@ -920,16 +919,14 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
return TTLocalizer.FurnitureYourOldCloset
elif self.getFlags() & FLBank:
return TTLocalizer.FurnitureYourOldBank
elif self.getFlags() & FLTrunk:
return TTLocalizer.FurnitureYourOldTrunk
else:
return None
return None
def notOfferedTo(self, avatar):
if self.getFlags() & FLCloset or self.getFlags() & FLTrunk:
if self.getFlags() & FLCloset:
decade = self.furnitureType - self.furnitureType % 10
forBoys = (decade == 500 or decade == 4000)
forBoys = decade == 500
if avatar.getStyle().getGender() == 'm':
return not forBoys
else:
@ -955,9 +952,6 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
def isDeletable(self):
return self.getFlags() & (FLBank | FLCloset | FLPhone | FLTrunk) == 0
def getMaxAccessories(self):
return ToontownGlobals.MaxAccessories
def getMaxBankMoney(self):
return BankToMoney.get(self.furnitureType)
@ -975,11 +969,6 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
return 1
if self in avatar.onOrder or self in avatar.mailboxContents:
return 1
if self.getFlags() & FLTrunk:
if self.getMaxAccessories() <= avatar.getMaxAccessories():
return 1
if self in avatar.onOrder or self in avatar.mailboxContents:
return 1
return 0
def getTypeName(self):
@ -1007,7 +996,7 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
def isGift(self):
if self.getEmblemPrices():
return 0
if self.getFlags() & (FLCloset | FLBank | FLTrunk):
if self.getFlags() & (FLCloset | FLBank):
return 0
else:
return 1
@ -1019,11 +1008,8 @@ class CatalogFurnitureItem(CatalogAtticItem.CatalogAtticItem):
if avatar.getMaxClothes() > self.getMaxClothes():
return ToontownGlobals.P_AlreadyOwnBiggerCloset
avatar.b_setMaxClothes(self.getMaxClothes())
if self.getFlags() & FLTrunk:
avatar.b_setMaxAccessories(self.getMaxAccessories())
if self.getFlags() & FLBank:
avatar.b_setMaxBankMoney(self.getMaxBankMoney())
return retcode
house.addAtticItem(self)
return retcode
@ -1209,29 +1195,6 @@ def getAllBanks():
return list
def get50ItemTrunk(avatar, duplicateItems):
if config.GetBool('want-accessories', 1):
if avatar.getStyle().getGender() == 'm':
index = 0
else:
index = 1
trunkId = MaxTrunkIds[index]
item = CatalogFurnitureItem(trunkId)
if item in avatar.onOrder or item in avatar.mailboxContents:
return None
return item
# If we get here, we probably don't want accessories yet.
return None
def getMaxTrunks():
list = []
for trunkId in MaxTrunkIds:
list.append(CatalogFurnitureItem(trunkId))
return list
def getAllFurnitures(index):
list = []
colors = FurnitureTypes[index][FTColorOptions]

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal
import CatalogItem
import CatalogItemList
from CatalogFurnitureItem import CatalogFurnitureItem, nextAvailableCloset, nextAvailableBank, getAllClosets, get50ItemCloset, getMaxClosets, get50ItemTrunk, getAllBanks
from CatalogFurnitureItem import CatalogFurnitureItem, nextAvailableCloset, nextAvailableBank, getAllClosets, get50ItemCloset, getMaxClosets, getAllBanks
from CatalogAnimatedFurnitureItem import CatalogAnimatedFurnitureItem
from CatalogClothingItem import CatalogClothingItem, getAllClothes
from CatalogChatItem import CatalogChatItem, getChatRange
@ -1518,8 +1518,6 @@ class CatalogGenerator:
if nextAvailableTank not in schedule:
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0)
weeklyCatalog += self.__selectItem(avatar, get50ItemTrunk, monthlyCatalog, saleItem=0)
if True:
def hasPetTrick(catalog):
@ -1720,8 +1718,6 @@ class CatalogGenerator:
item = getAllTanks()
elif item == get50ItemCloset:
item = getMaxClosets()
elif item == get50ItemTrunk:
item = getMaxTrunks()
else:
self.notify.warning("Don't know how to interpret function " % repr(name))
item = None

View file

@ -10,7 +10,6 @@ from CatalogFlooringItem import getAllFloorings
from CatalogMouldingItem import getAllMouldings
from CatalogWainscotingItem import getAllWainscotings
from CatalogFurnitureItem import getAllFurnitures
from CatalogFurnitureItem import FLTrunk
from otp.otpbase import OTPGlobals
CATALOG_PANEL_WORDWRAP = 10
CATALOG_PANEL_CHAT_WORDWRAP = 9
@ -325,10 +324,6 @@ class CatalogItemPanel(DirectFrame):
def __handlePurchaseRequest(self):
if self['item'].replacesExisting() and self['item'].hasExisting():
if self['item'].getFlags() & FLTrunk:
message = TTLocalizer.CatalogVerifyPurchase % {'item': self['item'].getName(),
'price': self['item'].getPrice(self['type'])}
else:
message = TTLocalizer.CatalogOnlyOnePurchase % {'old': self['item'].getYourOldDesc(),
'item': self['item'].getName(),
'price': self['item'].getPrice(self['type'])}

View file

@ -248,9 +248,6 @@ class MailboxScreen(DirectObject.DirectObject):
self.acceptingIndex = None
if retcode < 0:
self.notify.info('Could not take item %s: retcode %s' % (item, retcode))
if retcode == ToontownGlobals.P_NoTrunk:
self.dialogBox = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.CatalogAcceptNoTrunk, text_wordwrap=15, command=self.__acceptError)
else:
self.dialogBox = TTDialog.TTDialog(style=TTDialog.TwoChoiceCustom, text=item.getAcceptItemErrorText(retcode), text_wordwrap=15, command=self.__handleDiscard, buttonText=[TTLocalizer.MailboxDiscard, TTLocalizer.MailboxLeave])
self.dialogBox.show()
elif hasattr(item, 'storedInAttic') and item.storedInAttic():

View file

@ -269,16 +269,17 @@ class DistributedHouseAI(DistributedObjectAI):
self.atticItems.append(item)
elif item.replacesExisting() and item.hasExisting():
if item.getFlags() & FLCloset:
closets = ClosetToClothes.keys()
items = ClosetToClothes.keys() if item.getFlags() & FLCloset else BankToMoney.keys()
for itItem in self.interiorItems:
if itItem.furnitureType in closets:
if itItem.furnitureType in items:
posHpr = itItem.posHpr
self.interiorItems.remove(itItem)
item.posHpr = posHpr
self.interiorItems.append(item)
break
for itItem in self.atticItems:
if itItem.furnitureType in closets:
if itItem.furnitureType in items:
self.atticItems.remove(itItem)
self.atticItems.append(item)
break

View file

@ -253,19 +253,6 @@ class TrunkGUI(StateData.StateData):
self.backpackChoice = 0
self.shoesChoice = 0
if (self.toon.hat[0] != 0 or self.toon.hat[1] != 0 or self.toon.hat[2] != 0):
self.hatChoice = 1
self.hats.append((self.toon.hat[0], self.toon.hat[1], self.toon.hat[2]))
if (self.toon.glasses[0] != 0 or self.toon.glasses[1] != 0 or self.toon.glasses[2] != 0):
self.glassesChoice = 1
self.glasses.append((self.toon.glasses[0], self.toon.glasses[1], self.toon.glasses[2]))
if (self.toon.backpack[0] != 0 or self.toon.backpack[1] != 0 or self.toon.backpack[2] != 0):
self.backpackChoice = 1
self.backpacks.append((self.toon.backpack[0], self.toon.backpack[1], self.toon.backpack[2]))
if (self.toon.shoes[0] != 0 or self.toon.shoes[1] != 0 or self.toon.shoes[2] != 0):
self.shoesChoice = 1
self.shoes.append((self.toon.shoes[0], self.toon.shoes[1], self.toon.shoes[2]))
i = 0
while i < len(self.hatList):
self.hats.append((self.hatList[i], self.hatList[i + 1], self.hatList[i + 2]))

View file

@ -498,12 +498,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.NPCFriendsDict = NPCFriendsDict
def setMaxAccessories(self, max):
self.maxAccessories = max
def getMaxAccessories(self):
return self.maxAccessories
def setHatList(self, clothesList):
self.hatList = clothesList
@ -530,7 +524,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
def isTrunkFull(self, extraAccessories = 0):
numAccessories = (len(self.hatList) + len(self.glassesList) + len(self.backpackList) + len(self.shoesList)) / 3
return numAccessories + extraAccessories >= self.maxAccessories
return numAccessories + extraAccessories >= ToontownGlobals.MaxAccessories
def setMaxClothes(self, max):
self.maxClothes = max

View file

@ -594,22 +594,9 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
for npcId in desiredNpcFriends:
self.attemptAddNPCFriend(npcId)
def d_setMaxAccessories(self, max):
self.sendUpdate('setMaxAccessories', [self.maxAccessories])
def setMaxAccessories(self, max):
self.maxAccessories = max
def b_setMaxAccessories(self, max):
self.setMaxAccessories(max)
self.d_setMaxAccessories(max)
def getMaxAccessories(self):
return self.maxAccessories
def isTrunkFull(self, extraAccessories = 0):
numAccessories = (len(self.hatList) + len(self.glassesList) + len(self.backpackList) + len(self.shoesList)) / 3
return numAccessories + extraAccessories >= self.maxAccessories
return numAccessories + extraAccessories >= ToontownGlobals.MaxAccessories
def d_setHatList(self, clothesList):
self.sendUpdate('setHatList', [clothesList])

View file

@ -82,9 +82,6 @@ class DistributedToonUD(DistributedObjectUD):
def setClothesBottomsList(self, todo0):
pass
def setMaxAccessories(self, todo0):
pass
def setHatList(self, todo0):
pass

View file

@ -5035,7 +5035,6 @@ MessageConfirmRent = 'Begin rental? Cancel to save the rental for later'
MessageConfirmGarden = 'Are you sure you want to start a garden?'
FurnitureYourOldCloset = 'your old wardrobe'
FurnitureYourOldBank = 'your old bank'
FurnitureYourOldTrunk = 'your old trunk'
TrunkHatGUI = 'Hats'
TrunkGlassesGUI = 'Glasses'
TrunkBackpackGUI = 'Backpacks'
@ -5475,10 +5474,8 @@ CatalogPurchaseItemOnOrder = 'Congratulations! Your purchase will be delivered t
CatalogPurchaseGiftItemOnOrder = 'Excellent! Your gift to %s will be delivered to their mailbox.'
CatalogAnythingElse = 'Anything else I can get you today?'
CatalogPurchaseClosetFull = 'Your closet is full. You may purchase this item anyway, but if you do you will need to delete something from your closet to make room for it when it arrives.\n\nDo you still want to purchase this item?'
CatalogPurchaseNoTrunk = 'In order to wear this item, you need to buy a trunk.\n\nDo you still want to purchase this item?'
CatalogPurchaseTrunkFull = 'Your trunk is full. If you purchase this item, you\xe2\x80\x99ll need to delete another item from your trunk to make more room.\n\nDo you still want to purchase this item?'
CatalogAcceptClosetFull = 'Your closet is full. You must go inside and delete something from your closet to make room for this item before you can take it out of your mailbox.'
CatalogAcceptNoTrunk = "You don't have a trunk. You must buy a trunk before you can take this item out of your mailbox."
CatalogAcceptTrunkFull = 'Your trunk is full. You must delete something from your trunk before you can take this item out of your mailbox.'
CatalogAcceptShirt = 'You are now wearing your new hat. The hat you were wearing before has been moved to your trunk.'
CatalogAcceptShorts = 'You are now wearing your new shorts. What you were wearing before has been moved to your closet.'

View file

@ -39,15 +39,14 @@ SpeedwayCameraFar = 8000.0
SpeedwayCameraNear = 1.0
MaxMailboxContents = 60
MaxHouseItems = 250
MaxAccessories = 75
MaxAccessories = 100
ExtraDeletedItems = 5
DeletedItemLifetime = 7 * 24 * 60
CatalogNumWeeksPerSeries = 13
CatalogNumWeeks = 78
PetFloorCollPriority = 5
PetPanelProximityPriority = 6
P_TooFast = -29
P_NoTrunk = -28
P_TooFast = -28
P_AlreadyOwnBiggerCloset = -27
P_ItemAlreadyRented = -26
P_OnAwardOrderListFull = -25