def Gauge(self, parent, width, color, x, y): gauge = ui.Gauge() if parent != None: gauge.SetParent(parent) gauge.SetPosition(x, y) gauge.MakeGauge(width, color) gauge.Show() return gauge
def __init__(self): ui.ThinBoard.__init__(self) name = ui.TextLine() name.SetParent(self) name.SetDefaultFontName() name.SetOutline() name.Show() hpGauge = ui.Gauge() hpGauge.SetParent(self) hpGauge.MakeGauge(130, "red") hpGauge.Hide() closeButton = ui.Button() closeButton.SetParent(self) closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub") closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub") closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub") closeButton.SetPosition(30, 13) if locale.IsARABIC(): hpGauge.SetPosition(55, 17) hpGauge.SetWindowHorizontalAlignLeft() closeButton.SetWindowHorizontalAlignLeft() else: hpGauge.SetPosition(175, 17) hpGauge.SetWindowHorizontalAlignRight() closeButton.SetWindowHorizontalAlignRight() if app.ENABLE_SEND_TARGET_INFO: infoButton = ui.Button() infoButton.SetParent(self) infoButton.SetUpVisual("d:/ymir work/ui/pattern/q_mark_01.tga") infoButton.SetOverVisual("d:/ymir work/ui/pattern/q_mark_02.tga") infoButton.SetDownVisual("d:/ymir work/ui/pattern/q_mark_01.tga") infoButton.SetEvent(ui.__mem_func__(self.OnPressedInfoButton)) infoButton.Hide() infoBoard = self.InfoBoard() infoBoard.Hide() infoButton.showWnd = infoBoard closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton)) closeButton.Show() self.buttonDict = {} self.showingButtonList = [] for buttonName in self.BUTTON_NAME_LIST: button = ui.Button() button.SetParent(self) if locale.IsARABIC(): button.SetUpVisual( "d:/ymir work/ui/public/Small_Button_01.sub") button.SetOverVisual( "d:/ymir work/ui/public/Small_Button_02.sub") button.SetDownVisual( "d:/ymir work/ui/public/Small_Button_03.sub") else: button.SetUpVisual( "d:/ymir work/ui/public/small_thin_button_01.sub") button.SetOverVisual( "d:/ymir work/ui/public/small_thin_button_02.sub") button.SetDownVisual( "d:/ymir work/ui/public/small_thin_button_03.sub") button.SetWindowHorizontalAlignCenter() button.SetText(buttonName) button.Hide() self.buttonDict[buttonName] = button self.showingButtonList.append(button) self.buttonDict[locale.TARGET_BUTTON_WHISPER].SetEvent( ui.__mem_func__(self.OnWhisper)) self.buttonDict[locale.TARGET_BUTTON_EXCHANGE].SetEvent( ui.__mem_func__(self.OnExchange)) self.buttonDict[locale.TARGET_BUTTON_FIGHT].SetEvent( ui.__mem_func__(self.OnPVP)) self.buttonDict[locale.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent( ui.__mem_func__(self.OnPVP)) self.buttonDict[locale.TARGET_BUTTON_AVENGE].SetEvent( ui.__mem_func__(self.OnPVP)) self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent( ui.__mem_func__(self.OnAppendToMessenger)) self.buttonDict[locale.TARGET_BUTTON_FRIEND].SetEvent( ui.__mem_func__(self.OnAppendToMessenger)) self.buttonDict[locale.TARGET_BUTTON_INVITE_PARTY].SetEvent( ui.__mem_func__(self.OnPartyInvite)) self.buttonDict[locale.TARGET_BUTTON_LEAVE_PARTY].SetEvent( ui.__mem_func__(self.OnPartyExit)) self.buttonDict[locale.TARGET_BUTTON_EXCLUDE].SetEvent( ui.__mem_func__(self.OnPartyRemove)) self.buttonDict[locale.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent( self.__OnGuildAddMember) self.buttonDict[locale.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent( self.__OnDismount) self.buttonDict[locale.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent( self.__OnExitObserver) self.buttonDict[locale.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent( self.__OnViewEquipment) self.buttonDict[ locale.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent( self.__OnRequestParty) self.buttonDict[locale.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent( self.__OnDestroyBuilding) self.buttonDict[locale.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent( self.__OnEmotionAllow) self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent( ui.__mem_func__(self.__OnVoteBlockChat)) self.name = name self.hpGauge = hpGauge if app.ENABLE_SEND_TARGET_INFO: self.infoButton = infoButton if app.ENABLE_SEND_TARGET_INFO: self.vnum = 0 self.closeButton = closeButton self.nameString = 0 self.nameLength = 0 self.vid = 0 self.eventWhisper = None self.isShowButton = FALSE self.__Initialize() self.ResetTargetBoard() self.healthBoard = uiHealth.HealthBoard()
def __init__(self): ui.ThinBoard.__init__(self) name = ui.TextLine() name.SetParent(self) name.SetDefaultFontName() name.SetOutline() name.Show() hpGauge = ui.Gauge() hpGauge.SetParent(self) hpGauge.MakeGauge(130, "red") hpGauge.Hide() if app.ENABLE_VIEW_TARGET_DECIMAL_HP: hpDecimal = ui.TextLine() hpDecimal.SetParent(hpGauge) hpDecimal.SetDefaultFontName() hpDecimal.SetPosition(5, 5) hpDecimal.SetOutline() hpDecimal.Hide() hpPercenttxt = ui.TextLine() hpPercenttxt.SetParent(self) hpPercenttxt.SetPosition(150, 13) hpPercenttxt.SetText("") hpPercenttxt.SetOutline() hpPercenttxt.Hide() #curHPtxt = ui.TextLine() #curHPtxt.SetParent(self) #curHPtxt.SetPosition(120, 3) #curHPtxt.SetText("") #curHPtxt.SetWindowHorizontalAlignRight() #curHPtxt.SetHorizontalAlignCenter() #curHPtxt.SetDefaultFontName() #curHPtxt.SetOutline() #curHPtxt.Hide() closeButton = ui.Button() closeButton.SetParent(self) closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub") closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub") closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub") closeButton.SetPosition(30, 13) # dropGuideButton = ui.Button() # dropGuideButton.SetParent(self) # dropGuideButton.SetUpVisual("locale/de/ui/interfaces/droppgui/droppgui_01.dds") # dropGuideButton.SetOverVisual("locale/de/ui/interfaces/droppgui/droppgui_02.dds") # dropGuideButton.SetDownVisual("locale/de/ui/interfaces/droppgui/droppgui_02.dds") # dropGuideButton.SetPosition(50, 13) # dropGuideButton.SetEvent(ui.__mem_func__(self.OnPressedDropGuideButton)) # dropGuideButton.Hide() # self.sideBar = DropBoard() #self.sideBar.Show() if localeInfo.IsARABIC(): hpGauge.SetPosition(55, 17) hpGauge.SetWindowHorizontalAlignLeft() closeButton.SetWindowHorizontalAlignLeft() else: hpGauge.SetPosition(185, 17) hpGauge.SetWindowHorizontalAlignRight() closeButton.SetWindowHorizontalAlignRight() if app.ENABLE_SEND_TARGET_INFO: infoButton = ui.Button() infoButton.SetParent(self) infoButton.SetUpVisual("d:/ymir work/ui/pattern/q_mark_01.tga") infoButton.SetOverVisual("d:/ymir work/ui/pattern/q_mark_02.tga") infoButton.SetDownVisual("d:/ymir work/ui/pattern/q_mark_01.tga") infoButton.SetEvent(ui.__mem_func__(self.OnPressedInfoButton)) infoButton.Hide() infoBoard = self.InfoBoard() infoBoard.Hide() infoButton.showWnd = infoBoard # dropGuideButton.SetWindowHorizontalAlignRight() closeButton.SetEvent(ui.__mem_func__(self.OnPressedCloseButton)) closeButton.Show() self.buttonDict = {} self.showingButtonList = [] for buttonName in self.BUTTON_NAME_LIST: button = ui.Button() button.SetParent(self) if localeInfo.IsARABIC(): button.SetUpVisual("d:/ymir work/ui/public/Small_Button_01.sub") button.SetOverVisual("d:/ymir work/ui/public/Small_Button_02.sub") button.SetDownVisual("d:/ymir work/ui/public/Small_Button_03.sub") else: button.SetUpVisual("d:/ymir work/ui/public/small_thin_button_01.sub") button.SetOverVisual("d:/ymir work/ui/public/small_thin_button_02.sub") button.SetDownVisual("d:/ymir work/ui/public/small_thin_button_03.sub") button.SetWindowHorizontalAlignCenter() button.SetText(buttonName) button.Hide() self.buttonDict[buttonName] = button self.showingButtonList.append(button) self.buttonDict[localeInfo.TARGET_BUTTON_WHISPER].SetEvent(ui.__mem_func__(self.OnWhisper)) if app.ENABLE_MESSENGER_BLOCK: self.buttonDict[localeInfo.TARGET_BUTTON_BLOCK].SetEvent(ui.__mem_func__(self.OnAppendToBlockMessenger)) self.buttonDict[localeInfo.TARGET_BUTTON_UNBLOCK].SetEvent(ui.__mem_func__(self.OnRemoveToBlockMessenger)) self.buttonDict[localeInfo.TARGET_BUTTON_EXCHANGE].SetEvent(ui.__mem_func__(self.OnExchange)) self.buttonDict[localeInfo.TARGET_BUTTON_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP)) self.buttonDict[localeInfo.TARGET_BUTTON_ACCEPT_FIGHT].SetEvent(ui.__mem_func__(self.OnPVP)) self.buttonDict[localeInfo.TARGET_BUTTON_AVENGE].SetEvent(ui.__mem_func__(self.OnPVP)) self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger)) self.buttonDict[localeInfo.TARGET_BUTTON_FRIEND].SetEvent(ui.__mem_func__(self.OnAppendToMessenger)) self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyInvite)) self.buttonDict[localeInfo.TARGET_BUTTON_LEAVE_PARTY].SetEvent(ui.__mem_func__(self.OnPartyExit)) self.buttonDict[localeInfo.TARGET_BUTTON_EXCLUDE].SetEvent(ui.__mem_func__(self.OnPartyRemove)) self.buttonDict[localeInfo.TARGET_BUTTON_INVITE_GUILD].SAFE_SetEvent(self.__OnGuildAddMember) self.buttonDict[localeInfo.TARGET_BUTTON_DISMOUNT].SAFE_SetEvent(self.__OnDismount) self.buttonDict[localeInfo.TARGET_BUTTON_EXIT_OBSERVER].SAFE_SetEvent(self.__OnExitObserver) self.buttonDict[localeInfo.TARGET_BUTTON_VIEW_EQUIPMENT].SAFE_SetEvent(self.__OnViewEquipment) self.buttonDict[localeInfo.TARGET_BUTTON_REQUEST_ENTER_PARTY].SAFE_SetEvent(self.__OnRequestParty) self.buttonDict[localeInfo.TARGET_BUTTON_BUILDING_DESTROY].SAFE_SetEvent(self.__OnDestroyBuilding) self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SAFE_SetEvent(self.__OnEmotionAllow) self.buttonDict["VOTE_BLOCK_CHAT"].SetEvent(ui.__mem_func__(self.__OnVoteBlockChat)) self.buttonDict["Kick"].SetEvent(ui.__mem_func__(self.OnKick)) self.buttonDict["ChatBlock"].SetEvent(ui.__mem_func__(self.OnChatBlock)) self.name = name self.hpGauge = hpGauge if app.ENABLE_VIEW_TARGET_DECIMAL_HP: self.hpDecimal = hpDecimal if app.ENABLE_SEND_TARGET_INFO: self.infoButton = infoButton if app.ENABLE_SEND_TARGET_INFO: self.vnum = 0 self.hpPercenttxt = hpPercenttxt #self.curHPtxt = curHPtxt self.closeButton = closeButton # self.dropGuideButton = dropGuideButton self.nameString = 0 self.nameLength = 0 self.vid = 0 self.eventWhisper = None self.isShowButton = False if app.ENABLE_VIEW_ELEMENT: self.elementImage = None self.itemtooltip = uiToolTip.ItemToolTip() self.itemtooltip.HideToolTip() self.__Initialize() self.ResetTargetBoard() dlgChatBlock = uiChatBlock.ChatBlockDialog() dlgChatBlock.LoadDialog() dlgChatBlock.SetTitleName("ChatBlock") dlgChatBlock.Hide() self.dlgChatBlock = dlgChatBlock