def __init__(self): self.allChatMode = True self.chatInputSet = None ui.Window.__init__(self) self.AddFlag("float") self.AddFlag("movable") self.SetWindowName("ChatLogWindow") self.__CreateChatInputSet() self.__CreateWindow() self.__CreateButton() self.__CreateScrollBar() self.chatID = chat.CreateChatSet(chat.CHAT_SET_LOG_WINDOW) chat.SetBoardState(self.chatID, chat.BOARD_STATE_LOG) for i in self.CHAT_MODE_INDEX: chat.EnableChatMode(self.chatID, i) self.SetPosition(20, 20) self.SetSize(self.CHAT_LOG_WINDOW_MINIMUM_WIDTH, self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT) self.btnSizing.SetPosition( self.CHAT_LOG_WINDOW_MINIMUM_WIDTH - self.btnSizing.GetWidth(), self.CHAT_LOG_WINDOW_MINIMUM_HEIGHT - self.btnSizing.GetHeight() + 2) self.OnResize()
def OpenChat(self): self.SetSize(self.CHAT_WINDOW_WIDTH, 25) chat.SetBoardState(self.chatID, chat.BOARD_STATE_EDIT) self.boardState = chat.BOARD_STATE_EDIT (x, y, width, height) = self.GetRect() (btnX, btnY) = self.btnChatSizing.GetGlobalPosition() if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y) else: chat.SetPosition(self.chatID, x + 10, y) chat.SetHeight(self.chatID, y - btnY - self.EDIT_LINE_HEIGHT + 100) if self.IsShow(): self.btnChatSizing.Show() self.Refresh() self.btnSendWhisper.SetPosition(self.GetWidth() - 50, 2) self.btnSendWhisper.Show() self.btnChatLog.SetPosition(self.GetWidth() - 25, 2) self.btnChatLog.Show() self.chatInputSet.Open() self.chatInputSet.SetTop() self.SetTop()
def CloseChat(self): chat.SetBoardState(self.chatID, chat.BOARD_STATE_VIEW) self.boardState = chat.BOARD_STATE_VIEW (x, y, width, height) = self.GetRect() if localeInfo.IsARABIC(): chat.SetPosition(self.chatID, x + width - 10, y + self.EDIT_LINE_HEIGHT) else: chat.SetPosition(self.chatID, x + 10, y + self.EDIT_LINE_HEIGHT) self.SetSize(self.CHAT_WINDOW_WIDTH, 0) self.chatInputSet.Close() self.btnSendWhisper.Hide() self.btnChatLog.Hide() self.btnChatSizing.Hide() self.Refresh()
def __init__(self): ui.Window.__init__(self) self.AddFlag("float") self.SetWindowName("ChatWindow") self.__RegisterChatColorDict() self.boardState = chat.BOARD_STATE_VIEW self.chatID = chat.CreateChatSet(chat.CHAT_SET_CHAT_WINDOW) chat.SetBoardState(self.chatID, chat.BOARD_STATE_VIEW) self.xBar = 0 self.yBar = 0 self.widthBar = 0 self.heightBar = 0 self.curHeightBar = 0 self.visibleLineCount = 0 self.scrollBarPos = 1.0 self.scrollLock = False chatInputSet = ChatInputSet() chatInputSet.SetParent(self) chatInputSet.SetEscapeEvent(ui.__mem_func__(self.CloseChat)) chatInputSet.SetReturnEvent(ui.__mem_func__(self.CloseChat)) chatInputSet.SetSize(550, 25) self.chatInputSet = chatInputSet btnSendWhisper = ui.Button() btnSendWhisper.SetParent(self) btnSendWhisper.SetUpVisual( "d:/ymir work/ui/game/taskbar/Send_Whisper_Button_01.sub") btnSendWhisper.SetOverVisual( "d:/ymir work/ui/game/taskbar/Send_Whisper_Button_02.sub") btnSendWhisper.SetDownVisual( "d:/ymir work/ui/game/taskbar/Send_Whisper_Button_03.sub") btnSendWhisper.SetToolTipText(localeInfo.CHAT_SEND_MEMO) btnSendWhisper.Hide() self.btnSendWhisper = btnSendWhisper import uilanguagesystem wndFilterChat = uilanguagesystem.ChatFilterWindow() wndFilterChat.AddFlag("float") wndFilterChat.Hide() self.wndFilterChat = wndFilterChat btnFilterChat = ui.Button() btnFilterChat.SetParent(self) btnFilterChat.SetUpVisual( "d:/ymir work/ui/game/taskbar/ignore_button_01.sub") btnFilterChat.SetOverVisual( "d:/ymir work/ui/game/taskbar/ignore_button_02.sub") btnFilterChat.SetDownVisual( "d:/ymir work/ui/game/taskbar/ignore_button_03.sub") btnFilterChat.SetToolTipText(localeInfo.CHAT_FILTER) btnFilterChat.SAFE_SetEvent(self.ToggleFilterChatWindow) btnFilterChat.Hide() self.btnFilterChat = btnFilterChat btnChatLog = ui.Button() btnChatLog.SetParent(self) btnChatLog.SetUpVisual( "d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_01.sub") btnChatLog.SetOverVisual( "d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_02.sub") btnChatLog.SetDownVisual( "d:/ymir work/ui/game/taskbar/Open_Chat_Log_Button_03.sub") btnChatLog.SetToolTipText(localeInfo.CHAT_LOG) btnChatLog.Hide() self.btnChatLog = btnChatLog btnChatSizing = self.ChatButton() btnChatSizing.SetOwner(self) btnChatSizing.SetMoveEvent(ui.__mem_func__(self.Refresh)) btnChatSizing.Hide() self.btnChatSizing = btnChatSizing imgChatBarLeft = ui.ImageBox() imgChatBarLeft.SetParent(self.btnChatSizing) imgChatBarLeft.AddFlag("not_pick") imgChatBarLeft.LoadImage("d:/ymir work/ui/pattern/chat_bar_left.tga") imgChatBarLeft.Show() self.imgChatBarLeft = imgChatBarLeft imgChatBarRight = ui.ImageBox() imgChatBarRight.SetParent(self.btnChatSizing) imgChatBarRight.AddFlag("not_pick") imgChatBarRight.LoadImage("d:/ymir work/ui/pattern/chat_bar_right.tga") imgChatBarRight.Show() self.imgChatBarRight = imgChatBarRight imgChatBarMiddle = ui.ExpandedImageBox() imgChatBarMiddle.SetParent(self.btnChatSizing) imgChatBarMiddle.AddFlag("not_pick") imgChatBarMiddle.LoadImage( "d:/ymir work/ui/pattern/chat_bar_middle.tga") imgChatBarMiddle.Show() self.imgChatBarMiddle = imgChatBarMiddle scrollBar = ui.ScrollBar() scrollBar.AddFlag("float") scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll)) self.scrollBar = scrollBar self.Refresh() self.chatInputSet.RefreshPosition() # RTL 시 위치를 제대로 잡으려면 위치 갱신이 필요하다