Loyalty items cum back. ;(. & add ctime so mongo doesn't complain.

This commit is contained in:
Loudrob 2015-07-23 15:54:46 -04:00
parent 9ab1bd9534
commit 881a8007df
17 changed files with 379 additions and 182 deletions

View file

@ -27,7 +27,7 @@ dclass Account {
uint32 ACCOUNT_AV_SET[] required db; uint32 ACCOUNT_AV_SET[] required db;
uint32 ESTATE_ID db; uint32 ESTATE_ID db;
AvatarPendingDel ACCOUNT_AV_SET_DEL[] db; AvatarPendingDel ACCOUNT_AV_SET_DEL[] db;
uint64 CREATED db; string CREATED db;
string LAST_LOGIN db; string LAST_LOGIN db;
string ACCOUNT_ID db; string ACCOUNT_ID db;
uint16 ACCESS_LEVEL db; uint16 ACCESS_LEVEL db;
@ -234,6 +234,7 @@ from toontown.shtiker import NewbiePurchaseManager/AI
from toontown.safezone import SafeZoneManager/AI from toontown.safezone import SafeZoneManager/AI
from toontown.tutorial import TutorialManager/AI from toontown.tutorial import TutorialManager/AI
from toontown.catalog import CatalogManager/AI from toontown.catalog import CatalogManager/AI
from toontown.catalog import AccountDate/AI
from toontown.safezone import DistributedTreasure/AI from toontown.safezone import DistributedTreasure/AI
from toontown.coghq import DistributedCashbotBossTreasure/AI from toontown.coghq import DistributedCashbotBossTreasure/AI
from toontown.building import DistributedTrophyMgr/AI from toontown.building import DistributedTrophyMgr/AI
@ -1519,6 +1520,11 @@ dclass CatalogManager : DistributedObject {
startCatalog() airecv clsend; startCatalog() airecv clsend;
}; };
dclass AccountDate : DistributedObject {
requestDate() airecv clsend;
requestDateResult(string);
};
dclass DistributedTreasure : DistributedObject { dclass DistributedTreasure : DistributedObject {
setTreasureType(uint16) required broadcast ram; setTreasureType(uint16) required broadcast ram;
setPosition(int16/10, int16/10, int16/10) required broadcast ram; setPosition(int16/10, int16/10, int16/10) required broadcast ram;

View file

@ -18,6 +18,7 @@ from toontown.ai.DistributedReportMgrAI import DistributedReportMgrAI
from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI
from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI
from toontown.catalog.CatalogManagerAI import CatalogManagerAI from toontown.catalog.CatalogManagerAI import CatalogManagerAI
from toontown.catalog.AccountDateAI import AccountDateAI
from toontown.coghq import CountryClubManagerAI from toontown.coghq import CountryClubManagerAI
from toontown.coghq import FactoryManagerAI from toontown.coghq import FactoryManagerAI
from toontown.coghq import LawOfficeManagerAI from toontown.coghq import LawOfficeManagerAI
@ -118,6 +119,8 @@ class ToontownAIRepository(ToontownInternalRepository):
self.cogPageManager = CogPageManagerAI.CogPageManagerAI() self.cogPageManager = CogPageManagerAI.CogPageManagerAI()
self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self) self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self)
self.codeRedemptionMgr.generateWithRequired(2) self.codeRedemptionMgr.generateWithRequired(2)
self.accountDateMgr = AccountDateAI(self)
self.accountDateMgr.generateWithRequired(2)
self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self) self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self)
self.buildingQueryMgr.generateWithRequired(2) self.buildingQueryMgr.generateWithRequired(2)
self.groupManager.generateWithRequired(2) self.groupManager.generateWithRequired(2)

View file

@ -0,0 +1,39 @@
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

View file

@ -0,0 +1,23 @@
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)

View file

@ -10,9 +10,9 @@ from panda3d.core import *
class CatalogAccessoryItem(CatalogItem.CatalogItem): class CatalogAccessoryItem(CatalogItem.CatalogItem):
def makeNewItem(self, accessoryType, isSpecial = False): def makeNewItem(self, accessoryType, loyaltyDays = 0):
self.accessoryType = accessoryType self.accessoryType = accessoryType
self.isSpecial = isSpecial self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self) CatalogItem.CatalogItem.makeNewItem(self)
def getPurchaseLimit(self): def getPurchaseLimit(self):
@ -328,7 +328,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.accessoryType = di.getUint16() self.accessoryType = di.getUint16()
self.isSpecial = di.getBool() self.loyaltyDays = di.getUint16()
str = AccessoryTypes[self.accessoryType][ATString] str = AccessoryTypes[self.accessoryType][ATString]
if self.isHat(): if self.isHat():
defn = ToonDNA.HatStyles[str] defn = ToonDNA.HatStyles[str]
@ -343,10 +343,17 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem):
def encodeDatagram(self, dg, store): def encodeDatagram(self, dg, store):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store) CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint16(self.accessoryType) dg.addUint16(self.accessoryType)
dg.addBool(self.isSpecial) dg.addUint16(self.loyaltyDays)
def isGift(self): def isGift(self):
return not self.getEmblemPrices() if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.accessoryType in LoyaltyAccessoryItems:
return 0
else:
return 1
def getAllAccessories(*accessoryTypes): def getAllAccessories(*accessoryTypes):
list = [] list = []

View file

@ -735,3 +735,4 @@ AccessoryTypes = {101: (AHat,
'shw2', 'shw2',
APriceCool, APriceCool,
7)} 7)}
LoyaltyAccessoryItems = []

View file

@ -17,7 +17,8 @@ ABoysShorts = 3
AGirlsShorts = 4 AGirlsShorts = 4
AGirlsSkirt = 5 AGirlsSkirt = 5
AShorts = 6 AShorts = 6
ClothingTypes = {101: (ABoysShirt, 'bss1', 40), ClothingTypes = {
101: (ABoysShirt, 'bss1', 40),
102: (ABoysShirt, 'bss2', 40), 102: (ABoysShirt, 'bss2', 40),
103: (ABoysShirt, 'bss3', 40), 103: (ABoysShirt, 'bss3', 40),
105: (ABoysShirt, 'bss4', 40), 105: (ABoysShirt, 'bss4', 40),
@ -290,15 +291,23 @@ ClothingTypes = {101: (ABoysShirt, 'bss1', 40),
1817: (AGirlsSkirt, 'sa_gs19', 5000), 1817: (AGirlsSkirt, 'sa_gs19', 5000),
1818: (AGirlsSkirt, 'sa_gs20', 5000), 1818: (AGirlsSkirt, 'sa_gs20', 5000),
1819: (AGirlsSkirt, 'sa_gs21', 5000), 1819: (AGirlsSkirt, 'sa_gs21', 5000),
1820: (AShirt, 'sa_ss55', 5000), 1820: (AShirt, 'sa_ss55', 5000)}
1821: (AShirt, 'weed', 5000)} LoyaltyClothingItems = (1600,
1601,
1602,
1603,
1604,
1605,
1606,
1607,
1608)
class CatalogClothingItem(CatalogItem.CatalogItem): class CatalogClothingItem(CatalogItem.CatalogItem):
def makeNewItem(self, clothingType, colorIndex, isSpecial = False): def makeNewItem(self, clothingType, colorIndex, loyaltyDays = 0):
self.clothingType = clothingType self.clothingType = clothingType
self.colorIndex = colorIndex self.colorIndex = colorIndex
self.isSpecial = isSpecial self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self) CatalogItem.CatalogItem.makeNewItem(self)
def storedInCloset(self): def storedInCloset(self):
@ -338,6 +347,8 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
return 1 return 1
if avatar.mailboxContents.count(self) != 0: if avatar.mailboxContents.count(self) != 0:
return 1 return 1
if self in avatar.awardMailboxContents or self in avatar.onAwardOrder:
return 1
str = ClothingTypes[self.clothingType][CTString] str = ClothingTypes[self.clothingType][CTString]
dna = avatar.getStyle() dna = avatar.getStyle()
if self.isShirt(): if self.isShirt():
@ -417,7 +428,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
return ToontownGlobals.P_ItemAvailable return ToontownGlobals.P_ItemAvailable
def getDeliveryTime(self): def getDeliveryTime(self):
return 1 return 60
def getPicture(self, avatar): def getPicture(self, avatar):
from toontown.toon import Toon from toontown.toon import Toon
@ -554,7 +565,7 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.clothingType = di.getUint16() self.clothingType = di.getUint16()
self.colorIndex = di.getUint8() self.colorIndex = di.getUint8()
self.isSpecial = di.getBool() self.loyaltyDays = di.getUint16()
str = ClothingTypes[self.clothingType][CTString] str = ClothingTypes[self.clothingType][CTString]
if self.isShirt(): if self.isShirt():
color = ToonDNA.ShirtStyles[str][2][self.colorIndex] color = ToonDNA.ShirtStyles[str][2][self.colorIndex]
@ -565,10 +576,18 @@ class CatalogClothingItem(CatalogItem.CatalogItem):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store) CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint16(self.clothingType) dg.addUint16(self.clothingType)
dg.addUint8(self.colorIndex) dg.addUint8(self.colorIndex)
dg.addBool(self.isSpecial) dg.addUint16(self.loyaltyDays)
def isGift(self): def isGift(self):
return not self.getEmblemPrices() if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.clothingType in LoyaltyClothingItems:
return 0
else:
return 1
def getAllClothes(*clothingTypes): def getAllClothes(*clothingTypes):
list = [] list = []

View file

@ -3,21 +3,22 @@ from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from direct.interval.IntervalGlobal import * from direct.interval.IntervalGlobal import *
LoyaltyEmoteItems = (20, 21, 22, 23, 24, 25, 26)
class CatalogEmoteItem(CatalogItem.CatalogItem): class CatalogEmoteItem(CatalogItem.CatalogItem):
sequenceNumber = 0 sequenceNumber = 0
pictureToon = None pictureToon = None
def makeNewItem(self, emoteIndex, isSpecial = False): def makeNewItem(self, emoteIndex, loyaltyDays = 0):
self.emoteIndex = emoteIndex self.emoteIndex = emoteIndex
self.isSpecial = isSpecial self.loyaltyDays = loyaltyDays
CatalogItem.CatalogItem.makeNewItem(self) CatalogItem.CatalogItem.makeNewItem(self)
def getPurchaseLimit(self): def getPurchaseLimit(self):
return 1 return 1
def reachedPurchaseLimit(self, avatar): def reachedPurchaseLimit(self, avatar):
if self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder: 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:
return 1 return 1
if self.emoteIndex >= len(avatar.emoteAccess): if self.emoteIndex >= len(avatar.emoteAccess):
return 0 return 0
@ -114,14 +115,21 @@ class CatalogEmoteItem(CatalogItem.CatalogItem):
def decodeDatagram(self, di, versionNumber, store): def decodeDatagram(self, di, versionNumber, store):
CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store) CatalogItem.CatalogItem.decodeDatagram(self, di, versionNumber, store)
self.emoteIndex = di.getUint8() self.emoteIndex = di.getUint8()
self.isSpecial = di.getBool() self.loyaltyDays = di.getUint16()
if self.emoteIndex > len(OTPLocalizer.EmoteList): if self.emoteIndex > len(OTPLocalizer.EmoteList):
raise ValueError raise ValueError
def encodeDatagram(self, dg, store): def encodeDatagram(self, dg, store):
CatalogItem.CatalogItem.encodeDatagram(self, dg, store) CatalogItem.CatalogItem.encodeDatagram(self, dg, store)
dg.addUint8(self.emoteIndex) dg.addUint8(self.emoteIndex)
dg.addBool(self.isSpecial) dg.addUint16(self.loyaltyDays)
def isGift(self): def isGift(self):
return not self.getEmblemPrices() if self.getEmblemPrices():
return 0
if self.loyaltyRequirement() > 0:
return 0
elif self.emoteIndex in LoyaltyEmoteItems:
return 0
else:
return 1

View file

@ -12,8 +12,8 @@ from CatalogMouldingItem import CatalogMouldingItem, getAllMouldings
from CatalogWainscotingItem import CatalogWainscotingItem, getAllWainscotings from CatalogWainscotingItem import CatalogWainscotingItem, getAllWainscotings
from CatalogWindowItem import CatalogWindowItem from CatalogWindowItem import CatalogWindowItem
from CatalogPoleItem import nextAvailablePole, getAllPoles from CatalogPoleItem import nextAvailablePole, getAllPoles
from CatalogTankItem import nextAvailableTank, getAllTanks
from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks from CatalogPetTrickItem import CatalogPetTrickItem, getAllPetTricks
from CatalogTankItem import nextAvailableTank, getAllTanks
from CatalogGardenItem import CatalogGardenItem from CatalogGardenItem import CatalogGardenItem
from CatalogToonStatueItem import CatalogToonStatueItem from CatalogToonStatueItem import CatalogToonStatueItem
from CatalogRentalItem import CatalogRentalItem from CatalogRentalItem import CatalogRentalItem
@ -26,7 +26,7 @@ from toontown.toonbase import ToontownGlobals
import types import types
import random import random
import time import time
from panda3d.core import * from pandac.PandaModules 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), 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), 300: getAllClothes(301, 302, 303, 304, 305, 308, 401, 403, 404, 405, 407, 451, 452, 453),
2000: getChatRange(0, 1999), 2000: getChatRange(0, 1999),
@ -41,25 +41,20 @@ MetaItems = {100: getAllClothes(101, 102, 103, 104, 105, 106, 107, 108, 109, 109
2921: getChatRange(12050, 12099), 2921: getChatRange(12050, 12099),
2930: getChatRange(13000, 13099), 2930: getChatRange(13000, 13099),
2940: getChatRange(14000, 14099), 2940: getChatRange(14000, 14099),
3000: getWallpapers(1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100), 3000: getWallpapers(1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100),
3010: getWallpapers(2200, 2300, 2400, 2500, 2600, 2700, 2800), 3010: getWallpapers(2200, 2300, 2400, 2500, 2600, 2700, 2800),
3020: getWallpapers(2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600), 3020: getWallpapers(2900, 3000, 3100, 3200, 3300, 3400, 3500, 3600),
3030: getWallpapers(3700, 3800, 3900), 3030: getWallpapers(3700, 3800, 3900),
3500: getAllWainscotings(1000, 1010), 3500: getAllWainscotings(1000, 1010),
3510: getAllWainscotings(1020), 3510: getAllWainscotings(1020),
3520: getAllWainscotings(1030), 3520: getAllWainscotings(1030),
3530: getAllWainscotings(1040), 3530: getAllWainscotings(1040),
4000: getFloorings(1000, 1010, 1020, 1030, 1040, 1050, 1060, 1070, 1080, 1090, 1100), 4000: getFloorings(1000, 1010, 1020, 1030, 1040, 1050, 1060, 1070, 1080, 1090, 1100),
4010: getFloorings(1110, 1120, 1130), 4010: getFloorings(1110, 1120, 1130),
4020: getFloorings(1140, 1150, 1160, 1170, 1180, 1190), 4020: getFloorings(1140, 1150, 1160, 1170, 1180, 1190),
4500: getAllMouldings(1000, 1010), 4500: getAllMouldings(1000, 1010),
4510: getAllMouldings(1020, 1030, 1040), 4510: getAllMouldings(1020, 1030, 1040),
4520: getAllMouldings(1070), 4520: getAllMouldings(1070),
5000: getAllPetTricks()} 5000: getAllPetTricks()}
MetaItemChatKeysSold = (2000, MetaItemChatKeysSold = (2000,
2010, 2010,
@ -401,7 +396,29 @@ MonthlySchedule = ((7,
15, 15,
8, 8,
15, 15,
2010,
2010,
((4, 2940),)), ((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, (6,
26, 26,
7, 7,
@ -460,16 +477,22 @@ MonthlySchedule = ((7,
9, 9,
7, 7,
15, 15,
2010,
2010,
(CatalogClothingItem(1751, 0),)), (CatalogClothingItem(1751, 0),)),
(6, (6,
14, 14,
7, 7,
15, 15,
2010,
2010,
(CatalogClothingItem(1754, 0), CatalogClothingItem(1755, 0), CatalogClothingItem(1756, 0))), (CatalogClothingItem(1754, 0), CatalogClothingItem(1755, 0), CatalogClothingItem(1756, 0))),
(7, (7,
21, 21,
8, 8,
17, 17,
2010,
2010,
(CatalogClothingItem(1749, 0), (CatalogClothingItem(1749, 0),
CatalogClothingItem(1750, 0), CatalogClothingItem(1750, 0),
CatalogClothingItem(1757, 0), CatalogClothingItem(1757, 0),
@ -478,6 +501,8 @@ MonthlySchedule = ((7,
25, 25,
9, 9,
21, 21,
2010,
2010,
(CatalogClothingItem(1763, 0),)), (CatalogClothingItem(1763, 0),)),
(6, (6,
5, 5,
@ -488,43 +513,48 @@ MonthlySchedule = ((7,
1, 1,
12, 12,
31, 31,
( (CatalogGardenItem(100, 1),
CatalogGardenItem(100, 1),
CatalogGardenItem(101, 1), CatalogGardenItem(101, 1),
CatalogGardenItem(103, 1), CatalogGardenItem(103, 1),
CatalogGardenItem(104, 1), CatalogGardenItem(104, 1),
CatalogToonStatueItem(105, endPoseIndex=108), CatalogToonStatueItem(105, endPoseIndex=108),
CatalogRentalItem(1, 2880, 1000), CatalogRentalItem(1, 2880, 1000),
CatalogRentalItem(2, 2890, 1000),
CatalogGardenStarterItem(), CatalogGardenStarterItem(),
CatalogFurnitureItem(1530), CatalogFurnitureItem(1530),
CatalogFurnitureItem(1531), CatalogFurnitureItem(1531),
CatalogFurnitureItem(1532), CatalogFurnitureItem(1532),
CatalogClothingItem(1605, 0, True), CatalogNametagItem(15),
CatalogClothingItem(1602, 0, True), CatalogNametagItem(16),
CatalogClothingItem(1604, 0, True), CatalogNametagItem(17),
CatalogClothingItem(1601, 0, True), CatalogClothingItem(1608, 0, 720),
CatalogClothingItem(1603, 0, True), CatalogClothingItem(1605, 0, 720),
CatalogClothingItem(1600, 0, True), CatalogClothingItem(1602, 0, 720),
CatalogEmoteItem(20, True), CatalogClothingItem(1607, 0, 540),
CatalogEmoteItem(21, True), CatalogClothingItem(1604, 0, 540),
CatalogEmoteItem(22, True), CatalogClothingItem(1601, 0, 540),
CatalogEmoteItem(23, True), CatalogClothingItem(1606, 0, 360),
CatalogEmoteItem(24, True), CatalogClothingItem(1603, 0, 360),
CatalogEmoteItem(25, True), CatalogClothingItem(1600, 0, 360),
CatalogEmoteItem(26, True), CatalogEmoteItem(25, 30),
CatalogNametagItem(15, True), CatalogEmoteItem(26, 60),
CatalogNametagItem(16, True), CatalogEmoteItem(20, 90),
CatalogNametagItem(17, True))), CatalogEmoteItem(21, 180),
CatalogEmoteItem(22, 360),
CatalogEmoteItem(23, 540),
CatalogEmoteItem(24, 720))),
(5, (5,
26, 26,
6, 6,
30, 30,
2013,
2013,
(CatalogAccessoryItem(175),)), (CatalogAccessoryItem(175),)),
(8, (8,
27, 27,
9, 9,
5, 5,
2013,
2013,
((3, 2900), ((3, 2900),
CatalogChatItem(10003), CatalogChatItem(10003),
CatalogClothingItem(1001, 0), CatalogClothingItem(1001, 0),
@ -574,6 +604,8 @@ MonthlySchedule = ((7,
3, 3,
9, 9,
12, 12,
2013,
2013,
((3, 2910), ((3, 2910),
CatalogFurnitureItem(680), CatalogFurnitureItem(680),
CatalogFurnitureItem(681), CatalogFurnitureItem(681),
@ -608,6 +640,8 @@ MonthlySchedule = ((7,
20, 20,
9, 9,
19, 19,
2013,
2013,
(CatalogAccessoryItem(101), (CatalogAccessoryItem(101),
CatalogAccessoryItem(103), CatalogAccessoryItem(103),
CatalogAccessoryItem(117), CatalogAccessoryItem(117),
@ -830,9 +864,7 @@ WeeklySchedule = ((100,
CatalogFurnitureItem(1000), CatalogFurnitureItem(1000),
CatalogClothingItem(117, 0), CatalogClothingItem(117, 0),
CatalogClothingItem(217, 0), CatalogClothingItem(217, 0),
nextAvailableCloset, nextAvailableCloset),
nextAvailableBank,
nextAvailableTank),
(100, (100,
(5, 2000), (5, 2000),
CatalogFurnitureItem(1430), CatalogFurnitureItem(1430),
@ -1353,7 +1385,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(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(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(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(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)), 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)),
(300, (300,
(1, 2020), (1, 2020),
(2, 2030), (2, 2030),
@ -1480,9 +1512,12 @@ class CatalogGenerator:
def __init__(self): def __init__(self):
self.__itemLists = {} self.__itemLists = {}
self.__releasedItemLists = {}
if config.GetBool('save-catalog-schedule', False): def getReleasedCatalogList(self, weekStart):
self.outputSchedule('catalog-schedule.txt') dayNumber = int(weekStart / (24 * 60))
itemLists = self.__getReleasedItemLists(dayNumber, weekStart)
return itemLists
def generateMonthlyCatalog(self, avatar, weekStart): def generateMonthlyCatalog(self, avatar, weekStart):
dayNumber = int(weekStart / (24 * 60)) dayNumber = int(weekStart / (24 * 60))
@ -1514,11 +1549,10 @@ class CatalogGenerator:
weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0) weeklyCatalog += self.__selectItem(avatar, nextAvailableCloset, monthlyCatalog, saleItem=0)
if nextAvailableBank not in schedule: 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: if nextAvailableTank not in schedule:
weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem=0) weeklyCatalog += self.__selectItem(avatar, nextAvailableTank, monthlyCatalog, saleItem = 0)
if True: if time.time() < 1096617600.0:
def hasPetTrick(catalog): def hasPetTrick(catalog):
for item in catalog: for item in catalog:
@ -1528,6 +1562,7 @@ class CatalogGenerator:
return 0 return 0
if not hasPetTrick(weeklyCatalog) and not hasPetTrick(avatar.weeklyCatalog) and not hasPetTrick(avatar.backCatalog): 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) weeklyCatalog += self.__selectItem(avatar, 5000, monthlyCatalog, saleItem=saleItem)
self.notify.debug('Generated catalog: %s' % weeklyCatalog) self.notify.debug('Generated catalog: %s' % weeklyCatalog)
return weeklyCatalog return weeklyCatalog
@ -1557,12 +1592,45 @@ class CatalogGenerator:
return backCatalog 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): def __getMonthlyItemLists(self, dayNumber, weekStart):
itemLists = self.__itemLists.get(dayNumber) itemLists = self.__itemLists.get(dayNumber)
if itemLists != None: if itemLists != None:
return itemLists return itemLists
testDaysAhead = config.GetInt('test-server-holiday-days-ahead', 0) testDaysAhead = simbase.config.GetInt('test-server-holiday-days-ahead', 0)
nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60) nowtuple = time.localtime(weekStart * 60 + testDaysAhead * 24 * 60 * 60)
year = nowtuple[0]
month = nowtuple[1] month = nowtuple[1]
day = nowtuple[2] day = nowtuple[2]
self.notify.debug('Generating seasonal itemLists for %s/%s.' % (month, day)) self.notify.debug('Generating seasonal itemLists for %s/%s.' % (month, day))
@ -1572,9 +1640,16 @@ class CatalogGenerator:
startDD = monthlyItems[1] startDD = monthlyItems[1]
endMM = monthlyItems[2] endMM = monthlyItems[2]
endDD = monthlyItems[3] endDD = monthlyItems[3]
list = monthlyItems[4] if len(monthlyItems) == 7:
pastStart = month > startMM or (month == startMM and day >= startDD) startYYYY = monthlyItems[4]
beforeEnd = month < endMM or (month == endMM and day <= endDD) 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))
if endMM < startMM: if endMM < startMM:
if pastStart or beforeEnd: if pastStart or beforeEnd:
itemLists.append(list) itemLists.append(list)
@ -1705,33 +1780,31 @@ class CatalogGenerator:
def __recordSchedule(self, sched, weekCode, schedule): def __recordSchedule(self, sched, weekCode, schedule):
if isinstance(schedule, Sale): if isinstance(schedule, Sale):
schedule = schedule.args schedule = schedule.args
try: for item in schedule:
for item in list(schedule): if callable(item):
if callable(item): if item == nextAvailablePole:
if item == nextAvailablePole: item = getAllPoles()
item = getAllPoles() elif item == nextAvailableCloset:
elif item == nextAvailableCloset: item = getAllClosets()
item = getAllClosets() elif item == nextAvailableBank:
elif item == nextAvailableBank: item = getAllBanks()
item = getAllBanks() elif item == nextAvailableTank:
elif item == nextAvailableTank: item == getAllTanks()
item = getAllTanks() elif item == get50ItemCloset:
elif item == get50ItemCloset: item = getMaxClosets()
item = getMaxClosets() else:
else: self.notify.warning("Don't know how to interpret function " % repr(name))
self.notify.warning("Don't know how to interpret function " % repr(name)) item = None
item = None elif isinstance(item, types.TupleType):
elif isinstance(item, types.TupleType): item = item[1]
item = item[1] if isinstance(item, types.IntType):
if isinstance(item, types.IntType): item = MetaItems[item]
item = MetaItems[item] if isinstance(item, CatalogItem.CatalogItem):
if isinstance(item, CatalogItem.CatalogItem): self.__recordScheduleItem(sched, weekCode, None, item)
self.__recordScheduleItem(sched, weekCode, None, item) elif item != None:
elif item != None: for i in item:
for i in item: self.__recordScheduleItem(sched, None, weekCode, i)
self.__recordScheduleItem(sched, None, weekCode, i)
except:
print 'Wrong: %s' % schedule
return return
def __recordScheduleItem(self, sched, weekCode, maybeWeekCode, item): def __recordScheduleItem(self, sched, weekCode, maybeWeekCode, item):

View file

@ -20,7 +20,7 @@ CatalogTypeUnspecified = 0
CatalogTypeWeekly = 1 CatalogTypeWeekly = 1
CatalogTypeBackorder = 2 CatalogTypeBackorder = 2
CatalogTypeMonthly = 3 CatalogTypeMonthly = 3
CatalogTypeSpecial = 4 CatalogTypeLoyalty = 4
class CatalogItem: class CatalogItem:
notify = DirectNotifyGlobal.directNotify.newCategory('CatalogItem') notify = DirectNotifyGlobal.directNotify.newCategory('CatalogItem')
@ -32,7 +32,6 @@ class CatalogItem:
self.giftTag = None self.giftTag = None
self.giftCode = 0 self.giftCode = 0
self.hasPicture = False self.hasPicture = False
self.isSpecial = False
self.volume = 0 self.volume = 0
self.specialEventId = 0 self.specialEventId = 0
if len(args) >= 1 and isinstance(args[0], DatagramIterator): if len(args) >= 1 and isinstance(args[0], DatagramIterator):
@ -125,8 +124,14 @@ class CatalogItem:
def forGirlsOnly(self): def forGirlsOnly(self):
return 0 return 0
def getIsSpecial(self): def setLoyaltyRequirement(self, days):
return self.isSpecial self.loyaltyDays = days
def loyaltyRequirement(self):
if not hasattr(self, 'loyaltyDays'):
return 0
else:
return self.loyaltyDays
def getPrice(self, catalogType): def getPrice(self, catalogType):
if catalogType == CatalogTypeBackorder: if catalogType == CatalogTypeBackorder:
@ -376,6 +381,13 @@ class CatalogItem:
def getRequestPurchaseErrorTextTimeout(self): def getRequestPurchaseErrorTextTimeout(self):
return 6 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): def encodeCatalogItem(dg, item, store):
import CatalogItemTypes import CatalogItemTypes
flags = item.getTypeCode() flags = item.getTypeCode()

View file

@ -306,6 +306,9 @@ class CatalogItemPanel(DirectFrame):
elif hasattr(self['item'], 'isSkillTooLow') and self['item'].isSkillTooLow(base.localAvatar): elif hasattr(self['item'], 'isSkillTooLow') and self['item'].isSkillTooLow(base.localAvatar):
auxText = TTLocalizer.SkillTooLow auxText = TTLocalizer.SkillTooLow
self.buyButton['state'] = DGG.DISABLED 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()): elif self['item'].getEmblemPrices() and not base.localAvatar.isEnoughMoneyAndEmblemsToBuy(self['item'].getPrice(self['type']), self['item'].getEmblemPrices()):
self.buyButton['state'] = DGG.DISABLED self.buyButton['state'] = DGG.DISABLED
elif hasattr(self['item'], 'houseId') and self['item'].houseId == localAvatar.houseType: elif hasattr(self['item'], 'houseId') and self['item'].houseId == localAvatar.houseType:

View file

@ -24,7 +24,7 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
return 0 return 0
def reachedPurchaseLimit(self, avatar): def reachedPurchaseLimit(self, avatar):
return self in avatar.onOrder or self in avatar.mailboxContents or self in avatar.onGiftOrder 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
def saveHistory(self): def saveHistory(self):
return 1 return 1
@ -45,14 +45,15 @@ class CatalogRentalItem(CatalogItem.CatalogItem):
return TTLocalizer.RentalTypeName return TTLocalizer.RentalTypeName
def recordPurchase(self, avatar, optional): def recordPurchase(self, avatar, optional):
self.notify.debug('rental -- record purchase')
if avatar: if avatar:
self.notify.debug('rental -- has avatar') self.notify.debug('rental -- has avater')
estate = simbase.air.estateManager._lookupEstate(avatar) estate = simbase.air.estateManager._lookupEstate(avatar)
if estate: if estate:
self.notify.debug('rental -- has estate') self.notify.debug('rental -- has estate')
estate.rentItem(self.typeIndex, self.duration) estate.rentItem(self.typeIndex, self.duration)
else: else:
self.notify.warning('rental -- something not there') self.notify.debug('rental -- something not there')
return ToontownGlobals.P_ItemAvailable return ToontownGlobals.P_ItemAvailable
def getPicture(self, avatar): def getPicture(self, avatar):
@ -125,7 +126,5 @@ def getAllRentalItems():
list = [] list = []
for rentalType in (ToontownGlobals.RentalCannon,): for rentalType in (ToontownGlobals.RentalCannon,):
list.append(CatalogRentalItem(rentalType, 2880, 1000)) list.append(CatalogRentalItem(rentalType, 2880, 1000))
for rentalType in (ToontownGlobals.RentalGameTable,):
list.append(CatalogRentalItem(rentalType, 2890, 1000))
return list return list

View file

@ -101,8 +101,8 @@ class CatalogScreen(DirectFrame):
def setNumBackPages(self, numBackPages): def setNumBackPages(self, numBackPages):
self.numBackPages = numBackPages self.numBackPages = numBackPages
def setNumSpecialPages(self, numSpecialPages): def setNumLoyaltyPages(self, numLoyaltyPages):
self.numSpecialPages = numSpecialPages self.numLoyaltyPages = numLoyaltyPages
def setNumEmblemPages(self, numEmblemPages): def setNumEmblemPages(self, numEmblemPages):
self.numEmblemPages = numEmblemPages self.numEmblemPages = numEmblemPages
@ -116,49 +116,49 @@ class CatalogScreen(DirectFrame):
def enableBackorderCatalogButton(self): def enableBackorderCatalogButton(self):
self.backCatalogButton['state'] = DGG.NORMAL self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.DISABLED self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.DISABLED self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.DISABLED self.emblemCatalogButton['state'] = DGG.DISABLED
def enableNewCatalogButton(self): def enableNewCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.NORMAL self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.DISABLED self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.DISABLED self.emblemCatalogButton['state'] = DGG.DISABLED
def enableSpecialCatalogButton(self): def enableLoyaltyCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.DISABLED self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.NORMAL self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.DISABLED self.emblemCatalogButton['state'] = DGG.DISABLED
def enableEmblemCatalogButton(self): def enableEmblemCatalogButton(self):
self.backCatalogButton['state'] = DGG.DISABLED self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.DISABLED self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.DISABLED self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.NORMAL self.emblemCatalogButton['state'] = DGG.NORMAL
def modeBackorderCatalog(self): def modeBackorderCatalog(self):
self.backCatalogButton['state'] = DGG.DISABLED self.backCatalogButton['state'] = DGG.DISABLED
self.newCatalogButton['state'] = DGG.NORMAL self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.NORMAL self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.NORMAL self.emblemCatalogButton['state'] = DGG.NORMAL
def modeNewCatalog(self): def modeNewCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.DISABLED self.newCatalogButton['state'] = DGG.DISABLED
self.specialCatalogButton['state'] = DGG.NORMAL self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.NORMAL self.emblemCatalogButton['state'] = DGG.NORMAL
def modeSpecialCatalog(self): def modeLoyaltyCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.NORMAL self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.DISABLED self.loyaltyCatalogButton['state'] = DGG.DISABLED
self.emblemCatalogButton['state'] = DGG.NORMAL self.emblemCatalogButton['state'] = DGG.NORMAL
def modeEmblemCatalog(self): def modeEmblemCatalog(self):
self.backCatalogButton['state'] = DGG.NORMAL self.backCatalogButton['state'] = DGG.NORMAL
self.newCatalogButton['state'] = DGG.NORMAL self.newCatalogButton['state'] = DGG.NORMAL
self.specialCatalogButton['state'] = DGG.NORMAL self.loyaltyCatalogButton['state'] = DGG.NORMAL
self.emblemCatalogButton['state'] = DGG.DISABLED self.emblemCatalogButton['state'] = DGG.DISABLED
def showNewItems(self, index = None): def showNewItems(self, index = None):
@ -195,15 +195,15 @@ class CatalogScreen(DirectFrame):
self.showPageItems() self.showPageItems()
return return
def showSpecialItems(self, index = None): def showLoyaltyItems(self, index = None):
if config.GetBool('want-qa-regression', 0): if config.GetBool('want-qa-regression', 0):
self.notify.info('QA-REGRESSION: CATALOG: Special item') self.notify.info('QA-REGRESSION: CATALOG: Loyalty item')
taskMgr.remove('clarabelleHelpText1') taskMgr.remove('clarabelleHelpText1')
messenger.send('wakeup') messenger.send('wakeup')
self.viewing = 'Special' self.viewing = 'Loyalty'
self.modeSpecialCatalog() self.modeLoyaltyCatalog()
self.setMaxPageIndex(self.numSpecialPages) self.setMaxPageIndex(self.numLoyaltyPages)
if self.numSpecialPages == 0: if self.numLoyaltyPages == 0:
self.setPageIndex(-1) self.setPageIndex(-1)
elif index is not None: elif index is not None:
self.setPageIndex(index) self.setPageIndex(index)
@ -238,11 +238,11 @@ class CatalogScreen(DirectFrame):
self.viewing == 'New' self.viewing == 'New'
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numBackPages > 0: if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numBackPages > 0:
self.showBackorderItems() self.showBackorderItems()
if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0: if self.viewing == 'New' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
self.showSpecialItems() self.showLoyaltyItems()
elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numSpecialPages > 0: elif self.viewing == 'Backorder' and self.pageIndex > self.maxPageIndex and self.numLoyaltyPages > 0:
self.showSpecialItems() self.showLoyaltyItems()
elif self.viewing == 'Special' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0: elif self.viewing == 'Loyalty' and self.pageIndex > self.maxPageIndex and self.numEmblemPages > 0:
self.showEmblemItems() self.showEmblemItems()
else: else:
self.pageIndex = min(self.pageIndex, self.maxPageIndex) self.pageIndex = min(self.pageIndex, self.maxPageIndex)
@ -255,10 +255,10 @@ class CatalogScreen(DirectFrame):
self.pageIndex = self.pageIndex - 1 self.pageIndex = self.pageIndex - 1
if self.viewing == 'Backorder' and self.pageIndex < 0 and self.numNewPages > 0: if self.viewing == 'Backorder' and self.pageIndex < 0 and self.numNewPages > 0:
self.showNewItems(self.numNewPages - 1) self.showNewItems(self.numNewPages - 1)
elif self.viewing == 'Special' and self.pageIndex < 0 and self.numBackPages > 0: elif self.viewing == 'Loyalty' and self.pageIndex < 0 and self.numBackPages > 0:
self.showBackorderItems(self.numBackPages - 1) self.showBackorderItems(self.numBackPages - 1)
elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numSpecialPages > 0: elif self.viewing == 'Emblem' and self.pageIndex < 0 and self.numLoyaltyPages > 0:
self.showSpecialItems(self.numSpecialPages - 1) self.showLoyaltyItems(self.numLoyaltyPages - 1)
else: else:
self.pageIndex = max(self.pageIndex, -1) self.pageIndex = max(self.pageIndex, -1)
self.showPageItems() self.showPageItems()
@ -274,16 +274,16 @@ class CatalogScreen(DirectFrame):
self.openCover() self.openCover()
if self.viewing == 'New': if self.viewing == 'New':
page = self.pageList[self.pageIndex] page = self.pageList[self.pageIndex]
newOrBackOrSpecial = 0 newOrBackOrLoyalty = 0
elif self.viewing == 'Backorder': elif self.viewing == 'Backorder':
page = self.backPageList[self.pageIndex] page = self.backPageList[self.pageIndex]
newOrBackOrSpecial = 1 newOrBackOrLoyalty = 1
elif self.viewing == 'Special': elif self.viewing == 'Loyalty':
page = self.specialPageList[self.pageIndex] page = self.loyaltyPageList[self.pageIndex]
newOrBackOrSpecial = 2 newOrBackOrLoyalty = 2
elif self.viewing == 'Emblem': elif self.viewing == 'Emblem':
page = self.emblemPageList[self.pageIndex] page = self.emblemPageList[self.pageIndex]
newOrBackOrSpecial = 3 newOrBackOrLoyalty = 3
page.show() page.show()
for panel in self.panelDict[page.get_key()]: for panel in self.panelDict[page.get_key()]:
panel.load() panel.load()
@ -293,7 +293,7 @@ class CatalogScreen(DirectFrame):
pIndex = 0 pIndex = 0
randGen = random.Random() randGen = random.Random()
randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrSpecial << 16)) randGen.seed(base.localAvatar.catalogScheduleCurrentWeek + (self.pageIndex << 8) + (newOrBackOrLoyalty << 16))
for i in xrange(NUM_CATALOG_ROWS): for i in xrange(NUM_CATALOG_ROWS):
for j in xrange(NUM_CATALOG_COLS): for j in xrange(NUM_CATALOG_COLS):
if pIndex < len(self.visiblePanels): if pIndex < len(self.visiblePanels):
@ -308,8 +308,8 @@ class CatalogScreen(DirectFrame):
if self.viewing == 'New': if self.viewing == 'New':
text = TTLocalizer.CatalogNew text = TTLocalizer.CatalogNew
elif self.viewing == 'Special': elif self.viewing == 'Loyalty':
text = TTLocalizer.CatalogSpecial text = TTLocalizer.CatalogLoyalty
elif self.viewing == 'Backorder': elif self.viewing == 'Backorder':
text = TTLocalizer.CatalogBackorder text = TTLocalizer.CatalogBackorder
elif self.viewing == 'Emblem': elif self.viewing == 'Emblem':
@ -317,13 +317,13 @@ class CatalogScreen(DirectFrame):
self.pageLabel['text'] = text + ' - %d' % (self.pageIndex + 1) self.pageLabel['text'] = text + ' - %d' % (self.pageIndex + 1)
if self.pageIndex < self.maxPageIndex: if self.pageIndex < self.maxPageIndex:
self.nextPageButton.show() self.nextPageButton.show()
elif self.viewing == 'New' and self.numBackPages == 0 and self.numSpecialPages == 0: elif self.viewing == 'New' and self.numBackPages == 0 and self.numLoyaltyPages == 0:
self.nextPageButton.hide() self.nextPageButton.hide()
elif self.viewing == 'Backorder' and self.numSpecialPages == 0: elif self.viewing == 'Backorder' and self.numLoyaltyPages == 0:
self.nextPageButton.hide() self.nextPageButton.hide()
elif self.viewing == 'Special' and self.numEmblemPages == 0: elif self.viewing == 'Loyalty' and self.numEmblemPages == 0:
self.nextPageButton.hide() self.nextPageButton.hide()
elif self.viewing == 'Special' and self.numEmblemPages > 0: elif self.viewing == 'Loyalty' and self.numEmblemPages > 0:
self.nextPageButton.show() self.nextPageButton.show()
elif self.viewing == 'Emblem': elif self.viewing == 'Emblem':
self.nextPageButton.hide() self.nextPageButton.hide()
@ -358,7 +358,7 @@ class CatalogScreen(DirectFrame):
for page in self.backPageList: for page in self.backPageList:
page.hide() page.hide()
for page in self.specialPageList: for page in self.loyaltyPageList:
page.hide() page.hide()
for page in self.emblemPageList: for page in self.emblemPageList:
@ -389,26 +389,26 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.show() self.newCatalogButton2.show()
if self.numBackPages > 0: if self.numBackPages > 0:
self.backCatalogButton2.show() self.backCatalogButton2.show()
if self.numSpecialPages > 0: if self.numLoyaltyPages > 0:
self.specialCatalogButton2.show() self.loyaltyCatalogButton2.show()
if self.numEmblemPages > 0: if self.numEmblemPages > 0:
self.emblemCatalogButton2.show() self.emblemCatalogButton2.show()
self.newCatalogButton.hide() self.newCatalogButton.hide()
self.backCatalogButton.hide() self.backCatalogButton.hide()
self.specialCatalogButton.hide() self.loyaltyCatalogButton.hide()
self.emblemCatalogButton.hide() self.emblemCatalogButton.hide()
def hideDummyTabs(self): def hideDummyTabs(self):
self.newCatalogButton2.hide() self.newCatalogButton2.hide()
self.backCatalogButton2.hide() self.backCatalogButton2.hide()
self.specialCatalogButton2.hide() self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton2.hide() self.emblemCatalogButton2.hide()
if self.numNewPages > 0: if self.numNewPages > 0:
self.newCatalogButton.show() self.newCatalogButton.show()
if self.numBackPages > 0: if self.numBackPages > 0:
self.backCatalogButton.show() self.backCatalogButton.show()
if self.numSpecialPages > 0: if self.numLoyaltyPages > 0:
self.specialCatalogButton.show() self.loyaltyCatalogButton.show()
if self.numEmblemPages > 0: if self.numEmblemPages > 0:
self.emblemCatalogButton.show() self.emblemCatalogButton.show()
@ -442,14 +442,14 @@ class CatalogScreen(DirectFrame):
self.maxPageIndex = 0 self.maxPageIndex = 0
self.numNewPages = 0 self.numNewPages = 0
self.numBackPages = 5 self.numBackPages = 5
self.numSpecialPages = 0 self.numLoyaltyPages = 0
self.viewing = 'New' self.viewing = 'New'
self.panelList = [] self.panelList = []
self.backPanelList = [] self.backPanelList = []
self.pageList = [] self.pageList = []
self.backPageList = [] self.backPageList = []
self.specialPanelList = [] self.loyaltyPanelList = []
self.specialPageList = [] self.loyaltyPageList = []
self.emblemPanelList = [] self.emblemPanelList = []
self.emblemPageList = [] self.emblemPageList = []
self.panelDict = {} self.panelDict = {}
@ -505,19 +505,19 @@ class CatalogScreen(DirectFrame):
-0.2, -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)) 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.backCatalogButton2.hide()
self.specialCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2, self.loyaltyCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
0.25, 0.25,
-0.85, -0.85,
-0.3), image=[newDown, -0.3), image=[newDown,
newDown, newDown,
newDown, newDown,
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)) 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.specialCatalogButton.hide() self.loyaltyCatalogButton.hide()
self.specialCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2, self.loyaltyCatalogButton2 = DirectButton(self.base, relief=None, pos=(0, 0, 0.469), frameSize=(-0.2,
0.25, 0.25,
-0.85, -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.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)) -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.specialCatalogButton2.hide() self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 1.05), frameSize=(-0.2, self.emblemCatalogButton = DirectButton(self.base, relief=None, pos=(0, 0, 1.05), frameSize=(-0.2,
0.25, 0.25,
-2.0, -2.0,
@ -564,8 +564,8 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.component('text%d' % i).setR(90) self.newCatalogButton2.component('text%d' % i).setR(90)
self.backCatalogButton.component('text%d' % i).setR(90) self.backCatalogButton.component('text%d' % i).setR(90)
self.backCatalogButton2.component('text%d' % i).setR(90) self.backCatalogButton2.component('text%d' % i).setR(90)
self.specialCatalogButton.component('text%d' % i).setR(90) self.loyaltyCatalogButton.component('text%d' % i).setR(90)
self.specialCatalogButton2.component('text%d' % i).setR(90) self.loyaltyCatalogButton2.component('text%d' % i).setR(90)
self.emblemCatalogButton.component('text%d' % i).setR(90) self.emblemCatalogButton.component('text%d' % i).setR(90)
self.emblemCatalogButton2.component('text%d' % i).setR(90) self.emblemCatalogButton2.component('text%d' % i).setR(90)
@ -609,8 +609,8 @@ class CatalogScreen(DirectFrame):
continue continue
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId: if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
continue continue
if item.getIsSpecial(): if item.loyaltyRequirement() != 0:
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self)) self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
elif item.getEmblemPrices(): elif item.getEmblemPrices():
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly, parentCatalogScreen=self)) self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly, parentCatalogScreen=self))
else: else:
@ -627,8 +627,8 @@ class CatalogScreen(DirectFrame):
continue continue
if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId: if isMaxBankOffered and item in allBankItems and item.furnitureType != CatalogFurnitureItem.MaxBankId:
continue continue
if item.getIsSpecial(): if item.loyaltyRequirement() != 0:
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self)) self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
elif item.getEmblemPrices(): elif item.getEmblemPrices():
self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder, parentCatalogScreen=self)) self.emblemPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder, parentCatalogScreen=self))
else: else:
@ -638,8 +638,8 @@ class CatalogScreen(DirectFrame):
self.setNumNewPages(numPages) self.setNumNewPages(numPages)
numPages = self.packPages(self.backPanelList, self.backPageList, 'back') numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
self.setNumBackPages(numPages) self.setNumBackPages(numPages)
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special') numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
self.setNumSpecialPages(numPages) self.setNumLoyaltyPages(numPages)
numPages = self.packPages(self.emblemPanelList, self.emblemPageList, 'emblem') numPages = self.packPages(self.emblemPanelList, self.emblemPageList, 'emblem')
self.setNumEmblemPages(numPages) self.setNumEmblemPages(numPages)
currentWeek = base.localAvatar.catalogScheduleCurrentWeek - 1 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) self.clarabelleFrame.setPosHprScale(-0.01, 0.0, -0.01, 0.0, 0.0, 0.0, 1.02, 1.0, 1.02)
def reload(self): def reload(self):
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList: for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
panel.destroy() panel.destroy()
def priceSort(a, b, type): def priceSort(a, b, type):
@ -764,23 +764,23 @@ class CatalogScreen(DirectFrame):
self.maxPageIndex = 0 self.maxPageIndex = 0
self.numNewPages = 0 self.numNewPages = 0
self.numBackPages = 5 self.numBackPages = 5
self.numSpecialPages = 0 self.numLoyaltyPages = 0
self.viewing = 'New' self.viewing = 'New'
self.panelList = [] self.panelList = []
self.backPanelList = [] self.backPanelList = []
self.specialList = [] self.loyaltyList = []
self.pageList = [] self.pageList = []
self.backPageList = [] self.backPageList = []
self.specialPanelList = [] self.loyaltyPanelList = []
self.specialPageList = [] self.loyaltyPageList = []
self.panelDict = {} self.panelDict = {}
self.visiblePanels = [] self.visiblePanels = []
itemList = base.localAvatar.monthlyCatalog + base.localAvatar.weeklyCatalog itemList = base.localAvatar.monthlyCatalog + base.localAvatar.weeklyCatalog
itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeWeekly)) itemList.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeWeekly))
itemList.reverse() itemList.reverse()
for item in itemList: for item in itemList:
if item.getIsSpecial(): if item.loyaltyRequirement() != 0:
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self)) self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
else: else:
self.panelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeWeekly)) 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.sort(lambda a, b: priceSort(a, b, CatalogItem.CatalogTypeBackorder))
itemList.reverse() itemList.reverse()
for item in itemList: for item in itemList:
if item.getIsSpecial(): if item.loyaltyRequirement() != 0:
self.specialPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeSpecial, parentCatalogScreen=self)) self.loyaltyPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeLoyalty, parentCatalogScreen=self))
else: else:
self.backPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder)) self.backPanelList.append(CatalogItemPanel.CatalogItemPanel(parent=hidden, item=item, type=CatalogItem.CatalogTypeBackorder))
@ -797,8 +797,8 @@ class CatalogScreen(DirectFrame):
self.setNumNewPages(numPages) self.setNumNewPages(numPages)
numPages = self.packPages(self.backPanelList, self.backPageList, 'back') numPages = self.packPages(self.backPanelList, self.backPageList, 'back')
self.setNumBackPages(numPages) self.setNumBackPages(numPages)
numPages = self.packPages(self.specialPanelList, self.specialPageList, 'special') numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
self.setNumSpecialPages(numPages) self.setNumLoyaltyPages(numPages)
seriesNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) / ToontownGlobals.CatalogNumWeeksPerSeries + 1 seriesNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) / ToontownGlobals.CatalogNumWeeksPerSeries + 1
self.catalogSeries['text'] = Localizer.CatalogSeriesLabel % seriesNumber self.catalogSeries['text'] = Localizer.CatalogSeriesLabel % seriesNumber
weekNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) % ToontownGlobals.CatalogNumWeeksPerSeries + 1 weekNumber = (base.localAvatar.catalogScheduleCurrentWeek - 1) % ToontownGlobals.CatalogNumWeeksPerSeries + 1
@ -820,7 +820,7 @@ class CatalogScreen(DirectFrame):
self.destroy() self.destroy()
del self.base del self.base
del self.squares del self.squares
for panel in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList: for panel in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
panel.destroy() panel.destroy()
del self.panelList del self.panelList
@ -838,8 +838,8 @@ class CatalogScreen(DirectFrame):
del self.newCatalogButton2 del self.newCatalogButton2
del self.backCatalogButton del self.backCatalogButton
del self.backCatalogButton2 del self.backCatalogButton2
del self.specialCatalogButton del self.loyaltyCatalogButton
del self.specialCatalogButton2 del self.loyaltyCatalogButton2
del self.pageLabel del self.pageLabel
if self.createdGiftGui: if self.createdGiftGui:
del self.giftToggle del self.giftToggle
@ -878,8 +878,8 @@ class CatalogScreen(DirectFrame):
self.newCatalogButton2.hide() self.newCatalogButton2.hide()
self.backCatalogButton.hide() self.backCatalogButton.hide()
self.backCatalogButton2.hide() self.backCatalogButton2.hide()
self.specialCatalogButton.hide() self.loyaltyCatalogButton.hide()
self.specialCatalogButton2.hide() self.loyaltyCatalogButton2.hide()
self.emblemCatalogButton.hide() self.emblemCatalogButton.hide()
self.emblemCatalogButton2.hide() self.emblemCatalogButton2.hide()
self.hangup.hide() self.hangup.hide()
@ -901,7 +901,7 @@ class CatalogScreen(DirectFrame):
self.__giftToggle() self.__giftToggle()
if hasattr(self, 'beanBank'): if hasattr(self, 'beanBank'):
self.beanBank['text'] = str(base.localAvatar.getTotalMoney()) self.beanBank['text'] = str(base.localAvatar.getTotalMoney())
for item in self.panelList + self.backPanelList + self.specialPanelList + self.emblemPanelList: for item in self.panelList + self.backPanelList + self.loyaltyPanelList + self.emblemPanelList:
if type(item) != type(''): if type(item) != type(''):
item.updateButtons(self.gifting) item.updateButtons(self.gifting)

View file

@ -1663,6 +1663,9 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips) DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips)
self.inventory.updateTotalPropsText() self.inventory.updateTotalPropsText()
def getAccountDays(self):
return base.cr.accountDateMgr.getAccountDays()
def hasActiveBoardingGroup(self): def hasActiveBoardingGroup(self):
if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty: if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty:
return localAvatar.boardingParty.hasActiveGroup(localAvatar.doId) return localAvatar.boardingParty.hasActiveGroup(localAvatar.doId)

View file

@ -5451,7 +5451,7 @@ CatalogCurrency = 'beans'
CatalogHangUp = 'Hang Up' CatalogHangUp = 'Hang Up'
CatalogNew = 'NEW' CatalogNew = 'NEW'
CatalogBackorder = 'BACKORDER' CatalogBackorder = 'BACKORDER'
CatalogSpecial = 'SPECIAL' CatalogLoyalty = 'SPECIAL'
CatalogEmblem = 'EMBLEM' CatalogEmblem = 'EMBLEM'
CatalogPagePrefix = 'Page' CatalogPagePrefix = 'Page'
CatalogGreeting = "Hello! Thanks for calling Clarabelle's Cattlelog. Can I help you?" CatalogGreeting = "Hello! Thanks for calling Clarabelle's Cattlelog. Can I help you?"
@ -8133,6 +8133,7 @@ ElevatorLawBotCourse0 = 'Office A'
ElevatorLawBotCourse1 = 'Office B' ElevatorLawBotCourse1 = 'Office B'
ElevatorLawBotCourse2 = 'Office C' ElevatorLawBotCourse2 = 'Office C'
ElevatorLawBotCourse3 = 'Office D' ElevatorLawBotCourse3 = 'Office D'
DaysToGo = 'Wait\n%s Days'
IceGameTitle = 'Ice Slide' 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!' 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.' 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.'

View file

@ -329,7 +329,7 @@ class LoginAccountFSM(OperationFSM):
'ACCOUNT_AV_SET': [0] * 6, 'ACCOUNT_AV_SET': [0] * 6,
'ESTATE_ID': 0, 'ESTATE_ID': 0,
'ACCOUNT_AV_SET_DEL': [], 'ACCOUNT_AV_SET_DEL': [],
'CREATED': time.time(), 'CREATED': time.ctime(),
'LAST_LOGIN': time.ctime(), 'LAST_LOGIN': time.ctime(),
'LAST_LOGIN_TS': time.time(), 'LAST_LOGIN_TS': time.time(),
'ACCOUNT_ID': str(self.userId), 'ACCOUNT_ID': str(self.userId),