mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
Revert "Loyalty items cum back. ;(. & add ctime so mongo doesn't complain."
This reverts commit 881a8007df
.
This commit is contained in:
parent
881a8007df
commit
e1de301f2a
17 changed files with 182 additions and 379 deletions
8
dependencies/astron/dclass/stride.dc
vendored
8
dependencies/astron/dclass/stride.dc
vendored
|
@ -27,7 +27,7 @@ dclass Account {
|
|||
uint32 ACCOUNT_AV_SET[] required db;
|
||||
uint32 ESTATE_ID db;
|
||||
AvatarPendingDel ACCOUNT_AV_SET_DEL[] db;
|
||||
string CREATED db;
|
||||
uint64 CREATED db;
|
||||
string LAST_LOGIN db;
|
||||
string ACCOUNT_ID db;
|
||||
uint16 ACCESS_LEVEL db;
|
||||
|
@ -234,7 +234,6 @@ from toontown.shtiker import NewbiePurchaseManager/AI
|
|||
from toontown.safezone import SafeZoneManager/AI
|
||||
from toontown.tutorial import TutorialManager/AI
|
||||
from toontown.catalog import CatalogManager/AI
|
||||
from toontown.catalog import AccountDate/AI
|
||||
from toontown.safezone import DistributedTreasure/AI
|
||||
from toontown.coghq import DistributedCashbotBossTreasure/AI
|
||||
from toontown.building import DistributedTrophyMgr/AI
|
||||
|
@ -1520,11 +1519,6 @@ dclass CatalogManager : DistributedObject {
|
|||
startCatalog() airecv clsend;
|
||||
};
|
||||
|
||||
dclass AccountDate : DistributedObject {
|
||||
requestDate() airecv clsend;
|
||||
requestDateResult(string);
|
||||
};
|
||||
|
||||
dclass DistributedTreasure : DistributedObject {
|
||||
setTreasureType(uint16) required broadcast ram;
|
||||
setPosition(int16/10, int16/10, int16/10) required broadcast ram;
|
||||
|
|
|
@ -18,7 +18,6 @@ from toontown.ai.DistributedReportMgrAI import DistributedReportMgrAI
|
|||
from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI
|
||||
from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI
|
||||
from toontown.catalog.CatalogManagerAI import CatalogManagerAI
|
||||
from toontown.catalog.AccountDateAI import AccountDateAI
|
||||
from toontown.coghq import CountryClubManagerAI
|
||||
from toontown.coghq import FactoryManagerAI
|
||||
from toontown.coghq import LawOfficeManagerAI
|
||||
|
@ -119,8 +118,6 @@ class ToontownAIRepository(ToontownInternalRepository):
|
|||
self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
|
||||
self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
|
||||
self.codeRedemptionMgr.generateWithRequired(2)
|
||||
self.accountDateMgr = AccountDateAI(self)
|
||||
self.accountDateMgr.generateWithRequired(2)
|
||||
self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self)
|
||||
self.buildingQueryMgr.generateWithRequired(2)
|
||||
self.groupManager.generateWithRequired(2)
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
from direct.distributed.DistributedObject import DistributedObject
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from datetime import datetime
|
||||
|
||||
class AccountDate(DistributedObject):
|
||||
neverDisable = 1
|
||||
notify = directNotify.newCategory('AccountDate')
|
||||
|
||||
def __init__(self, cr):
|
||||
DistributedObject.__init__(self, cr)
|
||||
self.accountDays = 0
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObject.announceGenerate(self)
|
||||
base.cr.accountDateMgr = self
|
||||
taskMgr.doMethodLater(10, self.requestDate, 'request-task')
|
||||
|
||||
def delete(self):
|
||||
if hasattr(base.cr, 'accountDateMgr'):
|
||||
if base.cr.accountDateMgr is self:
|
||||
del base.cr.accountDateMgr
|
||||
DistributedObject.delete(self)
|
||||
|
||||
def getAccountDays(self):
|
||||
return self.accountDays
|
||||
|
||||
def requestDate(self, task=None):
|
||||
self.sendUpdate('requestDate')
|
||||
|
||||
if task is not None:
|
||||
return task.done
|
||||
|
||||
def requestDateResult(self, result):
|
||||
if result is None:
|
||||
notify.warning('Invalid response from server.')
|
||||
self.accountDays = 0
|
||||
else:
|
||||
date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y")
|
||||
self.accountDays = (datetime.now() - date).days
|
|
@ -1,23 +0,0 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
||||
|
||||
class AccountDateAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedObjectAI.announceGenerate(self)
|
||||
|
||||
def requestDate(self):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
av = self.air.doId2do.get(avId)
|
||||
|
||||
if not av:
|
||||
return
|
||||
|
||||
def callback(dclass, fields):
|
||||
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
|
||||
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
|
||||
else:
|
||||
self.sendUpdateToAvatarId(avId, 'requestDateResult', [None])
|
||||
|
||||
self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback)
|
|
@ -10,9 +10,9 @@ from panda3d.core import *
|
|||
|
||||
class CatalogAccessoryItem(CatalogItem.CatalogItem):
|
||||
|
||||
def makeNewItem(self, accessoryType, loyaltyDays = 0):
|
||||
def makeNewItem(self, accessoryType, isSpecial = False):
|
||||
self.accessoryType = accessoryType
|
||||
self.loyaltyDays = loyaltyDays
|
||||
self.isSpecial = isSpecial
|
||||
CatalogItem.CatalogItem.makeNewItem(self)
|
||||
|
||||
def getPurchaseLimit(self):
|
||||
|
@ -328,7 +328,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
|
|||
def decodeDatagram(self, di, versionNumber, store):
|
||||
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
||||
self.accessoryType = di.getUint16()
|
||||
self.loyaltyDays = di.getUint16()
|
||||
self.isSpecial = di.getBool()
|
||||
str = AccessoryTypes[self.accessoryType][ATString]
|
||||
if self.isHat():
|
||||
defn = ToonDNA.HatStyles[str]
|
||||
|
@ -343,17 +343,10 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
|
|||
def encodeDatagram(self, dg, store):
|
||||
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
||||
dg.addUint16(self.accessoryType)
|
||||
dg.addUint16(self.loyaltyDays)
|
||||
dg.addBool(self.isSpecial)
|
||||
|
||||
def isGift(self):
|
||||
if self.getEmblemPrices():
|
||||
return 0
|
||||
if self.loyaltyRequirement() > 0:
|
||||
return 0
|
||||
elif self.accessoryType in LoyaltyAccessoryItems:
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
return not self.getEmblemPrices()
|
||||
|
||||
def getAllAccessories(*accessoryTypes):
|
||||
list = []
|
||||
|
|
|
@ -735,4 +735,3 @@ AccessoryTypes = {101: (AHat,
|
|||
'shw2',
|
||||
APriceCool,
|
||||
7)}
|
||||
LoyaltyAccessoryItems = []
|
||||
|
|
|
@ -17,8 +17,7 @@ ABoysShorts = 3
|
|||
AGirlsShorts = 4
|
||||
AGirlsSkirt = 5
|
||||
AShorts = 6
|
||||
ClothingTypes = {
|
||||
101: (ABoysShirt, 'bss1', 40),
|
||||
ClothingTypes = {101: (ABoysShirt, 'bss1', 40),
|
||||
102: (ABoysShirt, 'bss2', 40),
|
||||
103: (ABoysShirt, 'bss3', 40),
|
||||
105: (ABoysShirt, 'bss4', 40),
|
||||
|
@ -291,23 +290,15 @@ ClothingTypes = {
|
|||
1817: (AGirlsSkirt, 'sa_gs19', 5000),
|
||||
1818: (AGirlsSkirt, 'sa_gs20', 5000),
|
||||
1819: (AGirlsSkirt, 'sa_gs21', 5000),
|
||||
1820: (AShirt, 'sa_ss55', 5000)}
|
||||
LoyaltyClothingItems = (1600,
|
||||
1601,
|
||||
1602,
|
||||
1603,
|
||||
1604,
|
||||
1605,
|
||||
1606,
|
||||
1607,
|
||||
1608)
|
||||
1820: (AShirt, 'sa_ss55', 5000),
|
||||
1821: (AShirt, 'weed', 5000)}
|
||||
|
||||
class CatalogClothingItem(CatalogItem.CatalogItem):
|
||||
|
||||
def makeNewItem(self, clothingType, colorIndex, loyaltyDays = 0):
|
||||
def makeNewItem(self, clothingType, colorIndex, isSpecial = False):
|
||||
self.clothingType = clothingType
|
||||
self.colorIndex = colorIndex
|
||||
self.loyaltyDays = loyaltyDays
|
||||
self.isSpecial = isSpecial
|
||||
CatalogItem.CatalogItem.makeNewItem(self)
|
||||
|
||||
def storedInCloset(self):
|
||||
|
@ -347,8 +338,6 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
|
|||
return 1
|
||||
if avatar.mailboxContents.count(self) != 0:
|
||||
return 1
|
||||
if self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
|
||||
return 1
|
||||
str = ClothingTypes[self.clothingType][CTString]
|
||||
dna = avatar.getStyle()
|
||||
if self.isShirt():
|
||||
|
@ -428,7 +417,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
|
|||
return ToontownGlobals.P_ItemAvailable
|
||||
|
||||
def getDeliveryTime(self):
|
||||
return 60
|
||||
return 1
|
||||
|
||||
def getPicture(self, avatar):
|
||||
from toontown.toon import Toon
|
||||
|
@ -565,7 +554,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
|
|||
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
||||
self.clothingType = di.getUint16()
|
||||
self.colorIndex = di.getUint8()
|
||||
self.loyaltyDays = di.getUint16()
|
||||
self.isSpecial = di.getBool()
|
||||
str = ClothingTypes[self.clothingType][CTString]
|
||||
if self.isShirt():
|
||||
color = ToonDNA.ShirtStyles[str][2][self.colorIndex]
|
||||
|
@ -576,18 +565,10 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
|
|||
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
||||
dg.addUint16(self.clothingType)
|
||||
dg.addUint8(self.colorIndex)
|
||||
dg.addUint16(self.loyaltyDays)
|
||||
dg.addBool(self.isSpecial)
|
||||
|
||||
def isGift(self):
|
||||
if self.getEmblemPrices():
|
||||
return 0
|
||||
if self.loyaltyRequirement() > 0:
|
||||
return 0
|
||||
elif self.clothingType in LoyaltyClothingItems:
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
|
||||
return not self.getEmblemPrices()
|
||||
|
||||
def getAllClothes(*clothingTypes):
|
||||
list = []
|
||||
|
|
|
@ -3,22 +3,21 @@ from toontown.toonbase import ToontownGlobals
|
|||
from toontown.toonbase import TTLocalizer
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from direct.interval.IntervalGlobal import *
|
||||
LoyaltyEmoteItems = (20, 21, 22, 23, 24, 25, 26)
|
||||
|
||||
class CatalogEmoteItem(CatalogItem.CatalogItem):
|
||||
sequenceNumber = 0
|
||||
pictureToon = None
|
||||
|
||||
def makeNewItem(self, emoteIndex, loyaltyDays = 0):
|
||||
def makeNewItem(self, emoteIndex, isSpecial = False):
|
||||
self.emoteIndex = emoteIndex
|
||||
self.loyaltyDays = loyaltyDays
|
||||
self.isSpecial = isSpecial
|
||||
CatalogItem.CatalogItem.makeNewItem(self)
|
||||
|
||||
def getPurchaseLimit(self):
|
||||
return 1
|
||||
|
||||
def reachedPurchaseLimit(self, avatar):
|
||||
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder or self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
|
||||
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder:
|
||||
return 1
|
||||
if self.emoteIndex >= len(avatar.emoteAccess):
|
||||
return 0
|
||||
|
@ -115,21 +114,14 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
|
|||
def decodeDatagram(self, di, versionNumber, store):
|
||||
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
|
||||
self.emoteIndex = di.getUint8()
|
||||
self.loyaltyDays = di.getUint16()
|
||||
self.isSpecial = di.getBool()
|
||||
if self.emoteIndex > len(OTPLocalizer.EmoteList):
|
||||
raise ValueError
|
||||
|
||||
def encodeDatagram(self, dg, store):
|
||||
CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
|
||||
dg.addUint8(self.emoteIndex)
|
||||
dg.addUint16(self.loyaltyDays)
|
||||
dg.addBool(self.isSpecial)
|
||||
|
||||
def isGift(self):
|
||||
if self.getEmblemPrices():
|
||||
return 0
|
||||
if self.loyaltyRequirement() > 0:
|
||||
return 0
|
||||
elif self.emoteIndex in LoyaltyEmoteItems:
|
||||
return 0
|
||||
else:
|
||||
return 1
|
||||
return not self.getEmblemPrices()
|
||||
|
|
|
@ -12,8 +12,8 @@ from CatalogMouldingItem import CatalogMouldingItem, getAllMouldings
|
|||
from CatalogWainscotingItem import CatalogWainscotingItem, getAllWainscotings
|
||||
from CatalogWindowItem import CatalogWindowItem
|
||||
from CatalogPoleItem import nextAvailablePole, getAllPoles
|
||||
from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks
|
||||
from CatalogTankItem import nextAvailableTank, getAllTanks
|
||||
from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks
|
||||
from CatalogGardenItem import CatalogGardenItem
|
||||
from CatalogToonStatueItem import CatalogToonStatueItem
|
||||
from CatalogRentalItem import CatalogRentalItem
|
||||
|
@ -26,7 +26,7 @@ from toontown.toonbase import ToontownGlobals
|
|||
import types
|
||||
import random
|
||||
import time
|
||||
from pandac.PandaModules import *
|
||||
from panda3d.core import *
|
||||
MetaItems = {100: getAllClothes(101, 102, 103, 104, 105, 106, 107, 108, 109, 109, 111, 115, 201, 202, 203, 204, 205, 206, 207, 208, 209, 209, 211, 215),
|
||||
300: getAllClothes(301, 302, 303, 304, 305, 308, 401, 403, 404, 405, 407, 451, 452, 453),
|
||||
2000: getChatRange(0, 1999),
|
||||
|
@ -41,20 +41,25 @@ MetaItems = {100: getAllClothes(101, 102, 103, 104, 105, 106, 107, 108, 109, 109
|
|||
2921: getChatRange(12050, 12099),
|
||||
2930: getChatRange(13000, 13099),
|
||||
2940: getChatRange(14000, 14099),
|
||||
|
||||
3000: getWallpapers(1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100),
|
||||
3010: getWallpapers(2200, 2300, 2400, 2500, 2600, 2700, 2800),
|
||||
3020: getWallpapers(2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600),
|
||||
3030: getWallpapers(3700, 3800, 3900),
|
||||
|
||||
3500: getAllWainscotings(1000, 1010),
|
||||
3510: getAllWainscotings(1020),
|
||||
3520: getAllWainscotings(1030),
|
||||
3530: getAllWainscotings(1040),
|
||||
|
||||
4000: getFloorings(1000, 1010, 1020, 1030, 1040, 1050, 1060, 1070, 1080, 1090, 1100),
|
||||
4010: getFloorings(1110, 1120, 1130),
|
||||
4020: getFloorings(1140, 1150, 1160, 1170, 1180, 1190),
|
||||
|
||||
4500: getAllMouldings(1000, 1010),
|
||||
4510: getAllMouldings(1020, 1030, 1040),
|
||||
4520: getAllMouldings(1070),
|
||||
|
||||
5000: getAllPetTricks()}
|
||||
MetaItemChatKeysSold = (2000,
|
||||
2010,
|
||||
|
@ -396,29 +401,7 @@ MonthlySchedule = ((7,
|
|||
15,
|
||||
8,
|
||||
15,
|
||||
2010,
|
||||
2010,
|
||||
((4, 2940),)),
|
||||
(9,
|
||||
1,
|
||||
9,
|
||||
30,
|
||||
(CatalogGardenItem(135, 1),)),
|
||||
(1,
|
||||
1,
|
||||
1,
|
||||
31,
|
||||
(CatalogGardenItem(135, 1),)),
|
||||
(4,
|
||||
1,
|
||||
4,
|
||||
30,
|
||||
(CatalogGardenItem(135, 1),)),
|
||||
(6,
|
||||
1,
|
||||
6,
|
||||
30,
|
||||
(CatalogGardenItem(135, 1),)),
|
||||
(6,
|
||||
26,
|
||||
7,
|
||||
|
@ -477,22 +460,16 @@ MonthlySchedule = ((7,
|
|||
9,
|
||||
7,
|
||||
15,
|
||||
2010,
|
||||
2010,
|
||||
(CatalogClothingItem(1751, 0),)),
|
||||
(6,
|
||||
14,
|
||||
7,
|
||||
15,
|
||||
2010,
|
||||
2010,
|
||||
(CatalogClothingItem(1754, 0), CatalogClothingItem(1755, 0), CatalogClothingItem(1756, 0))),
|
||||
(7,
|
||||
21,
|
||||
8,
|
||||
17,
|
||||
2010,
|
||||
2010,
|
||||
(CatalogClothingItem(1749, 0),
|
||||
CatalogClothingItem(1750, 0),
|
||||
CatalogClothingItem(1757, 0),
|
||||
|
@ -501,8 +478,6 @@ MonthlySchedule = ((7,
|
|||
25,
|
||||
9,
|
||||
21,
|
||||
2010,
|
||||
2010,
|
||||
(CatalogClothingItem(1763, 0),)),
|
||||
(6,
|
||||
5,
|
||||
|
@ -513,48 +488,43 @@ MonthlySchedule = ((7,
|
|||
1,
|
||||
12,
|
||||
31,
|
||||
(CatalogGardenItem(100, 1),
|
||||
(
|
||||
CatalogGardenItem(100, 1),
|
||||
CatalogGardenItem(101, 1),
|
||||
CatalogGardenItem(103, 1),
|
||||
CatalogGardenItem(104, 1),
|
||||
CatalogToonStatueItem(105, endPoseIndex=108),
|
||||
CatalogRentalItem(1, 2880, 1000),
|
||||
CatalogRentalItem(2, 2890, 1000),
|
||||
CatalogGardenStarterItem(),
|
||||
CatalogFurnitureItem(1530),
|
||||
CatalogFurnitureItem(1531),
|
||||
CatalogFurnitureItem(1532),
|
||||
CatalogNametagItem(15),
|
||||
CatalogNametagItem(16),
|
||||
CatalogNametagItem(17),
|
||||
CatalogClothingItem(1608, 0, 720),
|
||||
CatalogClothingItem(1605, 0, 720),
|
||||
CatalogClothingItem(1602, 0, 720),
|
||||
CatalogClothingItem(1607, 0, 540),
|
||||
CatalogClothingItem(1604, 0, 540),
|
||||
CatalogClothingItem(1601, 0, 540),
|
||||
CatalogClothingItem(1606, 0, 360),
|
||||
CatalogClothingItem(1603, 0, 360),
|
||||
CatalogClothingItem(1600, 0, 360),
|
||||
CatalogEmoteItem(25, 30),
|
||||
CatalogEmoteItem(26, 60),
|
||||
CatalogEmoteItem(20, 90),
|
||||
CatalogEmoteItem(21, 180),
|
||||
CatalogEmoteItem(22, 360),
|
||||
CatalogEmoteItem(23, 540),
|
||||
CatalogEmoteItem(24, 720))),
|
||||
CatalogClothingItem(1605, 0, True),
|
||||
CatalogClothingItem(1602, 0, True),
|
||||
CatalogClothingItem(1604, 0, True),
|
||||
CatalogClothingItem(1601, 0, True),
|
||||
CatalogClothingItem(1603, 0, True),
|
||||
CatalogClothingItem(1600, 0, True),
|
||||
CatalogEmoteItem(20, True),
|
||||
CatalogEmoteItem(21, True),
|
||||
CatalogEmoteItem(22, True),
|
||||
CatalogEmoteItem(23, True),
|
||||
CatalogEmoteItem(24, True),
|
||||
CatalogEmoteItem(25, True),
|
||||
CatalogEmoteItem(26, True),
|
||||
CatalogNametagItem(15, True),
|
||||
CatalogNametagItem(16, True),
|
||||
CatalogNametagItem(17, True))),
|
||||
(5,
|
||||
26,
|
||||
6,
|
||||
30,
|
||||
2013,
|
||||
2013,
|
||||
(CatalogAccessoryItem(175),)),
|
||||
(8,
|
||||
27,
|
||||
9,
|
||||
5,
|
||||
2013,
|
||||
2013,
|
||||
((3, 2900),
|
||||
CatalogChatItem(10003),
|
||||
CatalogClothingItem(1001, 0),
|
||||
|
@ -604,8 +574,6 @@ MonthlySchedule = ((7,
|
|||
3,
|
||||
9,
|
||||
12,
|
||||
2013,
|
||||
2013,
|
||||
((3, 2910),
|
||||
CatalogFurnitureItem(680),
|
||||
CatalogFurnitureItem(681),
|
||||
|
@ -640,8 +608,6 @@ MonthlySchedule = ((7,
|
|||
20,
|
||||
9,
|
||||
19,
|
||||
2013,
|
||||
2013,
|
||||
(CatalogAccessoryItem(101),
|
||||
CatalogAccessoryItem(103),
|
||||
CatalogAccessoryItem(117),
|
||||
|
@ -864,7 +830,9 @@ WeeklySchedule = ((100,
|
|||
CatalogFurnitureItem(1000),
|
||||
CatalogClothingItem(117, 0),
|
||||
CatalogClothingItem(217, 0),
|
||||
nextAvailableCloset),
|
||||
nextAvailableCloset,
|
||||
nextAvailableBank,
|
||||
nextAvailableTank),
|
||||
(100,
|
||||
(5, 2000),
|
||||
CatalogFurnitureItem(1430),
|
||||
|
@ -1385,7 +1353,7 @@ WeeklySchedule = ((100,
|
|||
Sale(CatalogClothingItem(116, 0), CatalogClothingItem(216, 0), CatalogClothingItem(408, 0), CatalogClothingItem(117, 0), CatalogClothingItem(217, 0), CatalogClothingItem(409, 0), CatalogClothingItem(118, 0), CatalogClothingItem(218, 0), CatalogClothingItem(410, 0), CatalogClothingItem(119, 0), CatalogClothingItem(219, 0), CatalogClothingItem(120, 0), CatalogClothingItem(220, 0), CatalogClothingItem(121, 0), CatalogClothingItem(221, 0), CatalogClothingItem(222, 0), CatalogClothingItem(123, 0), CatalogClothingItem(224, 0), CatalogClothingItem(411, 0), CatalogClothingItem(311, 0), CatalogClothingItem(310, 0)),
|
||||
Sale(CatalogWindowItem(40), CatalogWindowItem(70), CatalogWindowItem(50), CatalogWindowItem(60), CatalogWindowItem(80), CatalogWindowItem(100), CatalogWindowItem(90), CatalogWindowItem(110)),
|
||||
Sale(CatalogEmoteItem(5), CatalogEmoteItem(9), CatalogEmoteItem(13), CatalogEmoteItem(11), CatalogEmoteItem(6), CatalogEmoteItem(8), CatalogNametagItem(10)),
|
||||
Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1600), CatalogFurnitureItem(1531), CatalogFurnitureItem(1532), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)),
|
||||
Sale(CatalogFurnitureItem(600), CatalogFurnitureItem(610), CatalogFurnitureItem(620), CatalogFurnitureItem(630), CatalogFurnitureItem(640), CatalogFurnitureItem(650), CatalogFurnitureItem(660), CatalogFurnitureItem(900), CatalogFurnitureItem(910), CatalogFurnitureItem(920), CatalogFurnitureItem(930), CatalogFurnitureItem(940), CatalogFurnitureItem(1000), CatalogFurnitureItem(1010), CatalogFurnitureItem(1020), CatalogFurnitureItem(1030), CatalogFurnitureItem(1400), CatalogFurnitureItem(1410), CatalogFurnitureItem(1420), CatalogFurnitureItem(1430), CatalogFurnitureItem(1440), CatalogFurnitureItem(1441), CatalogFurnitureItem(1442), CatalogFurnitureItem(1443), CatalogFurnitureItem(1500), CatalogFurnitureItem(1510), CatalogFurnitureItem(1520), CatalogFurnitureItem(1530), CatalogFurnitureItem(1531), CatalogFurnitureItem(1532), CatalogFurnitureItem(1600), CatalogFurnitureItem(1610), CatalogFurnitureItem(1620), CatalogFurnitureItem(1630), CatalogFurnitureItem(1640), CatalogFurnitureItem(1650), CatalogFurnitureItem(1660), CatalogFurnitureItem(1661), CatalogFurnitureItem(1710), CatalogFurnitureItem(1800), CatalogFurnitureItem(1810), CatalogFurnitureItem(1900), CatalogFurnitureItem(1910)),
|
||||
(300,
|
||||
(1, 2020),
|
||||
(2, 2030),
|
||||
|
@ -1512,12 +1480,9 @@ class CatalogGenerator:
|
|||
|
||||
def __init__(self):
|
||||
self.__itemLists = {}
|
||||
self.__releasedItemLists = {}
|
||||
|
||||
def getReleasedCatalogList(self, weekStart):
|
||||
dayNumber = int(weekStart / (24 * 60))
|
||||
itemLists = self.__getReleasedItemLists(dayNumber, weekStart)
|
||||
return itemLists
|
||||
if config.GetBool('save-catalog-schedule', False):
|
||||
self.outputSchedule('catalog-schedule.txt')
|
||||
|
||||
def generateMonthlyCatalog(self, avatar, weekStart):
|
||||
dayNumber = int(weekStart / (24 * 60))
|
||||
|
@ -1549,10 +1514,11 @@ class CatalogGenerator:
|
|||
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
|
||||
|
||||
if nextAvailableBank not in schedule:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem = 0)
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableBank, monthlyCatalog, saleItem=0)
|
||||
|
||||
if nextAvailableTank not in schedule:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem = 0)
|
||||
if time.time() < 1096617600.0:
|
||||
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0)
|
||||
if True:
|
||||
|
||||
def hasPetTrick(catalog):
|
||||
for item in catalog:
|
||||
|
@ -1562,7 +1528,6 @@ class CatalogGenerator:
|
|||
return 0
|
||||
|
||||
if not hasPetTrick(weeklyCatalog) and not hasPetTrick(avatar.weeklyCatalog) and not hasPetTrick(avatar.backCatalog):
|
||||
self.notify.debug('Artificially adding pet trick to catalog')
|
||||
weeklyCatalog += self.__selectItem(avatar, 5000, monthlyCatalog, saleItem=saleItem)
|
||||
self.notify.debug('Generated catalog: %s' % weeklyCatalog)
|
||||
return weeklyCatalog
|
||||
|
@ -1592,45 +1557,12 @@ class CatalogGenerator:
|
|||
|
||||
return backCatalog
|
||||
|
||||
def __getReleasedItemLists(self, dayNumber, weekStart):
|
||||
itemLists = self.__releasedItemLists.get(dayNumber)
|
||||
if itemLists != None:
|
||||
return itemLists
|
||||
else:
|
||||
self.__releasedItemLists.clear()
|
||||
testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0)
|
||||
nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60)
|
||||
year = nowtuple[0]
|
||||
month = nowtuple[1]
|
||||
day = nowtuple[2]
|
||||
itemLists = []
|
||||
for monthlyItems in MonthlySchedule:
|
||||
startMM = monthlyItems[0]
|
||||
startDD = monthlyItems[1]
|
||||
endMM = monthlyItems[2]
|
||||
endDD = monthlyItems[3]
|
||||
if len(monthlyItems) == 7:
|
||||
startYYYY = monthlyItems[4]
|
||||
endYYYY = monthlyItems[5]
|
||||
list = monthlyItems[6]
|
||||
else:
|
||||
startYYYY = 1969
|
||||
endYYYY = year
|
||||
list = monthlyItems[4]
|
||||
pastStart = year > startYYYY or (year == startYYYY and (month > startMM or (month == startMM and day >= startDD)))
|
||||
if pastStart:
|
||||
itemLists.append(list)
|
||||
|
||||
self.__releasedItemLists[dayNumber] = itemLists
|
||||
return itemLists
|
||||
|
||||
def __getMonthlyItemLists(self, dayNumber, weekStart):
|
||||
itemLists = self.__itemLists.get(dayNumber)
|
||||
if itemLists != None:
|
||||
return itemLists
|
||||
testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0)
|
||||
testDaysAhead = config.GetInt('test-server-holiday-days-ahead', 0)
|
||||
nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60)
|
||||
year = nowtuple[0]
|
||||
month = nowtuple[1]
|
||||
day = nowtuple[2]
|
||||
self.notify.debug('Generating seasonal itemLists for %s/%s.' % (month, day))
|
||||
|
@ -1640,16 +1572,9 @@ class CatalogGenerator:
|
|||
startDD = monthlyItems[1]
|
||||
endMM = monthlyItems[2]
|
||||
endDD = monthlyItems[3]
|
||||
if len(monthlyItems) == 7:
|
||||
startYYYY = monthlyItems[4]
|
||||
endYYYY = monthlyItems[5]
|
||||
list = monthlyItems[6]
|
||||
else:
|
||||
startYYYY = 1969
|
||||
endYYYY = year
|
||||
list = monthlyItems[4]
|
||||
pastStart = year >= startYYYY and (month > startMM or (month == startMM and day >= startDD))
|
||||
beforeEnd = year <= endYYYY and (month < endMM or (month == endMM and day <= endDD))
|
||||
list = monthlyItems[4]
|
||||
pastStart = month > startMM or (month == startMM and day >= startDD)
|
||||
beforeEnd = month < endMM or (month == endMM and day <= endDD)
|
||||
if endMM < startMM:
|
||||
if pastStart or beforeEnd:
|
||||
itemLists.append(list)
|
||||
|
@ -1780,31 +1705,33 @@ class CatalogGenerator:
|
|||
def __recordSchedule(self, sched, weekCode, schedule):
|
||||
if isinstance(schedule, Sale):
|
||||
schedule = schedule.args
|
||||
for item in schedule:
|
||||
if callable(item):
|
||||
if item == nextAvailablePole:
|
||||
item = getAllPoles()
|
||||
elif item == nextAvailableCloset:
|
||||
item = getAllClosets()
|
||||
elif item == nextAvailableBank:
|
||||
item = getAllBanks()
|
||||
elif item == nextAvailableTank:
|
||||
item == getAllTanks()
|
||||
elif item == get50ItemCloset:
|
||||
item = getMaxClosets()
|
||||
else:
|
||||
self.notify.warning("Don't know how to interpret function " % repr(name))
|
||||
item = None
|
||||
elif isinstance(item, types.TupleType):
|
||||
item = item[1]
|
||||
if isinstance(item, types.IntType):
|
||||
item = MetaItems[item]
|
||||
if isinstance(item, CatalogItem.CatalogItem):
|
||||
self.__recordScheduleItem(sched, weekCode, None, item)
|
||||
elif item != None:
|
||||
for i in item:
|
||||
self.__recordScheduleItem(sched, None, weekCode, i)
|
||||
|
||||
try:
|
||||
for item in list(schedule):
|
||||
if callable(item):
|
||||
if item == nextAvailablePole:
|
||||
item = getAllPoles()
|
||||
elif item == nextAvailableCloset:
|
||||
item = getAllClosets()
|
||||
elif item == nextAvailableBank:
|
||||
item = getAllBanks()
|
||||
elif item == nextAvailableTank:
|
||||
item = getAllTanks()
|
||||
elif item == get50ItemCloset:
|
||||
item = getMaxClosets()
|
||||
else:
|
||||
self.notify.warning("Don't know how to interpret function " % repr(name))
|
||||
item = None
|
||||
elif isinstance(item, types.TupleType):
|
||||
item = item[1]
|
||||
if isinstance(item, types.IntType):
|
||||
item = MetaItems[item]
|
||||
if isinstance(item, CatalogItem.CatalogItem):
|
||||
self.__recordScheduleItem(sched, weekCode, None, item)
|
||||
elif item != None:
|
||||
for i in item:
|
||||
self.__recordScheduleItem(sched, None, weekCode, i)
|
||||
except:
|
||||
print 'Wrong: %s' % schedule
|
||||
return
|
||||
|
||||
def __recordScheduleItem(self, sched, weekCode, maybeWeekCode, item):
|
||||
|
|
|
@ -20,7 +20,7 @@ CatalogTypeUnspecified = 0
|
|||
CatalogTypeWeekly = 1
|
||||
CatalogTypeBackorder = 2
|
||||
CatalogTypeMonthly = 3
|
||||
CatalogTypeLoyalty = 4
|
||||
CatalogTypeSpecial = 4
|
||||
|
||||
class CatalogItem:
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('CatalogItem')
|
||||
|
@ -32,6 +32,7 @@ class CatalogItem:
|
|||
self.giftTag = None
|
||||
self.giftCode = 0
|
||||
self.hasPicture = False
|
||||
self.isSpecial = False
|
||||
self.volume = 0
|
||||
self.specialEventId = 0
|
||||
if len(args) >= 1 and isinstance(args[0], DatagramIterator):
|
||||
|
@ -124,14 +125,8 @@ class CatalogItem:
|
|||
def forGirlsOnly(self):
|
||||
return 0
|
||||
|
||||
def setLoyaltyRequirement(self, days):
|
||||
self.loyaltyDays = days
|
||||
|
||||
def loyaltyRequirement(self):
|
||||
if not hasattr(self, 'loyaltyDays'):
|
||||
return 0
|
||||
else:
|
||||
return self.loyaltyDays
|
||||
def getIsSpecial(self):
|
||||
return self.isSpecial
|
||||
|
||||
def getPrice(self, catalogType):
|
||||
if catalogType == CatalogTypeBackorder:
|
||||
|
@ -381,13 +376,6 @@ class CatalogItem:
|
|||
def getRequestPurchaseErrorTextTimeout(self):
|
||||
return 6
|
||||
|
||||
def getDaysToGo(self, avatar):
|
||||
accountDays = avatar.getAccountDays()
|
||||
daysToGo = self.loyaltyRequirement() - accountDays
|
||||
if daysToGo < 0:
|
||||
daysToGo = 0
|
||||
return int(daysToGo)
|
||||
|
||||
def encodeCatalogItem(dg, item, store):
|
||||
import CatalogItemTypes
|
||||
flags = item.getTypeCode()
|
||||
|
|
|
@ -306,9 +306,6 @@ class CatalogItemPanel(DirectFrame):
|
|||
elif hasattr(self['item'], 'isSkillTooLow') and self['item'].isSkillTooLow(base.localAvatar):
|
||||
auxText = TTLocalizer.SkillTooLow
|
||||
self.buyButton['state'] = DGG.DISABLED
|
||||
elif hasattr(self['item'], 'getDaysToGo') and self['item'].getDaysToGo(base.localAvatar):
|
||||
auxText = TTLocalizer.DaysToGo % self['item'].getDaysToGo(base.localAvatar)
|
||||
self.buyButton['state'] = DGG.DISABLED
|
||||
elif self['item'].getEmblemPrices() and not base.localAvatar.isEnoughMoneyAndEmblemsToBuy(self['item'].getPrice(self['type']), self['item'].getEmblemPrices()):
|
||||
self.buyButton['state'] = DGG.DISABLED
|
||||
elif hasattr(self['item'], 'houseId') and self['item'].houseId == localAvatar.houseType:
|
||||
|
|
|
@ -24,7 +24,7 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
|
|||
return 0
|
||||
|
||||
def reachedPurchaseLimit(self, avatar):
|
||||
return self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder #or self in avatar.awardMailboxContents or self in avatar.onAwardOrder
|
||||
return self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder
|
||||
|
||||
def saveHistory(self):
|
||||
return 1
|
||||
|
@ -45,15 +45,14 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
|
|||
return TTLocalizer.RentalTypeName
|
||||
|
||||
def recordPurchase(self, avatar, optional):
|
||||
self.notify.debug('rental -- record purchase')
|
||||
if avatar:
|
||||
self.notify.debug('rental -- has avater')
|
||||
self.notify.debug('rental -- has avatar')
|
||||
estate = simbase.air.estateManager._lookupEstate(avatar)
|
||||
if estate:
|
||||
self.notify.debug('rental -- has estate')
|
||||
estate.rentItem(self.typeIndex, self.duration)
|
||||
else:
|
||||
self.notify.debug('rental -- something not there')
|
||||
self.notify.warning('rental -- something not there')
|
||||
return ToontownGlobals.P_ItemAvailable
|
||||
|
||||
def getPicture(self, avatar):
|
||||
|
@ -126,5 +125,7 @@ def getAllRentalItems():
|
|||
list = []
|
||||
for rentalType in (ToontownGlobals.RentalCannon,):
|
||||
list.append(CatalogRentalItem(rentalType, 2880, 1000))
|
||||
for rentalType in (ToontownGlobals.RentalGameTable,):
|
||||
list.append(CatalogRentalItem(rentalType, 2890, 1000))
|
||||
|
||||
return list
|
||||
|
|
|
@ -101,8 +101,8 @@ class CatalogScreen(DirectFrame):
|
|||
def setNumBackPages(self, numBackPages):
|
||||
self.numBackPages = numBackPages
|
||||
|
||||
def setNumLoyaltyPages(self, numLoyaltyPages):
|
||||
self.numLoyaltyPages = numLoyaltyPages
|
||||
def setNumSpecialPages(self, numSpecialPages):
|
||||
self.numSpecialPages = numSpecialPages
|
||||
|
||||
def setNumEmblemPages(self, numEmblemPages):
|
||||
self.numEmblemPages = numEmblemPages
|
||||
|
@ -116,49 +116,49 @@ class CatalogScreen(DirectFrame):
|
|||
def enableBackorderCatalogButton(self):
|
||||
self.backCatalogButton['state'] = DGG.NORMAL
|
||||
self.newCatalogButton['state'] = DGG.DISABLED
|
||||
self.loyaltyCatalogButton['state'] = DGG.DISABLED
|
||||
self.specialCatalogButton['state'] = DGG.DISABLED
|
||||
self.emblemCatalogButton['state'] = DGG.DISABLED
|
||||
|
||||
def enableNewCatalogButton(self):
|
||||
self.backCatalogButton['state'] = DGG.DISABLED
|
||||
self.newCatalogButton['state'] = DGG.NORMAL
|
||||
self.loyaltyCatalogButton['state'] = DGG.DISABLED
|
||||
self.specialCatalogButton['state'] = DGG.DISABLED
|
||||
self.emblemCatalogButton['state'] = DGG.DISABLED
|
||||
|
||||
def enableLoyaltyCatalogButton(self):
|
||||
def enableSpecialCatalogButton(self):
|
||||
self.backCatalogButton['state'] = DGG.DISABLED
|
||||
self.newCatalogButton['state'] = DGG.DISABLED
|
||||
self.loyaltyCatalogButton['state'] = DGG.NORMAL
|
||||
self.specialCatalogButton['state'] = DGG.NORMAL
|
||||
self.emblemCatalogButton['state'] = DGG.DISABLED
|
||||
|
||||
def enableEmblemCatalogButton(self):
|
||||
self.backCatalogButton['state'] = DGG.DISABLED
|
||||
self.newCatalogButton['state'] = DGG.DISABLED
|
||||
self.loyaltyCatalogButton['state'] = DGG.DISABLED
|
||||
self.specialCatalogButton['state'] = DGG.DISABLED
|
||||
self.emblemCatalogButton['state'] = DGG.NORMAL
|
||||
|
||||
def modeBackorderCatalog(self):
|
||||
self.backCatalogButton['state'] = DGG.DISABLED
|
||||
self.newCatalogButton['state'] = DGG.NORMAL
|
||||
self.loyaltyCatalogButton['state'] = DGG.NORMAL
|
||||
self.specialCatalogButton['state'] = DGG.NORMAL
|
||||
self.emblemCatalogButton['state'] = DGG.NORMAL
|
||||
|
||||
def modeNewCatalog(self):
|
||||
self.backCatalogButton['state'] = DGG.NORMAL
|
||||
self.newCatalogButton['state'] = DGG.DISABLED
|
||||
self.loyaltyCatalogButton['state'] = DGG.NORMAL
|
||||
self.specialCatalogButton['state'] = DGG.NORMAL
|
||||
self.emblemCatalogButton['state'] = DGG.NORMAL
|
||||
|
||||
def modeLoyaltyCatalog(self):
|
||||
def modeSpecialCatalog(self):
|
||||
self.backCatalogButton['state'] = DGG.NORMAL
|
||||
self.newCatalogButton['state'] = DGG.NORMAL
|
||||
self.loyaltyCatalogButton['state'] = DGG.DISABLED
|
||||
self.specialCatalogButton['state'] = DGG.DISABLED
|
||||
self.emblemCatalogButton['state'] = DGG.NORMAL
|
||||
|
||||
def modeEmblemCatalog(self):
|
||||
self.backCatalogButton['state'] = DGG.NORMAL
|
||||
self.newCatalogButton['state'] = DGG.NORMAL
|
||||
self.loyaltyCatalogButton['state'] = DGG.NORMAL
|
||||
self.specialCatalogButton['state'] = DGG.NORMAL
|
||||
self.emblemCatalogButton['state'] = DGG.DISABLED
|
||||
|
||||
def showNewItems(self, index = None):
|
||||
|
@ -195,15 +195,15 @@ class CatalogScreen(DirectFrame):
|
|||
self.showPageItems()
|
||||
return
|
||||
|
||||
def showLoyaltyItems(self, index = None):
|
||||
def showSpecialItems(self, index = None):
|
||||
if config.GetBool('want-qa-regression', 0):
|
||||
self.notify.info('QA-REGRESSION: CATALOG: Loyalty item')
|
||||
self.notify.info('QA-REGRESSION: CATALOG: Special item')
|
||||
taskMgr.remove('clarabelleHelpText1')
|
||||
messenger.send('wakeup')
|
||||
self.viewing = 'Loyalty'
|
||||
self.modeLoyaltyCatalog()
|
||||
self.setMaxPageIndex(self.numLoyaltyPages)
|
||||
if self.numLoyaltyPages == 0:
|
||||
self.viewing = 'Special'
|
||||
self.modeSpecialCatalog()
|
||||
self.setMaxPageIndex(self.numSpecialPages)
|
||||
if self.numSpecialPages == 0:
|
||||
self.setPageIndex(-1)
|
||||
elif index is not None:
|
||||
self.setPageIndex(index)
|
||||
|
@ -238,11 +238,11 @@ class CatalogScreen(DirectFrame):
|
|||
self.viewing == 'New'
|
||||
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numBackPages > 0:
|
||||
self.showBackorderItems()
|
||||
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
|
||||
self.showLoyaltyItems()
|
||||
elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
|
||||
self.showLoyaltyItems()
|
||||
elif self.viewing == 'Loyalty' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0:
|
||||
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0:
|
||||
self.showSpecialItems()
|
||||
elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0:
|
||||
self.showSpecialItems()
|
||||
elif self.viewing == 'Special' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0:
|
||||
self.showEmblemItems()
|
||||
else:
|
||||
self.pageIndex = min(self.pageIndex, self.maxPageIndex)
|
||||
|
@ -255,10 +255,10 @@ class CatalogScreen(DirectFrame):
|
|||
self.pageIndex = self.pageIndex - 1
|
||||
if self.viewing == 'Backorder' and self.pageIndex < 0 and self.numNewPages > 0:
|
||||
self.showNewItems(self.numNewPages - 1)
|
||||
elif self.viewing == 'Loyalty' and self.pageIndex < 0 and self.numBackPages > 0:
|
||||
elif self.viewing == 'Special' and self.pageIndex < 0 and self.numBackPages > 0:
|
||||
self.showBackorderItems(self.numBackPages - 1)
|
||||
elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numLoyaltyPages > 0:
|
||||
self.showLoyaltyItems(self.numLoyaltyPages - 1)
|
||||
elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numSpecialPages > 0:
|
||||
self.showSpecialItems(self.numSpecialPages - 1)
|
||||
else:
|
||||
self.pageIndex = max(self.pageIndex, -1)
|
||||
self.showPageItems()
|
||||
|
@ -274,16 +274,16 @@ class CatalogScreen(DirectFrame):
|
|||
self.openCover()
|
||||
if self.viewing == 'New':
|
||||
page = self.pageList[self.pageIndex]
|
||||
newOrBackOrLoyalty = 0
|
||||
newOrBackOrSpecial = 0
|
||||
elif self.viewing == 'Backorder':
|
||||
page = self.backPageList[self.pageIndex]
|
||||
newOrBackOrLoyalty = 1
|
||||
elif self.viewing == 'Loyalty':
|
||||
page = self.loyaltyPageList[self.pageIndex]
|
||||
newOrBackOrLoyalty = 2
|
||||
newOrBackOrSpecial = 1
|
||||
elif self.viewing == 'Special':
|
||||
page = self.specialPageList[self.pageIndex]
|
||||
newOrBackOrSpecial = 2
|
||||
elif self.viewing == 'Emblem':
|
||||
page = self.emblemPageList[self.pageIndex]
|
||||
newOrBackOrLoyalty = 3
|
||||
newOrBackOrSpecial = 3
|
||||
page.show()
|
||||
for panel in self.panelDict[page.get_key()]:
|
||||
panel.load()
|
||||
|
@ -293,7 +293,7 @@ class CatalogScreen(DirectFrame):
|
|||
|
||||
pIndex = 0
|
||||
randGen = random.Random()
|
||||
randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrLoyalty << 16))
|
||||
randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrSpecial << 16))
|
||||
for i in xrange(NUM_CATALOG_ROWS):
|
||||
for j in xrange(NUM_CATALOG_COLS):
|
||||
if pIndex < len(self.visiblePanels):
|
||||
|
@ -308,8 +308,8 @@ class CatalogScreen(DirectFrame):
|
|||
|
||||
if self.viewing == 'New':
|
||||
text = TTLocalizer.CatalogNew
|
||||
elif self.viewing == 'Loyalty':
|
||||
text = TTLocalizer.CatalogLoyalty
|
||||
elif self.viewing == 'Special':
|
||||
text = TTLocalizer.CatalogSpecial
|
||||
elif self.viewing == 'Backorder':
|
||||
text = TTLocalizer.CatalogBackorder
|
||||
elif self.viewing == 'Emblem':
|
||||
|
@ -317,13 +317,13 @@ class CatalogScreen(DirectFrame):
|
|||
self.pageLabel['text'] = text + ' - %d' % (self.pageIndex + 1)
|
||||
if self.pageIndex < self.maxPageIndex:
|
||||
self.nextPageButton.show()
|
||||
elif self.viewing == 'New' and self.numBackPages == 0 and self.numLoyaltyPages == 0:
|
||||
elif self.viewing == 'New' and self.numBackPages == 0 and self.numSpecialPages == 0:
|
||||
self.nextPageButton.hide()
|
||||
elif self.viewing == 'Backorder' and self.numLoyaltyPages == 0:
|
||||
elif self.viewing == 'Backorder' and self.numSpecialPages == 0:
|
||||
self.nextPageButton.hide()
|
||||
elif self.viewing == 'Loyalty' and self.numEmblemPages == 0:
|
||||
elif self.viewing == 'Special' and self.numEmblemPages == 0:
|
||||
self.nextPageButton.hide()
|
||||
elif self.viewing == 'Loyalty' and self.numEmblemPages > 0:
|
||||
elif self.viewing == 'Special' and self.numEmblemPages > 0:
|
||||
self.nextPageButton.show()
|
||||
elif self.viewing == 'Emblem':
|
||||
self.nextPageButton.hide()
|
||||
|
@ -358,7 +358,7 @@ class CatalogScreen(DirectFrame):
|
|||
for page in self.backPageList:
|
||||
page.hide()
|
||||
|
||||
for page in self.loyaltyPageList:
|
||||
for page in self.specialPageList:
|
||||
page.hide()
|
||||
|
||||
for page in self.emblemPageList:
|
||||
|
@ -389,26 +389,26 @@ class CatalogScreen(DirectFrame):
|
|||
self.newCatalogButton2.show()
|
||||
if self.numBackPages > 0:
|
||||
self.backCatalogButton2.show()
|
||||
if self.numLoyaltyPages > 0:
|
||||
self.loyaltyCatalogButton2.show()
|
||||
if self.numSpecialPages > 0:
|
||||
self.specialCatalogButton2.show()
|
||||
if self.numEmblemPages > 0:
|
||||
self.emblemCatalogButton2.show()
|
||||
self.newCatalogButton.hide()
|
||||
self.backCatalogButton.hide()
|
||||
self.loyaltyCatalogButton.hide()
|
||||
self.specialCatalogButton.hide()
|
||||
self.emblemCatalogButton.hide()
|
||||
|
||||
def hideDummyTabs(self):
|
||||
self.newCatalogButton2.hide()
|
||||
self.backCatalogButton2.hide()
|
||||
self.loyaltyCatalogButton2.hide()
|
||||
self.specialCatalogButton2.hide()
|
||||
self.emblemCatalogButton2.hide()
|
||||
if self.numNewPages > 0:
|
||||
self.newCatalogButton.show()
|
||||
if self.numBackPages > 0:
|
||||
self.backCatalogButton.show()
|
||||
if self.numLoyaltyPages > 0:
|
||||
self.loyaltyCatalogButton.show()
|
||||
if self.numSpecialPages > 0:
|
||||
self.specialCatalogButton.show()
|
||||
if self.numEmblemPages > 0:
|
||||
self.emblemCatalogButton.show()
|
||||
|
||||
|
@ -442,14 +442,14 @@ class CatalogScreen(DirectFrame):
|
|||
self.maxPageIndex = 0
|
||||
self.numNewPages = 0
|
||||
self.numBackPages = 5
|
||||
self.numLoyaltyPages = 0
|
||||
self.numSpecialPages = 0
|
||||
self.viewing = 'New'
|
||||
self.panelList = []
|
||||
self.backPanelList = []
|
||||
self.pageList = []
|
||||
self.backPageList = []
|
||||
self.loyaltyPanelList = []
|
||||
self.loyaltyPageList = []
|
||||
self.specialPanelList = []
|
||||
self.specialPageList = []
|
||||
self.emblemPanelList = []
|
||||
self.emblemPageList = []
|
||||
self.panelDict = {}
|
||||
|
@ -505,19 +505,19 @@ class CatalogScreen(DirectFrame):
|
|||
-0.2,
|
||||
0.4), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, lift), image=backDown, pressEffect=0, command=self.showBackorderItems, text=TTLocalizer.CatalogBackorder, text_font=ToontownGlobals.getSignFont(), text_pos=(0.25 - lift, 0.132), text_scale=TTLocalizer.CSbackCatalogButton, text_fg=(0.392, 0.549, 0.627, 1.0), text2_fg=(0.392, 0.349, 0.427, 1.0))
|
||||
self.backCatalogButton2.hide()
|
||||
self.loyaltyCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
|
||||
self.specialCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
|
||||
0.25,
|
||||
-0.85,
|
||||
-0.3), image=[newDown,
|
||||
newDown,
|
||||
newDown,
|
||||
newUp], image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), pressEffect=0, command=self.showLoyaltyItems, text=TTLocalizer.CatalogLoyalty, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text3_pos=(1.0 - lift, 0.112), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
|
||||
self.loyaltyCatalogButton.hide()
|
||||
self.loyaltyCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
|
||||
newUp], image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), pressEffect=0, command=self.showSpecialItems, text=TTLocalizer.CatalogSpecial, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text3_pos=(1.0 - lift, 0.112), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
|
||||
self.specialCatalogButton.hide()
|
||||
self.specialCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
|
||||
0.25,
|
||||
-0.85,
|
||||
-0.3), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), image=newDown, pressEffect=0, command=self.showLoyaltyItems, text=TTLocalizer.CatalogLoyalty, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
|
||||
self.loyaltyCatalogButton2.hide()
|
||||
-0.3), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.4 + lift), image=newDown, pressEffect=0, command=self.showSpecialItems, text=TTLocalizer.CatalogSpecial, text_font=ToontownGlobals.getSignFont(), text_pos=(1.0 - lift, 0.132), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0))
|
||||
self.specialCatalogButton2.hide()
|
||||
self.emblemCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 1.05), frameSize=(-0.2,
|
||||
0.25,
|
||||
-2.0,
|
||||
|
@ -564,8 +564,8 @@ class CatalogScreen(DirectFrame):
|
|||
self.newCatalogButton2.component('text%d' % i).setR(90)
|
||||
self.backCatalogButton.component('text%d' % i).setR(90)
|
||||
self.backCatalogButton2.component('text%d' % i).setR(90)
|
||||
self.loyaltyCatalogButton.component('text%d' % i).setR(90)
|
||||
self.loyaltyCatalogButton2.component('text%d' % i).setR(90)
|
||||
self.specialCatalogButton.component('text%d' % i).setR(90)
|
||||
self.specialCatalogButton2.component('text%d' % i).setR(90)
|
||||
self.emblemCatalogButton.component('text%d' % i).setR(90)
|
||||
self.emblemCatalogButton2.component('text%d' % i).setR(90)
|
||||
|
||||
|
@ -609,8 +609,8 @@ class CatalogScreen(DirectFrame):
|
|||
continue
|
||||
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
|
||||
continue
|
||||
if item.loyaltyRequirement() != 0:
|
||||
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
|
||||
if item.getIsSpecial():
|
||||
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
|
||||
elif item.getEmblemPrices():
|
||||
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly, parentCatalogScreen=self))
|
||||
else:
|
||||
|
@ -627,8 +627,8 @@ class CatalogScreen(DirectFrame):
|
|||
continue
|
||||
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
|
||||
continue
|
||||
if item.loyaltyRequirement() != 0:
|
||||
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
|
||||
if item.getIsSpecial():
|
||||
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
|
||||
elif item.getEmblemPrices():
|
||||
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder, parentCatalogScreen=self))
|
||||
else:
|
||||
|
@ -638,8 +638,8 @@ class CatalogScreen(DirectFrame):
|
|||
self.setNumNewPages(numPages)
|
||||
numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
|
||||
self.setNumBackPages(numPages)
|
||||
numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
|
||||
self.setNumLoyaltyPages(numPages)
|
||||
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special')
|
||||
self.setNumSpecialPages(numPages)
|
||||
numPages = self.packPages(self.emblemPanelList, self.emblemPageList, 'emblem')
|
||||
self.setNumEmblemPages(numPages)
|
||||
currentWeek = base.localAvatar.catalogScheduleCurrentWeek - 1
|
||||
|
@ -752,7 +752,7 @@ class CatalogScreen(DirectFrame):
|
|||
self.clarabelleFrame.setPosHprScale(-0.01, 0.0, -0.01, 0.0, 0.0, 0.0, 1.02, 1.0, 1.02)
|
||||
|
||||
def reload(self):
|
||||
for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
|
||||
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
|
||||
panel.destroy()
|
||||
|
||||
def priceSort(a, b, type):
|
||||
|
@ -764,23 +764,23 @@ class CatalogScreen(DirectFrame):
|
|||
self.maxPageIndex = 0
|
||||
self.numNewPages = 0
|
||||
self.numBackPages = 5
|
||||
self.numLoyaltyPages = 0
|
||||
self.numSpecialPages = 0
|
||||
self.viewing = 'New'
|
||||
self.panelList = []
|
||||
self.backPanelList = []
|
||||
self.loyaltyList = []
|
||||
self.specialList = []
|
||||
self.pageList = []
|
||||
self.backPageList = []
|
||||
self.loyaltyPanelList = []
|
||||
self.loyaltyPageList = []
|
||||
self.specialPanelList = []
|
||||
self.specialPageList = []
|
||||
self.panelDict = {}
|
||||
self.visiblePanels = []
|
||||
itemList = base.localAvatar.monthlyCatalog + base.localAvatar.weeklyCatalog
|
||||
itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeWeekly))
|
||||
itemList.reverse()
|
||||
for item in itemList:
|
||||
if item.loyaltyRequirement() != 0:
|
||||
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
|
||||
if item.getIsSpecial():
|
||||
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
|
||||
else:
|
||||
self.panelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly))
|
||||
|
||||
|
@ -788,8 +788,8 @@ class CatalogScreen(DirectFrame):
|
|||
itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeBackorder))
|
||||
itemList.reverse()
|
||||
for item in itemList:
|
||||
if item.loyaltyRequirement() != 0:
|
||||
self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
|
||||
if item.getIsSpecial():
|
||||
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self))
|
||||
else:
|
||||
self.backPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder))
|
||||
|
||||
|
@ -797,8 +797,8 @@ class CatalogScreen(DirectFrame):
|
|||
self.setNumNewPages(numPages)
|
||||
numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
|
||||
self.setNumBackPages(numPages)
|
||||
numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
|
||||
self.setNumLoyaltyPages(numPages)
|
||||
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special')
|
||||
self.setNumSpecialPages(numPages)
|
||||
seriesNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) / ToontownGlobals.CatalogNumWeeksPerSeries + 1
|
||||
self.catalogSeries['text'] = Localizer.CatalogSeriesLabel % seriesNumber
|
||||
weekNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) % ToontownGlobals.CatalogNumWeeksPerSeries + 1
|
||||
|
@ -820,7 +820,7 @@ class CatalogScreen(DirectFrame):
|
|||
self.destroy()
|
||||
del self.base
|
||||
del self.squares
|
||||
for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
|
||||
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
|
||||
panel.destroy()
|
||||
|
||||
del self.panelList
|
||||
|
@ -838,8 +838,8 @@ class CatalogScreen(DirectFrame):
|
|||
del self.newCatalogButton2
|
||||
del self.backCatalogButton
|
||||
del self.backCatalogButton2
|
||||
del self.loyaltyCatalogButton
|
||||
del self.loyaltyCatalogButton2
|
||||
del self.specialCatalogButton
|
||||
del self.specialCatalogButton2
|
||||
del self.pageLabel
|
||||
if self.createdGiftGui:
|
||||
del self.giftToggle
|
||||
|
@ -878,8 +878,8 @@ class CatalogScreen(DirectFrame):
|
|||
self.newCatalogButton2.hide()
|
||||
self.backCatalogButton.hide()
|
||||
self.backCatalogButton2.hide()
|
||||
self.loyaltyCatalogButton.hide()
|
||||
self.loyaltyCatalogButton2.hide()
|
||||
self.specialCatalogButton.hide()
|
||||
self.specialCatalogButton2.hide()
|
||||
self.emblemCatalogButton.hide()
|
||||
self.emblemCatalogButton2.hide()
|
||||
self.hangup.hide()
|
||||
|
@ -901,7 +901,7 @@ class CatalogScreen(DirectFrame):
|
|||
self.__giftToggle()
|
||||
if hasattr(self, 'beanBank'):
|
||||
self.beanBank['text'] = str(base.localAvatar.getTotalMoney())
|
||||
for item in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
|
||||
for item in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList:
|
||||
if type(item) != type(''):
|
||||
item.updateButtons(self.gifting)
|
||||
|
||||
|
|
|
@ -1663,9 +1663,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips)
|
||||
self.inventory.updateTotalPropsText()
|
||||
|
||||
def getAccountDays(self):
|
||||
return base.cr.accountDateMgr.getAccountDays()
|
||||
|
||||
def hasActiveBoardingGroup(self):
|
||||
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty:
|
||||
return localAvatar.boardingParty.hasActiveGroup(localAvatar.doId)
|
||||
|
|
|
@ -5451,7 +5451,7 @@ CatalogCurrency = 'beans'
|
|||
CatalogHangUp = 'Hang Up'
|
||||
CatalogNew = 'NEW'
|
||||
CatalogBackorder = 'BACKORDER'
|
||||
CatalogLoyalty = 'SPECIAL'
|
||||
CatalogSpecial = 'SPECIAL'
|
||||
CatalogEmblem = 'EMBLEM'
|
||||
CatalogPagePrefix = 'Page'
|
||||
CatalogGreeting = "Hello! Thanks for calling Clarabelle's Cattlelog. Can I help you?"
|
||||
|
@ -8133,7 +8133,6 @@ ElevatorLawBotCourse0 = 'Office A'
|
|||
ElevatorLawBotCourse1 = 'Office B'
|
||||
ElevatorLawBotCourse2 = 'Office C'
|
||||
ElevatorLawBotCourse3 = 'Office D'
|
||||
DaysToGo = 'Wait\n%s Days'
|
||||
IceGameTitle = 'Ice Slide'
|
||||
IceGameInstructions = 'Get as close to the center by the end of the second round. Use arrow keys to change direction and force. Press Ctrl to launch your toon. Hit barrels for extra points and avoid the TNT!'
|
||||
IceGameInstructionsNoTnt = 'Get as close to the center by the end of the second round. Use arrow keys to change direction and force. Press Ctrl to launch your toon. Hit barrels for extra points.'
|
||||
|
|
|
@ -329,7 +329,7 @@ class LoginAccountFSM(OperationFSM):
|
|||
'ACCOUNT_AV_SET': [0] * 6,
|
||||
'ESTATE_ID': 0,
|
||||
'ACCOUNT_AV_SET_DEL': [],
|
||||
'CREATED': time.ctime(),
|
||||
'CREATED': time.time(),
|
||||
'LAST_LOGIN': time.ctime(),
|
||||
'LAST_LOGIN_TS': time.time(),
|
||||
'ACCOUNT_ID': str(self.userId),
|
||||
|
|
Loading…
Reference in a new issue