2019-12-30 00:00:16 -06:00
|
|
|
from .SCMenu import SCMenu
|
|
|
|
from .SCCustomTerminal import SCCustomTerminal
|
2019-11-02 17:27:54 -05:00
|
|
|
from otp.otpbase.OTPLocalizer import CustomSCStrings
|
|
|
|
|
|
|
|
class SCCustomMenu(SCMenu):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
SCMenu.__init__(self)
|
|
|
|
self.accept('customMessagesChanged', self.__customMessagesChanged)
|
|
|
|
self.__customMessagesChanged()
|
|
|
|
|
|
|
|
def destroy(self):
|
|
|
|
SCMenu.destroy(self)
|
|
|
|
|
|
|
|
def __customMessagesChanged(self):
|
|
|
|
self.clearMenu()
|
|
|
|
try:
|
|
|
|
lt = base.localAvatar
|
|
|
|
except:
|
|
|
|
return
|
|
|
|
|
|
|
|
for msgIndex in lt.customMessages:
|
2019-12-30 00:00:16 -06:00
|
|
|
if msgIndex in CustomSCStrings:
|
2019-11-02 17:27:54 -05:00
|
|
|
self.append(SCCustomTerminal(msgIndex))
|