more catalog fixes

This commit is contained in:
Open Toontown 2022-01-16 23:17:43 -05:00
parent edff78dbef
commit c17cbffc47
2 changed files with 16 additions and 16 deletions

View file

@ -1152,19 +1152,19 @@ def get50ItemCloset(avatar, duplicateItems):
def getMaxClosets(): def getMaxClosets():
list = [] maxClosets = []
for closetId in MaxClosetIds: for closetId in MaxClosetIds:
list.append(CatalogFurnitureItem(closetId)) maxClosets.append(CatalogFurnitureItem(closetId))
return list return maxClosets
def getAllClosets(): def getAllClosets():
list = [] allClosets = []
for closetId in list(ClosetToClothes.keys()): for closetId in list(ClosetToClothes.keys()):
list.append(CatalogFurnitureItem(closetId)) allClosets.append(CatalogFurnitureItem(closetId))
return list return allClosets
def get50ItemTrunk(avatar, duplicateItems): def get50ItemTrunk(avatar, duplicateItems):
@ -1180,17 +1180,17 @@ def get50ItemTrunk(avatar, duplicateItems):
def getMaxTrunks(): def getMaxTrunks():
list = [] maxTrunks = []
for trunkId in MaxTrunkIds: for trunkId in MaxTrunkIds:
list.append(CatalogFurnitureItem(trunkId)) maxTrunks.append(CatalogFurnitureItem(trunkId))
return list return maxTrunks
def getAllFurnitures(index): def getAllFurnitures(index):
list = [] allFurnitures = []
colors = FurnitureTypes[index][FTColorOptions] colors = FurnitureTypes[index][FTColorOptions]
for n in range(len(colors)): for n in range(len(colors)):
list.append(CatalogFurnitureItem(index, n)) allFurnitures.append(CatalogFurnitureItem(index, n))
return list return allFurnitures

View file

@ -646,17 +646,17 @@ class CatalogScreen(DirectFrame):
self.setNumEmblemPages(numPages) self.setNumEmblemPages(numPages)
currentWeek = base.localAvatar.catalogScheduleCurrentWeek - 1 currentWeek = base.localAvatar.catalogScheduleCurrentWeek - 1
if currentWeek < 57: if currentWeek < 57:
seriesNumber = currentWeek / ToontownGlobals.CatalogNumWeeksPerSeries + 1 seriesNumber = currentWeek // ToontownGlobals.CatalogNumWeeksPerSeries + 1
weekNumber = currentWeek % ToontownGlobals.CatalogNumWeeksPerSeries + 1 weekNumber = currentWeek % ToontownGlobals.CatalogNumWeeksPerSeries + 1
elif currentWeek < 65: elif currentWeek < 65:
seriesNumber = 6 seriesNumber = 6
weekNumber = currentWeek - 56 weekNumber = currentWeek - 56
else: else:
seriesNumber = currentWeek / ToontownGlobals.CatalogNumWeeksPerSeries + 2 seriesNumber = currentWeek // ToontownGlobals.CatalogNumWeeksPerSeries + 2
weekNumber = currentWeek % ToontownGlobals.CatalogNumWeeksPerSeries + 1 weekNumber = currentWeek % ToontownGlobals.CatalogNumWeeksPerSeries + 1
geom = NodePath('cover') geom = NodePath('cover')
cover = guiItems.find('**/cover') cover = guiItems.find('**/cover')
maxSeries = ToontownGlobals.CatalogNumWeeks / ToontownGlobals.CatalogNumWeeksPerSeries + 1 maxSeries = ToontownGlobals.CatalogNumWeeks // ToontownGlobals.CatalogNumWeeksPerSeries + 1
coverSeries = (seriesNumber - 1) % maxSeries + 1 coverSeries = (seriesNumber - 1) % maxSeries + 1
coverPicture = cover.find('**/cover_picture%s' % coverSeries) coverPicture = cover.find('**/cover_picture%s' % coverSeries)
if not coverPicture.isEmpty(): if not coverPicture.isEmpty():
@ -786,7 +786,7 @@ class CatalogScreen(DirectFrame):
self.setNumBackPages(numPages) self.setNumBackPages(numPages)
numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty') numPages = self.packPages(self.loyaltyPanelList, self.loyaltyPageList, 'loyalty')
self.setNumLoyaltyPages(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
self.catalogNumber['text'] = '#%d' % weekNumber self.catalogNumber['text'] = '#%d' % weekNumber