Poodletooth-iLand/toontown/speedchat/TTSCPromotionalMenu.py
Master Jumblespeed d882959bfa switch to remote
2015-05-18 22:11:33 -04:00

37 lines
1.3 KiB
Python
Executable file

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