def ScrollBar(self, parent, width, heigh): tmpScrollBar = ui.ScrollBar() if parent: tmpScrollBar.SetParent(parent) tmpScrollBar.SetPosition(width-15, 17) tmpScrollBar.SetScrollBarSize(heigh) tmpScrollBar.Show() return tmpScrollBar
def FileListBox(self, parent, x, y, width, heigh, count): ListBox = ui.ListBoxEx() ListBox.SetParent(parent) ListBox.SetPosition(x, y) ListBox.SetViewItemCount(count) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(width - 20, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return ListBox, scroll
def __LoadInformation_Drops(self, race): self.AppendSeperator() if race in constInfo.MONSTER_INFO_DATA: if len(constInfo.MONSTER_INFO_DATA[race]["items"]) == 0: self.AppendTextLine( localeInfo.TARGET_INFO_NO_ITEM_TEXT) else: itemListBox = ui.ListBoxExNew(32 + 5, self.MAX_ITEM_COUNT) itemListBox.SetSize( self.GetWidth() - 15 * 2 - ui.ScrollBar.SCROLLBAR_WIDTH, (32 + 5) * self.MAX_ITEM_COUNT) height = 0 for curItem in constInfo.MONSTER_INFO_DATA[race][ "items"]: if curItem.has_key("vnum_list"): height += self.AppendItem( itemListBox, curItem["vnum_list"], curItem["count"]) else: height += self.AppendItem( itemListBox, curItem["vnum"], curItem["count"]) if height < itemListBox.GetHeight(): itemListBox.SetSize(itemListBox.GetWidth(), height) self.AppendWindow(itemListBox, 15) itemListBox.SetBasePos(0) if len(constInfo.MONSTER_INFO_DATA[race] ["items"]) > itemListBox.GetViewItemCount(): itemScrollBar = ui.ScrollBar() itemScrollBar.SetParent(self) itemScrollBar.SetPosition(itemListBox.GetRight(), itemListBox.GetTop()) itemScrollBar.SetScrollBarSize( 32 * self.MAX_ITEM_COUNT + 5 * (self.MAX_ITEM_COUNT - 1)) itemScrollBar.SetMiddleBarSize( float(self.MAX_ITEM_COUNT) / float(height / (32 + 5))) itemScrollBar.Show() itemListBox.SetScrollBar(itemScrollBar) else: self.AppendTextLine(localeInfo.TARGET_INFO_NO_ITEM_TEXT)
def ListBoxEx(self, parent, x, y, width, heigh): bar = ui.Bar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width, heigh) bar.SetColor(0x77000000) bar.Show() ListBox = ui.ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(ListBox) scroll.SetPosition(width - 15, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return bar, ListBox
def ListBoxEx2(self, parent, x, y, width, heigh): bar = ui.Bar() if parent != None: bar.SetParent(parent) bar.SetPosition(x, y) bar.SetSize(width + 20, heigh) bar.SetColor(1996488704) bar.Show() ListBox = ui.ListBoxEx() ListBox.SetParent(bar) ListBox.SetPosition(0, 0) ListBox.SetViewItemCount(5) ListBox.SetSize(width, heigh) ListBox.Show() scroll = ui.ScrollBar() scroll.SetParent(bar) scroll.SetPosition(width + 5, 0) scroll.SetScrollBarSize(heigh) scroll.Show() ListBox.SetScrollBar(scroll) return (bar, ListBox, scroll)
def BuildUI(self): posX = 500 self.AddFlag('movable') self.AddFlag('float') self.SetSize(posX, 150) self.SetTitleName("Offline Shop Panel") self.SetCloseEvent(self.OpenWindow) self.SetCenterPosition() self.Show() self.bar = ui.Bar() self.bar.SetParent(self) self.bar.SetPosition(10, 35) self.bar.SetSize(posX - 20, 100) self.bar.SetColor(0x77000000) self.bar.Show() self.ListBox = ui.ListBoxEx() self.ListBox.SetParent(self.bar) self.ListBox.SetPosition(0, 0) self.ListBox.SetSize(posX, 100) self.ListBox.SetViewItemCount(5) self.ListBox.Show() self.scroll = ui.ScrollBar() self.scroll.SetParent(self.ListBox) self.scroll.SetPosition(posX-35, 0) self.scroll.SetScrollBarSize(200/2) self.scroll.Show() self.ListBox.SetScrollBar(self.scroll) self.refresh = ui.Button() self.refresh.SetParent(self) self.refresh.SetPosition(self.GetWidth() - 50, 8) self.refresh.SetUpVisual("d:/ymir work/ui/game/guild/Refresh_Button_01.sub") self.refresh.SetOverVisual("d:/ymir work/ui/game/guild/Refresh_Button_02.sub") self.refresh.SetDownVisual("d:/ymir work/ui/game/guild/Refresh_Button_03.sub") self.refresh.SetText("") self.refresh.SetEvent(self.Refresh) self.refresh.Show()
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 시 위치를 제대로 잡으려면 위치 갱신이 필요하다
def LoadUI(self): settinginfo.Achievement_Statistic["status"] = 1 self.Board = ui.BoardWithTitleBar() self.Board.SetSize(266, 415) # 266 self.Board.SetCenterPosition() self.Board.AddFlag("movable") self.Board.AddFlag("float") self.Board.SetTitleName("Achievement-Statistik") self.Board.SetCloseEvent(self.__del__) self.Board.Show() self.itemtooltip = uiToolTip.ItemToolTip() self.itemtooltip.HideToolTip() self.BossButtonUp = ui.Button() self.BossButtonUp.SetParent(self.Board) self.BossButtonUp.SetPosition(16,33) self.BossButtonUp.SetText("") self.BossButtonUp.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_01.sub") self.BossButtonUp.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_02.sub") self.BossButtonUp.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.BossButtonUp.SetEvent(ui.__mem_func__(self.ChangeActionMode), 1) self.BossButtonUp.Hide() self.BossButtonDown = ui.Button() self.BossButtonDown.SetParent(self.Board) self.BossButtonDown.SetPosition(16,33) self.BossButtonDown.SetText("") self.BossButtonDown.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.BossButtonDown.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.BossButtonDown.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.BossButtonDown.SetEvent(ui.__mem_func__(self.ChangeActionMode), 1) self.BossButtonDown.Show() self.MetinButtonUp = ui.Button() self.MetinButtonUp.SetParent(self.Board) self.MetinButtonUp.SetPosition(95,33) self.MetinButtonUp.SetText("") self.MetinButtonUp.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_01.sub") self.MetinButtonUp.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_02.sub") self.MetinButtonUp.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.MetinButtonUp.SetEvent(ui.__mem_func__(self.ChangeActionMode), 2) self.MetinButtonUp.Show() self.MetinButtonDown = ui.Button() self.MetinButtonDown.SetParent(self.Board) self.MetinButtonDown.SetPosition(95,33) self.MetinButtonDown.SetText("") self.MetinButtonDown.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.MetinButtonDown.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.MetinButtonDown.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.MetinButtonDown.SetEvent(ui.__mem_func__(self.ChangeActionMode), 2) self.MetinButtonDown.Hide() self.DungeonsButtonUp = ui.Button() self.DungeonsButtonUp.SetParent(self.Board) self.DungeonsButtonUp.SetPosition(174,33) self.DungeonsButtonUp.SetText("") self.DungeonsButtonUp.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_01.sub") self.DungeonsButtonUp.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_02.sub") self.DungeonsButtonUp.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.DungeonsButtonUp.SetEvent(ui.__mem_func__(self.ChangeActionMode), 3) self.DungeonsButtonUp.Show() self.DungeonsButtonDown = ui.Button() self.DungeonsButtonDown.SetParent(self.Board) self.DungeonsButtonDown.SetPosition(174,33) self.DungeonsButtonDown.SetText("") self.DungeonsButtonDown.SetUpVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.DungeonsButtonDown.SetOverVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.DungeonsButtonDown.SetDownVisual("d:/ymir work/ui/game/windows/tab_button_large_03.sub") self.DungeonsButtonDown.SetEvent(ui.__mem_func__(self.ChangeActionMode), 3) self.DungeonsButtonDown.Hide() self.scrollbar = ui.ScrollBar() self.scrollbar.SetParent(self.Board) self.scrollbar.SetScrollBarSize(340) self.scrollbar.SetPosition(255, 55) self.scrollbar.SetMiddleBarSize(float(5) / float(7)) self.scrollbar.SetScrollEvent(self.__OnScroll) self.scrollbar.Hide() self.ButtonTextLines = ui.TextLine() self.ButtonTextLines.SetParent(self.Board) self.ButtonTextLines.SetPosition(30,36) self.ButtonTextLines.SetText(" Bosse Metins Dungeons") self.ButtonTextLines.Show() self.SplitTitleBar = ui.HorizontalBar() self.SplitTitleBar.SetParent(self.Board) self.SplitTitleBar.Create(235) self.SplitTitleBar.SetPosition(16,55) self.SplitTitleBar.Show() self.AchievementError = ui.TextLine() self.AchievementError.SetParent(self.Board) self.AchievementError.SetPosition(133,80) self.AchievementError.SetFontColor(0.9607, 0.2392, 0.0) self.AchievementError.SetText("Es wurden keine Achievements gefunden!") self.AchievementError.SetHorizontalAlignCenter() self.AchievementError.Hide() i = 0 height = 75 max_box = 5 while i < max_box: self.faceBoxIMG[i] = ui.ImageBox() self.faceBoxIMG[i].SetParent(self.Board) self.faceBoxIMG[i].SetPosition(17,height) self.faceBoxIMG[i].LoadImage("d:/ymir work/ui/game/windows/box_face.sub") self.faceBoxIMG[i].Show() self.DescThinBoard[i] = ui.ThinBoard() self.DescThinBoard[i].SetParent(self.Board) self.DescThinBoard[i].SetPosition(70,height) self.DescThinBoard[i].SetSize(180,60) self.DescThinBoard[i].Show() self.AchievementTitle[i] = ui.TextLine() self.AchievementTitle[i].SetParent(self.DescThinBoard[i]) self.AchievementTitle[i].SetPosition(90,5) self.AchievementTitle[i].SetFontColor(0.9607, 0.2392, 0.0) self.AchievementTitle[i].SetText("Metin des Kummers") self.AchievementTitle[i].SetHorizontalAlignCenter() self.AchievementTitle[i].Show() self.AchievementText[i] = ui.TextLine() self.AchievementText[i].SetParent(self.DescThinBoard[i]) self.AchievementText[i].SetPosition(90,20) self.AchievementText[i].SetText("Anzahl: 30.000 | Punkte: 10") self.AchievementText[i].SetHorizontalAlignCenter() self.AchievementText[i].Show() self.AchievementCalcPoints[i] = ui.TextLine() self.AchievementCalcPoints[i].SetParent(self.DescThinBoard[i]) self.AchievementCalcPoints[i].SetPosition(90,35) self.AchievementCalcPoints[i].SetText("Bisher erhaltene Punkte: 13.400.032") self.AchievementCalcPoints[i].SetHorizontalAlignCenter() self.AchievementCalcPoints[i].Show() height = height + 65 i = i + 1 self.cat = 1 self.ClearBoards() self.LoadCategory()
def LoadUI(self): constInfo.warpgui_open = 1 self.Board = ui.BoardWithTitleBar() self.Board.SetSize(700, 350) self.Board.SetCenterPosition() self.Board.AddFlag("movable") self.Board.AddFlag("float") self.Board.SetTitleName("Teleportation") self.Board.SetCloseEvent(self.__del__) self.Board.Show() self.NavThinBoard = ui.ThinBoard() self.NavThinBoard.SetParent(self.Board) self.NavThinBoard.SetPosition(15, 35) self.NavThinBoard.SetSize(110, 305) self.NavThinBoard.Show() self.itemtooltip = uiToolTip.ItemToolTip() self.itemtooltip.HideToolTip() i = 0 nb_height = 10 while i < len(warps): self.NavButtons[i] = ui.Button() self.NavButtons[i].SetParent(self.NavThinBoard) self.NavButtons[i].SetPosition(10, nb_height) self.NavButtons[i].SetText("") self.NavButtons[i].SetUpVisual( "d:/ymir work/ui/public/Large_Button_01.sub") self.NavButtons[i].SetOverVisual( "d:/ymir work/ui/public/Large_Button_02.sub") self.NavButtons[i].SetDownVisual( "d:/ymir work/ui/public/Large_Button_03.sub") self.NavButtons[i].SetEvent(ui.__mem_func__(self.LoadCategory), i) self.NavButtons[i].Show() self.NavButtonTitles[i] = ui.TextLine() self.NavButtonTitles[i].SetParent(self.NavButtons[i]) self.NavButtonTitles[i].SetPosition(43, 2) self.NavButtonTitles[i].SetText(str(warps[i][0][0])) self.NavButtonTitles[i].SetHorizontalAlignCenter() self.NavButtonTitles[i].Show() i = i + 1 nb_height = nb_height + 22 step = 5 i = 1 aIndex = 0 wtb_width = 130 wtb_height = 35 player_level = fgGHGjjFHJghjfFG1545gGG.GetStatus( fgGHGjjFHJghjfFG1545gGG.LEVEL) while i <= board_count: self.WarpBGImages[i] = ui.ImageBox() self.WarpBGImages[i].SetParent(self.Board) self.WarpBGImages[i].SetPosition(wtb_width, wtb_height) self.WarpBGImages[i].LoadImage("images_warpgui/map/map_0_0.tga") self.WarpBGImages[i].Show() self.WarpThinBoards[i] = ui.ThinBoard() self.WarpThinBoards[i].SetParent(self.WarpBGImages[i]) self.WarpThinBoards[i].SetSize(130, 150) self.WarpThinBoards[i].SetPosition(0, 0) self.WarpThinBoards[i].Show() self.WarpMapNames[i] = ui.TextLine() self.WarpMapNames[i].SetParent(self.WarpThinBoards[i]) self.WarpMapNames[i].SetPosition(65, 8) self.WarpMapNames[i].SetText("MapName") self.WarpMapNames[i].SetHorizontalAlignCenter() self.WarpMapNames[i].Show() self.WarpTitleUnderLines[i] = ui.ImageBox() self.WarpTitleUnderLines[i].SetParent(self.WarpThinBoards[i]) self.WarpTitleUnderLines[i].SetPosition(5, 25) self.WarpTitleUnderLines[i].LoadImage( "images_warpgui/title_underline.tga") self.WarpTitleUnderLines[i].Show() self.WarpButtons[i] = ui.Button() self.WarpButtons[i].SetParent(self.WarpThinBoards[i]) self.WarpButtons[i].SetPosition(22, 125) self.WarpButtons[i].SetText("") self.WarpButtons[i].SetUpVisual( "d:/ymir work/ui/public/Large_Button_01.sub") self.WarpButtons[i].SetOverVisual( "d:/ymir work/ui/public/Large_Button_02.sub") self.WarpButtons[i].SetDownVisual( "d:/ymir work/ui/public/Large_Button_03.sub") self.WarpButtons[i].SetEvent(ui.__mem_func__(self.SendWarpPacket), i) self.WarpButtons[i].Show() self.WarpButtonTitles[i] = ui.TextLine() self.WarpButtonTitles[i].SetParent(self.WarpButtons[i]) self.WarpButtonTitles[i].SetPosition(43, 2) self.WarpButtonTitles[i].SetText("Teleportieren") self.WarpButtonTitles[i].SetHorizontalAlignCenter() self.WarpButtonTitles[i].Show() self.WarpErrors[i] = ui.TextLine() self.WarpErrors[i].SetParent(self.WarpThinBoards[i]) self.WarpErrors[i].SetPosition(65, 125) self.WarpErrors[i].SetText("[ Ab lv. ]") self.WarpErrors[i].SetHorizontalAlignCenter() self.WarpErrors[i].Show() self.WarpItemSlots[i] = ui.GridSlotWindow() self.WarpItemSlots[i].SetParent(self.WarpThinBoards[i]) self.WarpItemSlots[i].ArrangeSlot(i, 1, 1, 32, 32, 0, 0) self.WarpItemSlots[i].SetPosition(49, 75) self.WarpItemSlots[i].SetOverInItemEvent( ui.__mem_func__(self.ShowToolTip)) self.WarpItemSlots[i].SetOverOutItemEvent( ui.__mem_func__(self.HideToolTip)) self.WarpItemSlots[i].Show() # self.WarpItemSlots[i].SetItemSlot(0,27001,1) self.WarpClosed[i] = ui.TextLine() self.WarpClosed[i].SetParent(self.WarpThinBoards[i]) self.WarpClosed[i].SetPosition(65, 95) self.WarpClosed[i].SetText("[ Geschlossen! ]") self.WarpClosed[i].SetHorizontalAlignCenter() self.WarpClosed[i].Hide() aIndex = aIndex + 1 i = i + 1 wtb_width = wtb_width + 135 if i == step: wtb_width = 130 wtb_height = 190 self.scrollbar = ui.ScrollBar() self.scrollbar.SetParent(self.Board) self.scrollbar.SetScrollBarSize(305) self.scrollbar.SetPosition(670, 35) self.scrollbar.SetMiddleBarSize(float(board_count) / float(8)) self.scrollbar.SetScrollEvent(self.__OnScroll) self.scrollbar.Show() self.LoadCategory(0)
def LoadUI(self): settinginfo.SchmiedehandbuchPVPOpen = 1 self.Board = ui.BoardWithTitleBar() self.Board.SetSize(700, 450) self.Board.SetCenterPosition() self.Board.AddFlag("movable") self.Board.AddFlag("float") self.Board.SetTitleName("Schmiedehandbuch") self.Board.SetCloseEvent(self.__del__) self.Board.Show() ############################################################ ## Navigation self.NavBoard = ui.ThinBoard() self.NavBoard.SetParent(self.Board) self.NavBoard.SetPosition(15, 35) self.NavBoard.SetSize(200, 400) self.NavBoard.Show() self.itemtooltip = uiToolTip.ItemToolTip() self.itemtooltip.HideToolTip() i = 0 x = 8 button_x = 15 while i < len(settinginfo.SchmiedeHandBuchInfosPVP): self.itemTypeButtons[i] = ui.Button() self.itemTypeButtons[i].SetParent(self.NavBoard) self.itemTypeButtons[i].SetPosition(10, x) self.itemTypeButtons[i].SetText("") self.itemTypeButtons[i].SetUpVisual( "d:/ymir work/ui/public/xlarge_button_01.sub") self.itemTypeButtons[i].SetOverVisual( "d:/ymir work/ui/public/xlarge_button_02.sub") self.itemTypeButtons[i].SetDownVisual( "d:/ymir work/ui/public/xlarge_button_03.sub") self.itemTypeButtons[i].SetEvent( ui.__mem_func__(self.LoadCategory), i) self.itemTypeButtons[i].Show() self.ButtonTitles[i] = ui.TextLine() self.ButtonTitles[i].SetParent(self.NavBoard) self.ButtonTitles[i].SetPosition(100, button_x) self.ButtonTitles[i].SetHorizontalAlignCenter() self.ButtonTitles[i].SetText( settinginfo.SchmiedeHandBuchInfosPVP[i][0][0]) self.ButtonTitles[i].Show() button_x = button_x + 30 i = i + 1 x = x + 30 ############################################################ ## Content i = 0 x = 35 trennstrichCounter = 0 uppitemslots = 0 while i < 3: self.itemBoards[i] = ui.ThinBoard() self.itemBoards[i].SetParent(self.Board) self.itemBoards[i].SetPosition(220, x) self.itemBoards[i].SetSize(455, 130) self.itemBoards[i].Show() self.itemMainSlots[i] = ui.GridSlotWindow() self.itemMainSlots[i].SetParent(self.itemBoards[i]) self.itemMainSlots[i].ArrangeSlot(i, 1, 1, 32, 96, 0, 0) self.itemMainSlots[i].SetPosition(8, 20) self.itemMainSlots[i].SetOverInItemEvent( ui.__mem_func__(self.ShowToolTipEmpty)) self.itemMainSlots[i].SetOverOutItemEvent( ui.__mem_func__(self.HideToolTipEmpty)) self.itemMainSlots[i].SetSelectEmptySlotEvent( ui.__mem_func__(self.add_slotEmpty)) self.itemMainSlots[i].SetSelectItemSlotEvent( ui.__mem_func__(self.del_slotEmpty)) self.itemMainSlots[i].Show() trenn_y = 40 for t in xrange(10): self.Trennstriche[trennstrichCounter] = ui.ImageBox() self.Trennstriche[trennstrichCounter].SetParent( self.itemBoards[i]) self.Trennstriche[trennstrichCounter].SetPosition(trenn_y, 20) self.Trennstriche[trennstrichCounter].LoadImage( "d:/ymir work/ui/schmiedehandbuch_images/trennstrich.tga") self.Trennstriche[trennstrichCounter].Show() trenn_y = trenn_y + 45 trennstrichCounter = trennstrichCounter + 1 self.UppStufenHeadline[i] = ui.TextLine() self.UppStufenHeadline[i].SetParent(self.itemBoards[i]) self.UppStufenHeadline[i].SetPosition(45, 5) self.UppStufenHeadline[i].SetText( " +1 +2 +3 +4 +5 +6 +7 +8 +9" ) self.UppStufenHeadline[i].Show() y_slot = 47 for t in xrange(9): x_slot = 20 for z in xrange(3): self.UppItemsSlots[uppitemslots] = ui.GridSlotWindow() self.UppItemsSlots[uppitemslots].SetParent( self.itemBoards[i]) self.UppItemsSlots[uppitemslots].ArrangeSlot( uppitemslots, 1, 1, 32, 32, 0, 0) self.UppItemsSlots[uppitemslots].SetPosition( y_slot, x_slot) self.UppItemsSlots[uppitemslots].SetOverInItemEvent( ui.__mem_func__(self.ShowToolTip)) self.UppItemsSlots[uppitemslots].SetOverOutItemEvent( ui.__mem_func__(self.HideToolTip)) self.UppItemsSlots[uppitemslots].SetSelectEmptySlotEvent( ui.__mem_func__(self.add_slot)) self.UppItemsSlots[uppitemslots].SetSelectItemSlotEvent( ui.__mem_func__(self.del_slot)) self.UppItemsSlots[uppitemslots].Show() uppitemslots = uppitemslots + 1 x_slot = x_slot + 32 if z == 2: y_slot = y_slot + 45 i = i + 1 x = x + 135 self.scrollbar = ui.ScrollBar() self.scrollbar.SetParent(self.Board) self.scrollbar.SetScrollBarSize(400) self.scrollbar.SetPosition(675, 35) self.scrollbar.SetMiddleBarSize( float(board_count) / float(len(settinginfo.SchmiedeHandBuchInfosPVP[self.Category][1]))) self.scrollbar.SetScrollEvent(self.__OnScroll) self.scrollbar.Show() self.LoadCategory(0)
def __MakeBoard(self): self.Board = ui.Board() self.Board.SetParent(self) self.Board.SetSize(self.GetWidth(), self.GetHeight()) self.Board.SetPosition(0, 0) self.Board.AddFlag("movable") self.Board.AddFlag("float") self.Board.Show() self.TitleBar = ui.TitleBar() self.TitleBar.SetParent(self.Board) self.TitleBar.SetPosition(7, 7) self.TitleBar.MakeTitleBar(self.GetWidth() - 2 * 7, 'red') self.TitleBar.SetCloseEvent(self.Close) self.TitleBar.Show() self.RefreshButton = ui.Button() self.RefreshButton.SetParent(self.TitleBar) self.RefreshButton.SetPosition(3, 3) self.RefreshButton.SetUpVisual( "d:/ymir work/ui/game/guild/refresh_button_01.sub") self.RefreshButton.SetOverVisual( "d:/ymir work/ui/game/guild/refresh_button_02.sub") self.RefreshButton.SetDownVisual( "d:/ymir work/ui/game/guild/refresh_button_03.sub") self.RefreshButton.SetToolTipText("Refresh", 0, -23) self.RefreshButton.SetEvent(lambda: self.__Fill_Up_ChannelList()) self.RefreshButton.Show() self.TitleText = ui.TextLine() self.TitleText.SetParent(self.TitleBar) self.TitleText.SetPosition(0, 4) self.TitleText.SetText("Channel waehlen") self.TitleText.SetWindowHorizontalAlignCenter() self.TitleText.SetHorizontalAlignCenter() self.TitleText.Show() self.ServerName = ui.TextLine() self.ServerName.SetParent(self.TitleBar) self.ServerName.SetPosition(0, self.TitleBar.GetHeight()) self.ServerName.SetText( str(GFHhg54GHGhh45GHGH.GetServerInfo()).split(",")[0]) self.ServerName.SetWindowHorizontalAlignCenter() self.ServerName.SetHorizontalAlignCenter() self.ServerName.Show() self.ChannelListBase = ui.SlotBar() self.ChannelListBase.SetParent(self.Board) self.ChannelListBase.SetSize(self.Board.GetWidth() - 2 * 16, 5 * 18 - 4) self.ChannelListBase.SetPosition( 16, 7 + self.TitleBar.GetHeight() + 6 + 10) self.ChannelListBase.Show() self.ChannelList = ui.ListBox() self.ChannelList.SetParent(self.ChannelListBase) self.ChannelList.SetSize(self.ChannelListBase.GetWidth() - 20, self.ChannelListBase.GetHeight()) self.ChannelList.SetPosition(0, 0) self.ChannelList.SetEvent(ui.__mem_func__(self.__OnSelectChannel)) self.ChannelList.Show() self.ChangeButton = ui.Button() self.ChangeButton.SetParent(self.Board) self.ChangeButton.SetPosition(self.Board.GetWidth() / 2 - 44, self.Board.GetHeight() - 35) self.ChangeButton.SetUpVisual( 'd:/ymir work/ui/public/Large_button_01.sub') self.ChangeButton.SetOverVisual( 'd:/ymir work/ui/public/Large_button_02.sub') self.ChangeButton.SetDownVisual( 'd:/ymir work/ui/public/Large_button_03.sub') self.ChangeButton.SetEvent(lambda: self.__OnClickConnectButton()) self.ChangeButton.SetText("Wechseln") self.ChangeButton.Show() self.DisableChangeButton() self.ChannelListScrollBar = ui.ScrollBar() self.ChannelListScrollBar.SetParent(self.ChannelListBase) self.ChannelListScrollBar.SetPosition(18, 3) self.ChannelListScrollBar.SetScrollBarSize(83) self.ChannelListScrollBar.SetWindowHorizontalAlignRight() self.ChannelListScrollBar.SetScrollEvent( ui.__mem_func__(self.__OnScrollChannelList)) self.ChannelListScrollBar.Show()
def LoadUI(self): settinginfo.SchmiedehandbuchOpen = 1 self.Board = ui.BoardWithRoofBar() self.Board.SetSize(700, 450) self.Board.SetCenterPosition() self.Board.AddFlag("movable") self.Board.AddFlag("float") # self.Board.SetTitleName("Schmiedehandbuch") self.Board.SetCloseEvent(self.Open) self.Board.Hide() ############################################################ ## Navigation self.NavBoard = ui.Board() self.NavBoard.SetParent(self.Board) self.NavBoard.SetPosition(15, 65) self.NavBoard.SetSize(210, 485) self.NavBoard.HideBottom() self.NavBoard.Show() self.ForgeGuideBoard = ui.Board() self.ForgeGuideBoard.SetParent(self.Board) self.ForgeGuideBoard.SetPosition(15, 65) self.ForgeGuideBoard.SetSize(210, 485) self.ForgeGuideBoard.HideBottom() self.ForgeGuideBoard.Show() self.itemtooltip = uiToolTip.ItemToolTip() self.itemtooltip.HideToolTip() i = 0 x = 12 button_x = 19 while i < len(settinginfo.SchmiedeHandBuchInfos[0]): self.itemTypeButtons[i] = ui.Button() self.itemTypeButtons[i].SetParent(self.NavBoard) self.itemTypeButtons[i].SetPosition(25, x) self.itemTypeButtons[i].SetText("") self.itemTypeButtons[i].SetUpVisual( "yamato_helpboard/wide_button_n.tga") self.itemTypeButtons[i].SetOverVisual( "yamato_helpboard/wide_button_h.tga") self.itemTypeButtons[i].SetDownVisual( "yamato_helpboard/wide_button_p.tga") self.itemTypeButtons[i].SetDisableVisual( "yamato_helpboard/wide_button_d.tga") self.itemTypeButtons[i].SetEvent( ui.__mem_func__(self.LoadCategory), i) self.itemTypeButtons[i].Show() self.ButtonTitles[i] = ui.TextLine() self.ButtonTitles[i].SetParent(self.NavBoard) self.ButtonTitles[i].SetPosition(105, button_x) self.ButtonTitles[i].SetHorizontalAlignCenter() self.ButtonTitles[i].SetText( settinginfo.SchmiedeHandBuchInfos[0][i][0][0]) self.ButtonTitles[i].Show() button_x = button_x + 30 i = i + 1 x = x + 30 self.ForgeGuideBoard = ui.Board() self.ForgeGuideBoard.SetParent(self.Board) self.ForgeGuideBoard.SetPosition(15, x + 65) self.ForgeGuideBoard.SetSize(210, 80) self.ForgeGuideBoard.HideBottom() self.ForgeGuideBoard.Show() self.ForgeGuidePVM = ui.Button() self.ForgeGuidePVM.SetParent(self.ForgeGuideBoard) self.ForgeGuidePVM.SetPosition(25, 15) self.ForgeGuidePVM.SetUpVisual("yamato_helpboard/wide_button_n.tga") self.ForgeGuidePVM.SetOverVisual("yamato_helpboard/wide_button_h.tga") self.ForgeGuidePVM.SetDownVisual("yamato_helpboard/wide_button_p.tga") self.ForgeGuidePVM.SetDisableVisual( "yamato_helpboard/wide_button_d.tga") self.ForgeGuidePVM.SetEvent(ui.__mem_func__(self.LoadForgeGuide), 0) self.ForgeGuidePVM.Show() self.ForgeGuidePVP = ui.Button() self.ForgeGuidePVP.SetParent(self.ForgeGuideBoard) self.ForgeGuidePVP.SetPosition(25, 45) self.ForgeGuidePVP.SetUpVisual("yamato_helpboard/wide_button_n.tga") self.ForgeGuidePVP.SetOverVisual("yamato_helpboard/wide_button_h.tga") self.ForgeGuidePVP.SetDownVisual("yamato_helpboard/wide_button_p.tga") self.ForgeGuidePVP.SetDisableVisual( "yamato_helpboard/wide_button_d.tga") self.ForgeGuidePVP.SetEvent(ui.__mem_func__(self.LoadForgeGuide), 1) self.ForgeGuidePVP.Show() self.ForgeGuidePVMTextLine = ui.TextLine() self.ForgeGuidePVMTextLine.SetParent(self.ForgeGuideBoard) self.ForgeGuidePVMTextLine.SetPosition(105, 15 + 6) self.ForgeGuidePVMTextLine.SetHorizontalAlignCenter() self.ForgeGuidePVMTextLine.SetText("PVM") self.ForgeGuidePVMTextLine.Show() self.ForgeGuidePVPTextLine = ui.TextLine() self.ForgeGuidePVPTextLine.SetParent(self.ForgeGuideBoard) self.ForgeGuidePVPTextLine.SetPosition(105, 45 + 6) self.ForgeGuidePVPTextLine.SetHorizontalAlignCenter() self.ForgeGuidePVPTextLine.SetText("PVP") self.ForgeGuidePVPTextLine.Show() ############################################################ ## Content self.ForgeGuideTitleBoard = ui.Board() self.ForgeGuideTitleBoard.SetParent(self.Board) self.ForgeGuideTitleBoard.SetPosition(205, 65) self.ForgeGuideTitleBoard.SetSize(515, 80) self.ForgeGuideTitleBoard.HideBottom() self.ForgeGuideTitleBoard.Show() self.ForgeGuideBGBoard = ui.Board() self.ForgeGuideBGBoard.SetParent(self.Board) self.ForgeGuideBGBoard.SetPosition(205, 110) self.ForgeGuideBGBoard.SetSize(515, 440) self.ForgeGuideBGBoard.HideBottom() self.ForgeGuideBGBoard.Show() self.ForgeGuideTitleTextLine = ui.TextLine() self.ForgeGuideTitleTextLine.SetParent(self.ForgeGuideTitleBoard) self.ForgeGuideTitleTextLine.SetPosition(257, 20) self.ForgeGuideTitleTextLine.SetHorizontalAlignCenter() self.ForgeGuideTitleTextLine.SetText("Schmiedehandbuch - PVM") self.ForgeGuideTitleTextLine.SetPackedFontColor(0xffd8a055) self.ForgeGuideTitleTextLine.Show() i = 0 x = 120 trennstrichCounter = 0 uppitemslots = 0 while i < 3: self.itemBoards[i] = ui.ImageBox() self.itemBoards[i].SetParent(self.Board) self.itemBoards[i].SetPosition(240 - 15, x) self.itemBoards[i].LoadImage( "yamato_forgeguide/forge_guide_bg.tga") self.itemBoards[i].Show() self.itemMainSlots[i] = ui.GridSlotWindow() self.itemMainSlots[i].SetParent(self.itemBoards[i]) self.itemMainSlots[i].ArrangeSlot(i, 1, 1, 32, 96, 0, 0) self.itemMainSlots[i].SetPosition(8, 20) self.itemMainSlots[i].SetOverInItemEvent( ui.__mem_func__(self.ShowToolTipEmpty)) self.itemMainSlots[i].SetOverOutItemEvent( ui.__mem_func__(self.HideToolTipEmpty)) self.itemMainSlots[i].SetSelectEmptySlotEvent( ui.__mem_func__(self.add_slotEmpty)) self.itemMainSlots[i].SetSelectItemSlotEvent( ui.__mem_func__(self.del_slotEmpty)) self.itemMainSlots[i].Show() trenn_y = 40 for t in xrange(10): self.Trennstriche[trennstrichCounter] = ui.ImageBox() self.Trennstriche[trennstrichCounter].SetParent( self.itemBoards[i]) self.Trennstriche[trennstrichCounter].SetPosition(trenn_y, 20) self.Trennstriche[trennstrichCounter].LoadImage( "yamato_forgeguide/split.tga") self.Trennstriche[trennstrichCounter].Show() trenn_y = trenn_y + 45 trennstrichCounter = trennstrichCounter + 1 self.UppStufenHeadline[i] = ui.TextLine() self.UppStufenHeadline[i].SetParent(self.itemBoards[i]) self.UppStufenHeadline[i].SetPosition(45, 5) self.UppStufenHeadline[i].SetText( " +1 +2 +3 +4 +5 +6 +7 +8 +9" ) self.UppStufenHeadline[i].Show() y_slot = 47 for t in xrange(9): x_slot = 20 for z in xrange(3): self.UppItemsSlots[uppitemslots] = ui.GridSlotWindow() self.UppItemsSlots[uppitemslots].SetParent( self.itemBoards[i]) self.UppItemsSlots[uppitemslots].ArrangeSlot( uppitemslots, 1, 1, 32, 32, 0, 0) self.UppItemsSlots[uppitemslots].SetPosition( y_slot, x_slot) self.UppItemsSlots[uppitemslots].SetOverInItemEvent( ui.__mem_func__(self.ShowToolTip)) self.UppItemsSlots[uppitemslots].SetOverOutItemEvent( ui.__mem_func__(self.HideToolTip)) self.UppItemsSlots[uppitemslots].SetSelectEmptySlotEvent( ui.__mem_func__(self.add_slot)) self.UppItemsSlots[uppitemslots].SetSelectItemSlotEvent( ui.__mem_func__(self.del_slot)) self.UppItemsSlots[uppitemslots].Show() uppitemslots = uppitemslots + 1 x_slot = x_slot + 32 if z == 2: y_slot = y_slot + 45 i = i + 1 x = x + 132 self.scrollbar = ui.ScrollBar() self.scrollbar.SetParent(self.Board) self.scrollbar.SetScrollBarSize(395) self.scrollbar.SetPosition(675 + 10, 120) self.scrollbar.SetMiddleBarSize( float(board_count) / float( len(settinginfo.SchmiedeHandBuchInfos[self.ForgeGuide][ self.Category][1]))) self.scrollbar.SetScrollEvent(self.__OnScroll) self.scrollbar.Show() self.LoadForgeGuide(0) self.LoadCategory(0)