2019-11-02 22:27:54 +00:00
|
|
|
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
|
|
|
|
SillyPhaseTwoMenu = [(OTPLocalizer.SillyHolidayMenuSections[1], [30310,
|
|
|
|
30311,
|
|
|
|
30312,
|
|
|
|
30313,
|
|
|
|
30314,
|
|
|
|
30315]), (OTPLocalizer.SillyHolidayMenuSections[2], [30316, 30317]), (OTPLocalizer.SillyHolidayMenuSections[0], [30309])]
|
|
|
|
|
|
|
|
class TTSCSillyPhaseTwoMenu(SCMenu):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
SCMenu.__init__(self)
|
|
|
|
self.__SillyPhaseTwoMessagesChanged()
|
|
|
|
submenus = []
|
|
|
|
|
|
|
|
def destroy(self):
|
|
|
|
SCMenu.destroy(self)
|
|
|
|
|
|
|
|
def clearMenu(self):
|
|
|
|
SCMenu.clearMenu(self)
|
|
|
|
|
|
|
|
def __SillyPhaseTwoMessagesChanged(self):
|
|
|
|
self.clearMenu()
|
|
|
|
try:
|
|
|
|
lt = base.localAvatar
|
|
|
|
except:
|
|
|
|
return
|
|
|
|
|
|
|
|
for section in SillyPhaseTwoMenu:
|
|
|
|
if section[0] == -1:
|
|
|
|
for phrase in section[1]:
|
|
|
|
if phrase not in OTPLocalizer.SpeedChatStaticText:
|
2019-12-30 06:07:56 +00:00
|
|
|
print('warning: tried to link Silly PhaseTwo phrase %s which does not seem to exist' % phrase)
|
2019-11-02 22:27:54 +00:00
|
|
|
break
|
|
|
|
self.append(SCStaticTextTerminal(phrase))
|
|
|
|
|
|
|
|
else:
|
|
|
|
menu = SCMenu()
|
|
|
|
for phrase in section[1]:
|
|
|
|
if phrase not in OTPLocalizer.SpeedChatStaticText:
|
2019-12-30 06:07:56 +00:00
|
|
|
print('warning: tried to link Silly PhaseTwo phrase %s which does not seem to exist' % phrase)
|
2019-11-02 22:27:54 +00:00
|
|
|
break
|
|
|
|
menu.append(SCStaticTextTerminal(phrase))
|
|
|
|
|
|
|
|
menuName = str(section[0])
|
|
|
|
self.append(SCMenuHolder(menuName, menu))
|