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

48 lines
1.7 KiB
Python
Executable file

from direct.showbase import PythonUtil
from otp.speedchat.SCMenu import SCMenu
from otp.speedchat.SCMenuHolder import SCMenuHolder
from otp.speedchat.SCStaticTextTerminal import SCStaticTextTerminal
from otp.otpbase import OTPLocalizer
SillyPhaseFourMenu = [(OTPLocalizer.SillyHolidayMenuSections[1], [30325, 30326, 30327]), (OTPLocalizer.SillyHolidayMenuSections[2], [30329,
30330,
30331,
30332])]
class TTSCSillyPhaseFourMenu(SCMenu):
def __init__(self):
SCMenu.__init__(self)
self.__SillyPhaseFourMessagesChanged()
submenus = []
def destroy(self):
SCMenu.destroy(self)
def clearMenu(self):
SCMenu.clearMenu(self)
def __SillyPhaseFourMessagesChanged(self):
self.clearMenu()
try:
lt = base.localAvatar
except:
return
for section in SillyPhaseFourMenu:
if section[0] == -1:
for phrase in section[1]:
if phrase not in OTPLocalizer.SpeedChatStaticText:
print 'warning: tried to link Silly PhaseFour phrase %s which does not seem to exist' % phrase
break
self.append(SCStaticTextTerminal(phrase))
else:
menu = SCMenu()
for phrase in section[1]:
if phrase not in OTPLocalizer.SpeedChatStaticText:
print 'warning: tried to link Silly PhaseFour phrase %s which does not seem to exist' % phrase
break
menu.append(SCStaticTextTerminal(phrase))
menuName = str(section[0])
self.append(SCMenuHolder(menuName, menu))