mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-26 21:22:27 -06:00
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
|
from direct.directnotify import DirectNotifyGlobal
|
||
|
from otp.speedchat.SCMenu import SCMenu
|
||
|
from otp.speedchat import SCMenuHolder
|
||
|
from otp.speedchat.SCStaticTextTerminal import SCStaticTextTerminal
|
||
|
from otp.otpbase import OTPLocalizer
|
||
|
from toontown.toonbase import ToontownGlobals
|
||
|
holidayId2menuInfo = {}
|
||
|
|
||
|
class TTSCPromotionalMenu(SCMenu):
|
||
|
notify = DirectNotifyGlobal.directNotify.newCategory('TTSCPromotionalMenu')
|
||
|
|
||
|
def __init__(self):
|
||
|
SCMenu.__init__(self)
|
||
|
base.TTSCPromotionalMenu = self
|
||
|
self.curHolidayId = None
|
||
|
self.clearMenu()
|
||
|
return
|
||
|
|
||
|
def destroy(self):
|
||
|
del base.TTSCPromotionalMenu
|
||
|
SCMenu.destroy(self)
|
||
|
|
||
|
def startHoliday(self, holidayId):
|
||
|
if self.curHolidayId is not None:
|
||
|
TTSCPromotionalMenu.notify.warning('overriding existing holidayId %s with %s' % (self.curHolidayId, holidayId))
|
||
|
self.curHolidayId = holidayId
|
||
|
title, structure = holidayId2menuInfo[holidayId]
|
||
|
self.rebuildFromStructure(structure, title=title)
|
||
|
return
|
||
|
|
||
|
def endHoliday(self, holidayId):
|
||
|
if holidayId != self.curHolidayId:
|
||
|
TTSCPromotionalMenu.notify.warning('unexpected holidayId: %s' % holidayId)
|
||
|
return
|
||
|
self.curHolidayId = None
|
||
|
self.clearMenu()
|
||
|
return
|