def sendChat(self, text, overflow=False): if self.typeGrabbed: return state = self.getCurrentOrNextState() if state == 'Off': base.localAvatar.chatMgr.chatLog.openChatlog() ChatInputWhiteListFrame.sendChat(self, self.chatEntry.get())
def __init__(self, parent = None, **kw): entryOptions = {'parent': self, 'relief': DGG.SUNKEN, 'scale': 0.035, 'frameColor': (0.9, 0.9, 0.85, 0.0), 'pos': (-0.2, 0, 0.11), 'entryFont': OTPGlobals.getInterfaceFont(), 'width': 8.6, 'numLines': 5, 'cursorKeys': 0, 'backgroundFocus': 0, 'suppressKeys': 0, 'suppressMouse': 1, 'command': self.sendChat, 'failedCommand': self.sendFailed, 'focus': 0, 'text': '', 'sortOrder': DGG.FOREGROUND_SORT_INDEX} ChatInputWhiteListFrame.__init__(self, entryOptions, parent, **kw) self.whiteList = TTWhiteList() base.whiteList = self.whiteList base.ttwl = self self.autoOff = 1 self.sendBy = 'Data' self.prefilter = 0 self.promoteWhiteList = 1 self.typeGrabbed = 0 self.deactivate() gui = loader.loadModel('phase_3.5/models/gui/chat_input_gui') self.chatFrame = DirectFrame(parent=self, image=gui.find('**/Chat_Bx_FNL'), relief=None, pos=(0.0, 0, 0.0), state=DGG.NORMAL) self.chatButton = DirectButton(parent=self.chatFrame, image=(gui.find('**/ChtBx_ChtBtn_UP'), gui.find('**/ChtBx_ChtBtn_DN'), gui.find('**/ChtBx_ChtBtn_RLVR')), pos=(0.182, 0, -0.088), relief=None, text=('', OTPLocalizer.ChatInputNormalSayIt, OTPLocalizer.ChatInputNormalSayIt), text_scale=0.06, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.09), textMayChange=0, command=self.chatButtonPressed) self.cancelButton = DirectButton(parent=self.chatFrame, image=(gui.find('**/CloseBtn_UP'), gui.find('**/CloseBtn_DN'), gui.find('**/CloseBtn_Rllvr')), pos=(-0.151, 0, -0.088), relief=None, text=('', OTPLocalizer.ChatInputNormalCancel, OTPLocalizer.ChatInputNormalCancel), text_scale=0.06, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.09), textMayChange=0, command=self.cancelButtonPressed) self.whisperLabel = DirectLabel(parent=self.chatFrame, pos=(0.02, 0, 0.23), relief=DGG.FLAT, frameColor=(1, 1, 0.5, 1), frameSize=(-0.23, 0.23, -0.07, 0.05), text=OTPLocalizer.ChatInputNormalWhisper, text_scale=0.04, text_fg=Vec4(0, 0, 0, 1), text_wordwrap=9.5, textMayChange=1) self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow) self.chatEntry.bind(DGG.TYPE, self.typeCallback) self.trueFriendChat = 0 if base.config.GetBool('whisper-to-nearby-true-friends', 1): self.accept(self.TFToggleKey, self.shiftPressed) return
def __init__(self, parent = None, **kw): entryOptions = {'parent': self, 'relief': DGG.SUNKEN, 'scale': 0.05, 'frameColor': (0.9, 0.9, 0.85, 0.0), 'pos': (-0.2, 0, 0.11), 'entryFont': OTPGlobals.getInterfaceFont(), 'width': 8.6, 'numLines': 3, 'cursorKeys': 0, 'backgroundFocus': 0, 'suppressKeys': 0, 'suppressMouse': 1, 'command': self.sendChat, 'failedCommand': self.sendFailed, 'focus': 0, 'text': '', 'sortOrder': DGG.FOREGROUND_SORT_INDEX} ChatInputWhiteListFrame.__init__(self, entryOptions, parent, **kw) self.whiteList = TTWhiteList() base.whiteList = self.whiteList base.ttwl = self self.autoOff = 1 self.sendBy = 'Data' self.prefilter = 0 self.promoteWhiteList = 1 self.typeGrabbed = 0 self.deactivate() gui = loader.loadModel('phase_3.5/models/gui/chat_input_gui') self.chatFrame = DirectFrame(parent=self, image=gui.find('**/Chat_Bx_FNL'), relief=None, pos=(0.0, 0, 0.0), state=DGG.NORMAL) self.chatButton = DirectButton(parent=self.chatFrame, image=(gui.find('**/ChtBx_ChtBtn_UP'), gui.find('**/ChtBx_ChtBtn_DN'), gui.find('**/ChtBx_ChtBtn_RLVR')), pos=(0.182, 0, -0.088), relief=None, text=('', OTPLocalizer.ChatInputNormalSayIt, OTPLocalizer.ChatInputNormalSayIt), text_scale=0.06, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.09), textMayChange=0, command=self.chatButtonPressed) self.cancelButton = DirectButton(parent=self.chatFrame, image=(gui.find('**/CloseBtn_UP'), gui.find('**/CloseBtn_DN'), gui.find('**/CloseBtn_Rllvr')), pos=(-0.151, 0, -0.088), relief=None, text=('', OTPLocalizer.ChatInputNormalCancel, OTPLocalizer.ChatInputNormalCancel), text_scale=0.06, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.09), textMayChange=0, command=self.cancelButtonPressed) self.whisperLabel = DirectLabel(parent=self.chatFrame, pos=(0.02, 0, 0.23), relief=DGG.FLAT, frameColor=(1, 1, 0.5, 1), frameSize=(-0.23, 0.23, -0.07, 0.05), text=OTPLocalizer.ChatInputNormalWhisper, text_scale=0.04, text_fg=Vec4(0, 0, 0, 1), text_wordwrap=9.5, textMayChange=1) self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow) self.chatEntry.bind(DGG.TYPE, self.typeCallback) self.trueFriendChat = 0 if base.config.GetBool('whisper-to-nearby-true-friends', 1): self.accept(self.TFToggleKey, self.shiftPressed) return
def enterAvatarWhisper(self): ChatInputWhiteListFrame.enterAvatarWhisper(self) self.labelWhisper()
def exitAllChat(self): ChatInputWhiteListFrame.exitAllChat(self)
def sendChat(self, text, overflow=False): if self.typeGrabbed: return else: ChatInputWhiteListFrame.sendChat(self, self.chatEntry.get())
def destroy(self): self.chatEntry.destroy() self.chatFrame.destroy() self.ignoreAll() ChatInputWhiteListFrame.destroy(self)
def sendChat(self, text, overflow = False): assert self.notify.debug('sendChat') if self.typeGrabbed: return else: ChatInputWhiteListFrame.sendChat(self, self.chatEntry.get())
def __init__(self, parent = None, **kw): entryOptions = { 'parent' : self, 'relief': DGG.SUNKEN, 'scale': 0.05, #'frameSize' : (-0.2, 25.3, -0.5, 1.2), #'borderWidth' : (0.1, 0.1), 'frameColor' : (0.9, 0.9, 0.85, 0.0), 'pos' : (-0.2,0,0.11), 'entryFont' : OTPGlobals.getInterfaceFont(), 'width': 8.6, 'numLines' : 3, 'cursorKeys' : 0, 'backgroundFocus' : 0, 'suppressKeys' : 0, 'suppressMouse' : 1, 'command' : self.sendChat, 'failedCommand': self.sendFailed, 'focus' : 0, 'text' : '', 'sortOrder' : DGG.FOREGROUND_SORT_INDEX, } ChatInputWhiteListFrame.__init__(self, entryOptions, parent, **kw) #self.initialiseoptions(TTChatInputWhiteList) self.whiteList = TTWhiteList() base.whiteList = self.whiteList base.ttwl = self self.autoOff = 1 self.sendBy = "Data" self.prefilter = 0 self.promoteWhiteList = 1 self.typeGrabbed = 0 #self.request("off") self.deactivate() gui = loader.loadModel("phase_3.5/models/gui/chat_input_gui") self.chatFrame = DirectFrame( parent = self, image = gui.find("**/Chat_Bx_FNL"), relief = None, pos = (0.0, 0, 0.0), state = DGG.NORMAL, #sortOrder = DGG.FOREGROUND_SORT_INDEX, ) #self.chatFrame.hide() self.chatButton = DirectButton( parent = self.chatFrame, image = (gui.find("**/ChtBx_ChtBtn_UP"), gui.find("**/ChtBx_ChtBtn_DN"), gui.find("**/ChtBx_ChtBtn_RLVR"), ), pos = (0.182, 0, -0.088), relief = None, text = ("", OTPLocalizer.ChatInputNormalSayIt, OTPLocalizer.ChatInputNormalSayIt), text_scale = 0.06, text_fg = Vec4(1,1,1,1), text_shadow = Vec4(0,0,0,1), text_pos = (0,-0.09), textMayChange = 0, command = self.chatButtonPressed, ) self.cancelButton = DirectButton( parent = self.chatFrame, image = (gui.find("**/CloseBtn_UP"), gui.find("**/CloseBtn_DN"), gui.find("**/CloseBtn_Rllvr"), ), pos = (-0.151, 0, -0.088), relief = None, text = ("", OTPLocalizer.ChatInputNormalCancel, OTPLocalizer.ChatInputNormalCancel), text_scale = 0.06, text_fg = Vec4(1,1,1,1), text_shadow = Vec4(0,0,0,1), text_pos = (0,-0.09), textMayChange = 0, command = self.cancelButtonPressed, ) self.whisperLabel = DirectLabel( parent = self.chatFrame, pos = (0.02, 0, 0.23), relief = DGG.FLAT, frameColor = (1,1,0.5,1), frameSize = (-0.23, 0.23, -0.07, 0.05), text = OTPLocalizer.ChatInputNormalWhisper, text_scale = 0.04, text_fg = Vec4(0,0,0,1), text_wordwrap = 9.5, textMayChange = 1, ) #self.whisperLabel.hide() #self.setPos(-0.35, 0.0, 0.7) self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow) self.chatEntry.bind(DGG.TYPE, self.typeCallback) # self.accept("typeEntryGrab", self.handleTypeGrab) self.trueFriendChat = 0 if ConfigVariableBool('whisper-to-nearby-true-friends', 1).getValue(): self.accept(self.TFToggleKey, self.shiftPressed)
def exitAvatarWhisper(self): ChatInputWhiteListFrame.exitAvatarWhisper(self) self.globalButton['state'] = DGG.NORMAL self.globalButton.component('text3').show() self.whisperLabel.hide()
def enterAvatarWhisper(self): ChatInputWhiteListFrame.enterAvatarWhisper(self) self.globalButton.component('text3').hide() self.globalButton['state'] = DGG.DISABLED self.labelWhisper()
def __init__(self, parent=None, **kw): entryOptions = { "parent": self, "relief": DGG.SUNKEN, "scale": 0.050000000000000003, "frameColor": (0.90000000000000002, 0.90000000000000002, 0.84999999999999998, 0.0), "pos": (-0.20000000000000001, 0, 0.11), "entryFont": OTPGlobals.getInterfaceFont(), "width": 8.5999999999999996, "numLines": 3, "cursorKeys": 0, "backgroundFocus": 0, "suppressKeys": 0, "suppressMouse": 1, "command": self.sendChat, "failedCommand": self.sendFailed, "focus": 0, "text": "", "sortOrder": DGG.FOREGROUND_SORT_INDEX, } ChatInputWhiteListFrame.__init__(self, entryOptions, parent, **None) self.whiteList = TTWhiteList() base.whiteList = self.whiteList base.ttwl = self self.autoOff = 1 self.sendBy = "Data" self.prefilter = 0 self.promoteWhiteList = 1 self.typeGrabbed = 0 self.deactivate() gui = loader.loadModel("phase_3.5/models/gui/chat_input_gui") self.chatFrame = DirectFrame( parent=self, image=gui.find("**/Chat_Bx_FNL"), relief=None, pos=(0.0, 0, 0.0), state=DGG.NORMAL ) self.chatButton = DirectButton( parent=self.chatFrame, image=(gui.find("**/ChtBx_ChtBtn_UP"), gui.find("**/ChtBx_ChtBtn_DN"), gui.find("**/ChtBx_ChtBtn_RLVR")), pos=(0.182, 0, -0.087999999999999995), relief=None, text=("", OTPLocalizer.ChatInputNormalSayIt, OTPLocalizer.ChatInputNormalSayIt), text_scale=0.059999999999999998, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.089999999999999997), textMayChange=0, command=self.chatButtonPressed, ) self.cancelButton = DirectButton( parent=self.chatFrame, image=(gui.find("**/CloseBtn_UP"), gui.find("**/CloseBtn_DN"), gui.find("**/CloseBtn_Rllvr")), pos=(-0.151, 0, -0.087999999999999995), relief=None, text=("", OTPLocalizer.ChatInputNormalCancel, OTPLocalizer.ChatInputNormalCancel), text_scale=0.059999999999999998, text_fg=Vec4(1, 1, 1, 1), text_shadow=Vec4(0, 0, 0, 1), text_pos=(0, -0.089999999999999997), textMayChange=0, command=self.cancelButtonPressed, ) self.whisperLabel = DirectLabel( parent=self.chatFrame, pos=(0.02, 0, 0.23000000000000001), relief=DGG.FLAT, frameColor=(1, 1, 0.5, 1), frameSize=(-0.23000000000000001, 0.23000000000000001, -0.070000000000000007, 0.050000000000000003), text=OTPLocalizer.ChatInputNormalWhisper, text_scale=0.040000000000000001, text_fg=Vec4(0, 0, 0, 1), text_wordwrap=9.5, textMayChange=1, ) self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow) self.chatEntry.bind(DGG.TYPE, self.typeCallback) self.trueFriendChat = 0 if base.config.GetBool("whisper-to-nearby-true-friends", 1): self.accept(self.TFToggleKey, self.shiftPressed)
def enterPlayerWhisper(self): ChatInputWhiteListFrame.enterPlayerWhisper(self) self.labelWhisper()
def exitAllChat(self): #print("exitAllChat") ChatInputWhiteListFrame.exitAllChat(self)
def exitAvatarWhisper(self): ChatInputWhiteListFrame.exitAvatarWhisper(self) self.whisperLabel.hide()
def enterPlayerWhisper(self): ChatInputWhiteListFrame.enterPlayerWhisper(self) #self.whisperLabel.show() self.labelWhisper()
def delete(self): base.whiteList = None ChatInputWhiteListFrame.delete(self) return
def enterAvatarWhisper(self): #print("enterAvatarWhisper") ChatInputWhiteListFrame.enterAvatarWhisper(self) #self.whisperLabel.show() self.labelWhisper()
def delete(self): ChatInputWhiteListFrame.delete(self) return
def enterAllChat(self): ChatInputWhiteListFrame.enterAllChat(self) self.whisperLabel.hide()
def sendChat(self, text, overflow = False): if self.typeGrabbed: return else: ChatInputWhiteListFrame.sendChat(self, self.chatEntry.get())