Poodletooth-iLand/otp/speedchat/SCStaticTextTerminal.py

21 lines
608 B
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from SCTerminal import SCTerminal
from otp.otpbase.OTPLocalizer import SpeedChatStaticText
SCStaticTextMsgEvent = 'SCStaticTextMsg'
def decodeSCStaticTextMsg(textId):
2015-06-23 15:20:41 -05:00
if 30200 <= textId <= 30205:
textId += 20
2015-03-03 16:10:12 -06:00
2015-06-23 15:20:41 -05:00
return SpeedChatStaticText.get(textId, None)
2015-03-03 16:10:12 -06:00
class SCStaticTextTerminal(SCTerminal):
def __init__(self, textId):
SCTerminal.__init__(self)
self.textId = textId
self.text = SpeedChatStaticText[self.textId]
def handleSelect(self):
SCTerminal.handleSelect(self)
messenger.send(self.getEventName(SCStaticTextMsgEvent), [self.textId])