Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ui
- import uiScriptLocale
- import app
- import net
- import dbg
- import snd
- import player
- import mouseModule
- import wndMgr
- import skill
- import playerSettingModule
- import quest
- import localeInfo
- import uiToolTip
- import constInfo
- import emotion
- import chr
- # import localeinfogeo
- character = 1
- status = 0
- bonus = 0
- skills = 0
- emotions = 0
- quests = 0
- activado = 0
- number_on = 5
- SHOW_ONLY_ACTIVE_SKILL = FALSE
- SHOW_LIMIT_SUPPORT_SKILL_LIST = []
- HIDE_SUPPORT_SKILL_POINT = FALSE
- REFRESH_IMAGE_LOCATION_VEGAS_1 = "d:/ymir work/interface/expand_system/chrbutton_big_n.tga"
- REFRESH_IMAGE_LOCATION_VEGAS_2 = "d:/ymir work/interface/expand_system/chrbutton_big_a.tga"
- NAME_CLASS_I = "STATUS"
- NAME_CLASS_II = "STATUS2"
- NAME_CLASS_III = "BONUS"
- NAME_CLASS_IV = "SKILL"
- NAME_CLASS_V = "EMOTICON"
- NAME_CLASS_VI = "QUEST"
- if localeInfo.IsYMIR():
- SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139 ,141,142]
- if not localeInfo.IsCHEONMA():
- HIDE_SUPPORT_SKILL_POINT = TRUE
- SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139 ,141,142]
- if localeInfo.IsJAPAN() or (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"):
- HIDE_SUPPORT_SKILL_POINT = TRUE
- SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139]
- else:
- HIDE_SUPPORT_SKILL_POINT = TRUE
- FACE_IMAGE_DICT = {
- playerSettingModule.RACE_WARRIOR_M : "d:/ymir work/interface/faces/icon_mwarrior.tga",
- playerSettingModule.RACE_WARRIOR_W : "d:/ymir work/interface/faces/icon_wwarrior.tga",
- playerSettingModule.RACE_ASSASSIN_M : "d:/ymir work/interface/faces/icon_mninja.tga",
- playerSettingModule.RACE_ASSASSIN_W : "d:/ymir work/interface/faces/icon_wninja.tga",
- playerSettingModule.RACE_SURA_M : "d:/ymir work/interface/faces/icon_msura.tga",
- playerSettingModule.RACE_SURA_W : "d:/ymir work/interface/faces/icon_wsura.tga",
- playerSettingModule.RACE_SHAMAN_M : "d:/ymir work/interface/faces/icon_mshaman.tga",
- playerSettingModule.RACE_SHAMAN_W : "d:/ymir work/interface/faces/icon_wshaman.tga",
- }
- def unsigned32(n):
- return n & 0xFFFFFFFFFL
- class CharacterWindow(ui.ScriptWindow):
- ACTIVE_PAGE_SLOT_COUNT = 8
- SUPPORT_PAGE_SLOT_COUNT = 12
- PAGE_SLOT_COUNT = 12
- PAGE_HORSE = 2
- SKILL_GROUP_NAME_DICT = {
- playerSettingModule.JOB_WARRIOR : { 1 : localeInfo.SKILL_GROUP_WARRIOR_1, 2 : localeInfo.SKILL_GROUP_WARRIOR_2, },
- playerSettingModule.JOB_ASSASSIN : { 1 : localeInfo.SKILL_GROUP_ASSASSIN_1, 2 : localeInfo.SKILL_GROUP_ASSASSIN_2, },
- playerSettingModule.JOB_SURA : { 1 : localeInfo.SKILL_GROUP_SURA_1, 2 : localeInfo.SKILL_GROUP_SURA_2, },
- playerSettingModule.JOB_SHAMAN : { 1 : localeInfo.SKILL_GROUP_SHAMAN_1, 2 : localeInfo.SKILL_GROUP_SHAMAN_2, },
- }
- STAT_DESCRIPTION = {
- "HTH" : localeInfo.STAT_TOOLTIP_CON,
- "INT" : localeInfo.STAT_TOOLTIP_INT,
- "STR" : localeInfo.STAT_TOOLTIP_STR,
- "DEX" : localeInfo.STAT_TOOLTIP_DEX,
- }
- STAT_MINUS_DESCRIPTION = localeInfo.STAT_MINUS_DESCRIPTION
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.state = "STATUS"
- self.isLoaded = 0
- self.toolTipSkill = 0
- self.__Initialize()
- self.__LoadWindow()
- self.statusPlusCommandDict={
- "HTH" : "/stat ht",
- "INT" : "/stat iq",
- "STR" : "/stat st",
- "DEX" : "/stat dx",
- }
- self.statusMinusCommandDict={
- "HTH-" : "/stat- ht",
- "INT-" : "/stat- iq",
- "STR-" : "/stat- st",
- "DEX-" : "/stat- dx",
- }
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def __Initialize(self):
- self.refreshToolTip = 0
- self.curSelectedSkillGroup = 0
- self.canUseHorseSkill = -1
- self.toolTip = None
- self.toolTipJob = None
- self.toolTipAlignment = None
- self.toolTipSkill = None
- #self.faceImage = None
- self.activeSlot = None
- self.tabButtonDict = None
- self.pageDict = None
- self.titleBarDict = None
- self.statusPlusButtonDict = None
- self.statusMinusButtonDict = None
- self.skillPageDict = None
- self.questShowingStartIndex = 0
- self.questScrollBar = None
- self.questSlot = None
- self.questNameList = None
- self.questLastTimeList = None
- self.questLastCountList = None
- self.skillGroupButton = ()
- self.activeSlot = None
- self.activeSkillPointValue = None
- self.skillGroupButton1 = None
- self.skillGroupButton2 = None
- self.activeSkillGroupName = None
- # self.expGauge = None
- self.first_board = None
- self.guildNameSlot = None
- self.guildNameValue = None
- self.characterNameSlot = None
- self.characterNameValue = None
- self.emotionToolTip = None
- self.soloEmotionSlot = None
- self.dualEmotionSlot = None
- # self.PercentExper = None
- def Show(self):
- self.__LoadWindow()
- ui.ScriptWindow.Show(self)
- def __LoadScript(self, fileName):
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, fileName)
- def __BindObject(self):
- self.toolTip = uiToolTip.ToolTip()
- self.toolTipJob = uiToolTip.ToolTip()
- self.toolTipAlignment = uiToolTip.ToolTip(130)
- self.Refreshing()
- self.characterNameSlot = self.GetChild("NameSlot")
- self.bonusboard = self.GetChild("BonusBoard")
- self.characterNameValue = self.GetChild("NazwaGracza")
- self.guildNameSlot = self.GetChild("GuildSlot")
- self.guildNameValue = self.GetChild("NazwaGildii")
- self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_IN", self.__ShowAlignmentToolTip)
- self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.__HideAlignmentToolTip)
- self.activeSlot = self.GetChild("Skill_Active_Slot")
- self.activeSkillPointValue = self.GetChild("Active_Skill_Point_Value")
- self.skillGroupButton1 = self.GetChild("Skill_Group_Button_1")
- self.skillGroupButton2 = self.GetChild("Skill_Group_Button_2")
- self.activeSkillGroupName = self.GetChild("Active_Skill_Group_Name")
- self.GetChild("Expand").SetEvent(self.Functie_glisare_max)
- self.GetChild("Minimize").SetEvent(self.Functie_glisare_min)
- self.GetChild("Minimize").Hide()
- #--------------------
- self.TabButton1 = self.GetChild("Tab_Button_01")
- self.TabButton2 = self.GetChild("Tab_Button_02")
- self.TabButton3 = self.GetChild("Tab_Button_03")
- self.TabButton4 = self.GetChild("Tab_Button_04")
- self.TabButton5 = self.GetChild("Tab_Button_05")
- self.TabButton6 = self.GetChild("Tab_Button_06")
- self.Button1Text = self.GetChild("Button1_Name")
- self.Button1Text.Hide()
- self.Button2Text = self.GetChild("Button2_Name")
- self.Button2Text.Hide()
- self.Button3Text = self.GetChild("Button3_Name")
- self.Button3Text.Hide()
- self.Button4Text = self.GetChild("Button4_Name")
- self.Button4Text.Hide()
- self.Button5Text = self.GetChild("Button5_Name")
- self.Button5Text.Hide()
- self.Button6Text = self.GetChild("Button6_Name")
- self.Button6Text.Hide()
- self.tabButtonDict = {
- "STATUS" : self.GetChild("Tab_Button_01"),
- "STATUS2" : self.GetChild("Tab_Button_02"),
- "BONUS" : self.GetChild("Tab_Button_03"),
- "SKILL" : self.GetChild("Tab_Button_04"),
- "EMOTICON" : self.GetChild("Tab_Button_05"),
- "QUEST" : self.GetChild("Tab_Button_06")
- }
- self.pageDict = {
- "STATUS" : self.GetChild("Character_Page"),
- "STATUS2" : self.GetChild("Stats_Page"),
- "BONUS" : self.GetChild("Bonus_Page"),
- "SKILL" : self.GetChild("Skill_Page"),
- "EMOTICON" : self.GetChild("Emoticon_Page"),
- "QUEST" : self.GetChild("Quest_Page")
- }
- self.titleBarDict = {
- "STATUS" : self.GetChild("Character_TitleBar"),
- "STATUS2" : self.GetChild("Stats_TitleBar"),
- "BONUS" : self.GetChild("Bonus_TitleBar"),
- "SKILL" : self.GetChild("Skill_TitleBar"),
- "EMOTICON" : self.GetChild("Emoticon_TitleBar"),
- "QUEST" : self.GetChild("Quest_TitleBar")
- }
- self.statusPlusButtonDict = {
- "HTH" : self.GetChild("HTH_Plus"),
- "INT" : self.GetChild("INT_Plus"),
- "STR" : self.GetChild("STR_Plus"),
- "DEX" : self.GetChild("DEX_Plus"),
- }
- self.statusMinusButtonDict = {
- "HTH-" : self.GetChild("HTH_Minus"),
- "INT-" : self.GetChild("INT_Minus"),
- "STR-" : self.GetChild("STR_Minus"),
- "DEX-" : self.GetChild("DEX_Minus"),
- }
- self.skillPageDict = {
- "ACTIVE" : self.GetChild("Skill_Active_Slot"),
- "SUPPORT" : self.GetChild("Skill_ETC_Slot"),
- "HORSE" : self.GetChild("Skill_Active_Slot"),
- }
- self.skillPageStatDict = {
- "SUPPORT" : player.SKILL_SUPPORT,
- "ACTIVE" : player.SKILL_ACTIVE,
- "HORSE" : player.SKILL_HORSE,
- }
- self.skillGroupButton = (
- self.GetChild("Skill_Group_Button_1"),
- self.GetChild("Skill_Group_Button_2"),
- )
- global SHOW_ONLY_ACTIVE_SKILL
- global HIDE_SUPPORT_SKILL_POINT
- self.soloEmotionSlot = self.GetChild("SoloEmotionSlot")
- self.dualEmotionSlot = self.GetChild("DualEmotionSlot")
- self.__SetEmotionSlot()
- self.questShowingStartIndex = 0
- self.questScrollBar = self.GetChild("Quest_ScrollBar")
- self.questScrollBar.SetScrollEvent(ui.__mem_func__(self.OnQuestScroll))
- self.questSlot = self.GetChild("Quest_Slot")
- for i in xrange(quest.QUEST_MAX_NUM):
- self.questSlot.HideSlotBaseImage(i)
- self.questSlot.SetCoverButton(i,\
- "d:/ymir work/ui/game/quest/slot_button_01.sub",\
- "d:/ymir work/ui/game/quest/slot_button_02.sub",\
- "d:/ymir work/ui/game/quest/slot_button_03.sub",\
- "d:/ymir work/ui/game/quest/slot_button_03.sub", TRUE)
- self.questNameList = []
- self.questLastTimeList = []
- self.questLastCountList = []
- for i in xrange(quest.QUEST_MAX_NUM):
- self.questNameList.append(self.GetChild("Quest_Name_0" + str(i)))
- self.questLastTimeList.append(self.GetChild("Quest_LastTime_0" + str(i)))
- self.questLastCountList.append(self.GetChild("Quest_LastCount_0" + str(i)))
- self.Board_Caracteristicas = self.GetChild("Stats_Page")
- self.Board_Caracteristicas_Function()
- self.Board_Caracteristicas.Hide()
- self.Board_Bonus_Function()
- # self.Board_Bonus_Function.Show()
- # self.PercentExper = self.GetChild("PercentExp")
- def Board_Caracteristicas_Function(self):
- self.C_Title = {}
- self.C_Slot = {}
- self.C_Slot_Number ={}
- self.C_Slot_Value ={}
- number_title_c = 0
- info_c=[
- [[30,45+12-10], [uiScriptLocale.MOV_SPEED]],
- [[30,45+12+30-12], [uiScriptLocale.ASPD_SPEED]],
- [[30,45+12+30+30-14], [uiScriptLocale.CSPD_SPEED]],
- [[30,45+12+30+30+30-16], [uiScriptLocale.MATT_SPEED]],
- [[30,45+12+30+30+30+30-18], [uiScriptLocale.ATT_GRADE]],
- [[30,45+12+30+30+30+30+30-20], [uiScriptLocale.MDEF_SPEED]],
- [[30,45+12+30+30+30+30+30+30-22], [uiScriptLocale.DEF_GRADE]],
- [[30,45+12+30+30+30+30+30+30+30-24],[uiScriptLocale.ER_SPEED]]
- ]
- for a in info_c:
- self.C_Title[number_title_c] = ui.TextLine()
- self.C_Title[number_title_c].SetParent(self.Board_Caracteristicas)
- self.C_Title[number_title_c].SetPosition(a[0][0],a[0][1])
- self.C_Title[number_title_c].SetText(a[1][0]+":")
- self.C_Title[number_title_c].SetPackedFontColor(0xffa08784)
- self.C_Title[number_title_c].Show()
- self.C_Slot[number_title_c] = ui.ImageBox()
- self.C_Slot[number_title_c].SetParent(self.Board_Caracteristicas)
- self.C_Slot[number_title_c].LoadImage("d:/ymir work/interface/chenare/chenar1_small_s.tga")
- self.C_Slot[number_title_c].SetPosition(a[0][0]+115,a[0][1]-5)
- # self.C_Slot[number_title_c].MakeTitleBar(50+8)
- self.C_Slot[number_title_c].Show()
- self.C_Slot_Number[number_title_c] = ui.TextLine()
- self.C_Slot_Number[number_title_c].SetParent(self.C_Slot[number_title_c])
- self.C_Slot_Number[number_title_c].SetPosition(23,6)
- self.C_Slot_Number[number_title_c].SetText("0")
- self.C_Slot_Number[number_title_c].SetHorizontalAlignCenter()
- self.C_Slot_Number[number_title_c].SetPackedFontColor(0xffa07970)
- self.C_Slot_Number[number_title_c].Show()
- self.C_Slot_Value[number_title_c] = ui.TextLine()
- self.C_Slot_Value[number_title_c].SetParent(self.Board_Caracteristicas)
- self.C_Slot_Value[number_title_c].SetPosition(a[0][0]+200,a[0][1])
- self.C_Slot_Value[number_title_c].SetText("(|cffa08784%s|cffcaa76f +%s|cffa08784)"%(0,0))
- self.C_Slot_Value[number_title_c].SetHorizontalAlignCenter()
- self.C_Slot_Value[number_title_c].SetPackedFontColor(0xffa08784)
- self.C_Slot_Value[number_title_c].Show()
- number_title_c +=1
- def Board_Bonus_Function(self):
- self.Board_Bonus ={}
- self.Board_Bonus_Slot ={}
- self.Board_Bonus_Image ={}
- self.Board_Bonus_Expander ={}
- self.Board_Bonus_Title ={}
- self.Board_Bonus_Search ={}
- number_title_b = 0
- info_b =[
- [[0,0],[uiScriptLocale.OFENSIVE_BONUSES]],
- [[0,45],[uiScriptLocale.DEFENSIVE_BONUSES]],
- [[0,45+49-4],[uiScriptLocale.ALTE_BONUSURI]]
- ]
- for e in info_b:
- self.Board_Bonus[number_title_b] = ui.NewBoard()
- self.Board_Bonus[number_title_b].SetParent(self.GetChild("BonusBoard"))
- self.Board_Bonus[number_title_b].SetPosition(e[0][0],e[0][1])
- self.Board_Bonus[number_title_b].SetSize(275,34-5)
- self.Board_Bonus[number_title_b].Show()
- self.Board_Bonus_Image[number_title_b] = ui.ImageBox()
- self.Board_Bonus_Image[number_title_b].SetParent(self.Board_Bonus[number_title_b])
- self.Board_Bonus_Image[number_title_b].SetPosition(6,5)
- self.Board_Bonus_Image[number_title_b].LoadImage("d:/ymir work/interface/character/line.tga")
- self.Board_Bonus_Image[number_title_b].Show()
- self.Board_Bonus_Expander[number_title_b] = ui.Button()
- self.Board_Bonus_Expander[number_title_b].SetParent(self.Board_Bonus_Image[number_title_b])
- self.Board_Bonus_Expander[number_title_b].SetPosition(6,5)
- self.Board_Bonus_Expander[number_title_b].SetUpVisual("d:/ymir work/interface/character/buttons/bonus_search_01_normal.tga")
- self.Board_Bonus_Expander[number_title_b].SetOverVisual("d:/ymir work/interface/character/buttons/bonus_search_02_hover.tga")
- self.Board_Bonus_Expander[number_title_b].SetDownVisual("d:/ymir work/interface/character/buttons/bonus_search_03_active.tga")
- self.Board_Bonus_Expander[number_title_b].Show()
- self.Board_Bonus_Title[number_title_b] = ui.TextLine()
- self.Board_Bonus_Title[number_title_b].SetParent(self.Board_Bonus_Image[number_title_b])
- self.Board_Bonus_Title[number_title_b].SetPosition(48,12)
- self.Board_Bonus_Title[number_title_b].SetText(e[1][0])
- self.Board_Bonus_Title[number_title_b].SetPackedFontColor(0xffe6d0a2)
- self.Board_Bonus_Title[number_title_b].Show()
- number_title_b += 1
- self.Board_Bonus_s = ui.NewBoard()
- self.Board_Bonus_s.SetParent(self.GetChild("BonusBoard"))
- self.Board_Bonus_s.SetPosition(0,135)
- self.Board_Bonus_s.SetSize(275,140)
- self.Board_Bonus_s.Show()
- self.Board_Bonus_Expander[0].SetEvent(lambda : self.Expander_Bonus_Functiones(0)) # 0-2 =1 , 1-1 =2 ,2 = 3
- self.Board_Bonus_Expander[1].SetEvent(lambda : self.Expander_Bonus_Functiones(1)) # 0-2 =1 , 1-1 =2 ,2 = 3
- self.Board_Bonus_Expander[2].SetEvent(lambda : self.Expander_Bonus_Functiones(2)) # 0-2 =1 , 1-1 =2 ,2 = 3
- def Expander_Bonus_Functiones(self,number):
- global activado
- self.ContentBonus(number,activado)
- if number == 0:
- if activado == 0:
- self.Board_Bonus[number].SetSize(275,20+165)
- self.Board_Bonus[1].SetPosition(0,223-38)
- self.Board_Bonus[2].SetPosition(0,256-27)
- self.Board_Bonus_s.Hide()
- activado = 1
- else:
- self.Board_Bonus[number].SetSize(275,34)
- self.Board_Bonus[1].SetSize(275,25-5)
- self.Board_Bonus[1].SetPosition(0,10+37-2)
- self.Board_Bonus[2].SetSize(275,34-5)
- self.Board_Bonus[2].SetPosition(0,20+37+37-4)
- self.Board_Bonus_s.Show()
- activado = 0
- if number == 1:
- if activado == 0:
- self.Board_Bonus[number].SetSize(275,20+165)
- self.Board_Bonus[2].SetPosition(0,257-27)
- self.Board_Bonus_s.Hide()
- activado = 1
- else:
- self.Board_Bonus[number].SetSize(275,34-5)
- self.Board_Bonus[number].SetPosition(0,12+37-4)
- self.Board_Bonus[0].SetSize(275,34-5)
- self.Board_Bonus[2].SetSize(275,34-5)
- self.Board_Bonus[2].SetPosition(0,20+37+37-4)
- self.Board_Bonus_s.Show()
- activado = 0
- if number == 2:
- if activado == 0:
- self.Board_Bonus[number].SetSize(275,20+165)
- self.Board_Bonus[2].SetPosition(0,20+37+37-4)
- self.Board_Bonus_s.Hide()
- activado = 1
- else:
- self.Board_Bonus[number].SetSize(275,34-5)
- self.Board_Bonus[number].SetPosition(0,12+37-4)
- self.Board_Bonus[0].SetSize(275,34-5)
- self.Board_Bonus[2].SetSize(275,34-5)
- self.Board_Bonus[2].SetPosition(0,20+37+37-4)
- self.Board_Bonus_s.Show()
- activado = 0
- def ContentBonus(self,number,activacion):
- global isLoaded
- self.fileListBox = ui.ListBoxEx()
- self.fileListBox.SetParent(self.Board_Bonus[number])
- self.fileListBox.SetPosition(15, 45)
- self.fileListBox.SetViewItemCount(7)
- self.fileListBox.Show()
- self.ScrollBar = ui.ScrollBarNewDesign_Character()
- self.ScrollBar.SetParent(self.Board_Bonus[number])
- self.ScrollBar.SetPosition(250, 45)
- self.ScrollBar.SetScrollBarSize(137)
- self.ScrollBar.SetScrollStep(0.6)
- self.fileListBox.SetScrollBar(self.ScrollBar)
- self.ContenidoBonus(number)
- self.ContenidoBonus1()
- if activacion == 0:
- isLoaded = 1
- self.fileListBox.Show()
- self.ScrollBar.Show()
- else:
- isLoaded = 0
- self.fileListBox.Hide()
- self.ScrollBar.Hide()
- def ContenidoBonus(self,number):
- global number_on
- number_on = number
- def Functie_glisare_max(self):
- latime = self.GetChild("board").GetWidth()
- latime2 = self.GetChild("TabButtonsBoard").GetWidth()
- if latime < 467:
- latime = latime+2
- latime2 = latime2+2
- self.SetSize(latime,393)
- self.GetChild("board").SetSize(latime,393)
- self.GetChild("TabButtonsBoard").SetSize(latime2,350)
- self.GetChild("Skill_TitleBar").SetWidth(latime-15)
- self.GetChild("Emoticon_TitleBar").SetWidth(latime-15)
- self.GetChild("Quest_TitleBar").SetWidth(latime-15)
- self.GetChild("Stats_TitleBar").SetWidth(latime-15)
- self.GetChild("Character_TitleBar").SetWidth(latime-15)
- self.GetChild("Bonus_TitleBar").SetWidth(latime-15)
- self.GetChild("Expand").SetPosition(latime-15-70, 10)
- self.GetChild("Minimize").SetPosition(latime-15-70, 10)
- self.GetChild("TitleName").SetPosition(0, 12-192)
- self.glisare = WaitingDialog()
- self.glisare.Open(0.0)
- self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_max)
- else:
- self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton6.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton6.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- if character == 1:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- if status == 1:
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- if bonus == 1:
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- if skills == 1:
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- if emotions == 1:
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- if quests == 1:
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- else:
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.Show()
- self.Button2Text.Show()
- self.Button3Text.Show()
- self.Button4Text.Show()
- self.Button5Text.Show()
- self.Button6Text.Show()
- self.GetChild("Minimize").Show()
- self.GetChild("Expand").Hide()
- def Functie_glisare_min(self):
- latime = self.GetChild("board").GetWidth()
- latime2 = self.GetChild("TabButtonsBoard").GetWidth()
- self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton6.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton6.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- if character == 1:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if status == 1:
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if bonus == 1:
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if skills == 1:
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if emotions == 1:
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if quests == 1:
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- else:
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.Button1Text.Hide()
- self.Button2Text.Hide()
- self.Button3Text.Hide()
- self.Button4Text.Hide()
- self.Button5Text.Hide()
- self.Button6Text.Hide()
- if latime>340:
- latime = latime-2
- latime2 = latime2-2
- self.SetSize(latime,393)
- self.GetChild("board").SetSize(latime,393)
- self.GetChild("TabButtonsBoard").SetSize(latime2,350)
- self.GetChild("Skill_TitleBar").SetWidth(latime-15)
- self.GetChild("Emoticon_TitleBar").SetWidth(latime-15)
- self.GetChild("Quest_TitleBar").SetWidth(latime-15)
- self.GetChild("Stats_TitleBar").SetWidth(latime-15)
- self.GetChild("Bonus_TitleBar").SetWidth(latime-15)
- self.GetChild("Character_TitleBar").SetWidth(latime-15)
- self.GetChild("Expand").SetPosition(latime-15-70, 10)
- self.GetChild("Minimize").SetPosition(latime-15-70, 10)
- self.GetChild("TitleName").SetPosition(0, 12-192)
- self.glisare = WaitingDialog()
- self.glisare.Open(0.0)
- self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_min)
- else:
- self.GetChild("Expand").Show()
- self.GetChild("Minimize").Hide()
- def __SetSkillSlotEvent(self):
- for skillPageValue in self.skillPageDict.itervalues():
- skillPageValue.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
- skillPageValue.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectSkill))
- skillPageValue.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
- skillPageValue.SetUnselectItemSlotEvent(ui.__mem_func__(self.ClickSkillSlot))
- skillPageValue.SetUseSlotEvent(ui.__mem_func__(self.ClickSkillSlot))
- skillPageValue.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
- skillPageValue.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
- skillPageValue.SetPressedSlotButtonEvent(ui.__mem_func__(self.OnPressedSlotButton))
- skillPageValue.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
- "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
- "d:/ymir work/ui/game/windows/btn_plus_down.sub")
- def __SetEmotionSlot(self):
- self.emotionToolTip = uiToolTip.ToolTip()
- for slot in (self.soloEmotionSlot, self.dualEmotionSlot):
- slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
- slot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectEmotion))
- slot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot))
- slot.SetUseSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot))
- slot.SetOverInItemEvent(ui.__mem_func__(self.__OverInEmotion))
- slot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutEmotion))
- slot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
- "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
- "d:/ymir work/ui/game/windows/btn_plus_down.sub")
- for slotIdx, datadict in emotion.EMOTION_DICT.items():
- emotionIdx = slotIdx
- slot = self.soloEmotionSlot
- if slotIdx > 50:
- slot = self.dualEmotionSlot
- slot.SetEmotionSlot(slotIdx, emotionIdx)
- slot.SetCoverButton(slotIdx)
- def __SelectEmotion(self, slotIndex):
- if not slotIndex in emotion.EMOTION_DICT:
- return
- if app.IsPressed(app.DIK_LCONTROL):
- player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_EMOTION, slotIndex)
- return
- mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EMOTION, slotIndex, slotIndex)
- def __ClickEmotionSlot(self, slotIndex):
- print "click emotion"
- if not slotIndex in emotion.EMOTION_DICT:
- return
- print "check acting"
- if player.IsActingEmotion():
- return
- command = emotion.EMOTION_DICT[slotIndex]["command"]
- print "command", command
- if slotIndex > 50:
- vid = player.GetTargetVID()
- if 0 == vid or vid == player.GetMainCharacterIndex() or chr.IsNPC(vid) or chr.IsEnemy(vid):
- import chat
- chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.EMOTION_CHOOSE_ONE)
- return
- command += " " + chr.GetNameByVID(vid)
- print "send_command", command
- net.SendChatPacket(command)
- def ActEmotion(self, emotionIndex):
- self.__ClickEmotionSlot(emotionIndex)
- def __OverInEmotion(self, slotIndex):
- if self.emotionToolTip:
- if not slotIndex in emotion.EMOTION_DICT:
- return
- self.emotionToolTip.ClearToolTip()
- self.emotionToolTip.SetTitle(emotion.EMOTION_DICT[slotIndex]["name"])
- self.emotionToolTip.AlignHorizonalCenter()
- self.emotionToolTip.ShowToolTip()
- def __OverOutEmotion(self):
- if self.emotionToolTip:
- self.emotionToolTip.HideToolTip()
- def ContenidoBonus1(self):
- global isLoaded
- global number_on
- if number_on == 0:
- world = 0
- self.Bonusuri_ofensive_val = [
- 63,
- 64,
- 43,
- 54,
- 55,
- 56,
- 57,
- 53,
- 47,
- 48,
- 37,
- 38,
- 39,
- 40,
- 41
- ]
- self.Bonusuri_ofensive_nume = [
- uiScriptLocale.TOOLTIP_APPLY_STEAL_HP,
- uiScriptLocale.TOOLTIP_APPLY_STEAL_SP,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_HUMAN,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_SURA,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_MONSTER,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
- uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_DEVIL,
- uiScriptLocale.TOOLTIP_APPLY_POISON_PCT,
- uiScriptLocale.TOOLTIP_APPLY_STUN_PCT,
- uiScriptLocale.TOOLTIP_APPLY_SLOW_PCT,
- uiScriptLocale.TOOLTIP_APPLY_CRITICAL_PCT,
- uiScriptLocale.TOOLTIP_APPLY_PENETRATE_PCT
- ]
- for i in self.Bonusuri_ofensive_nume:
- self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_ofensive_val[world])),"%" ))) #"|cffa08784"+str(i))
- world = world + 1
- self.Bonusuri_defensive_val = [
- 59,
- 60,
- 61,
- 62,
- 69,
- 70,
- 71,
- 74,
- 73,
- 72,
- 77,
- 67,
- 79,
- 68
- ]
- self.Bonusuri_defensive_nume = [
- uiScriptLocale.TOOLTIP_APPLY_RESIST_WARRIOR,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_ASSASSIN,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_SURA,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_SHAMAN,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_SWORD,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_TWOHAND,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_DAGGER,
- uiScriptLocale.TOOLTIP_RESIST_BOW,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_FAN,
- uiScriptLocale.TOOLTIP_APPLY_RESIST_BELL,
- uiScriptLocale.TOOLTIP_RESIST_MAGIC,
- uiScriptLocale.TOOLTIP_APPLY_BLOCK,
- uiScriptLocale.TOOLTIP_APPLY_REFLECT_MELEE,
- uiScriptLocale.TOOLTIP_APPLY_DODGE
- ]
- if number_on == 1:
- world = 0
- for i in self.Bonusuri_defensive_nume:
- self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_defensive_val[world])),"%" ))) #"|cffa08784"+str(i))
- world = world + 1
- self.Bonusuri_alte_val = [
- 32,
- 33
- ]
- self.Bonusuri_alte_nume = [
- uiScriptLocale.TOOLTIP_HP_REGEN,
- uiScriptLocale.TOOLTIP_SP_REGEN,
- ]
- if number_on == 2:
- world = 0
- for i in self.Bonusuri_alte_nume:
- # self.fileListBox = ui.ListBoxEx()
- self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_alte_val[world])),"%" ))) #"|cffa08784"+str(i))
- world = world + 1
- def __BindEvent(self):
- for i in xrange(len(self.skillGroupButton)):
- self.skillGroupButton[i].SetEvent(lambda arg=i: self.__SelectSkillGroup(arg))
- self.RefreshQuest()
- self.__HideJobToolTip()
- for (tabKey, tabButton) in self.tabButtonDict.items():
- tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey)
- for (statusPlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
- statusPlusButton.SAFE_SetEvent(self.__OnClickStatusPlusButton, statusPlusKey)
- statusPlusButton.ShowToolTip = lambda arg=statusPlusKey: self.__OverInStatButton(arg)
- statusPlusButton.HideToolTip = lambda arg=statusPlusKey: self.__OverOutStatButton()
- for (statusMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
- statusMinusButton.SAFE_SetEvent(self.__OnClickStatusMinusButton, statusMinusKey)
- statusMinusButton.ShowToolTip = lambda arg=statusMinusKey: self.__OverInStatMinusButton(arg)
- statusMinusButton.HideToolTip = lambda arg=statusMinusKey: self.__OverOutStatMinusButton()
- for titleBarValue in self.titleBarDict.itervalues():
- titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide))
- self.questSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectQuest))
- def __LoadWindow(self):
- if self.isLoaded == 1:
- return
- self.isLoaded = 1
- try:
- if localeInfo.IsARABIC() or localeInfo.IsVIETNAM() or localeInfo.IsJAPAN():
- self.__LoadScript("uiscript/CharacterWindow.py")
- else:
- self.__LoadScript("uiscript/CharacterWindow.py")
- self.__BindObject()
- self.__BindEvent()
- except:
- import exception
- exception.Abort("CharacterWindow.__LoadWindow")
- #self.tabButtonDict["EMOTICON"].Disable()
- self.SetState("STATUS")
- def Refreshing(self):
- if self.isLoaded == 0:
- try:
- self.__LoadScript("uiscript/CharacterWindow.py")
- except:
- import exception
- exception.Abort("CharacterWindow.__LoadWindow")
- curPoint = unsigned32(player.GetStatus(player.EXP))
- maxPoint = unsigned32(player.GetStatus(player.NEXT_EXP))
- curPoint = min(curPoint, maxPoint)
- curPoint = max(curPoint, 0)
- maxPoint = max(maxPoint, 0)
- self.GetChild("PercentExp").SetText("%s %.2f%%" % ("", float(curPoint) / max(1, float(maxPoint)) * 100))
- self.GetChild("LevelText").SetText("|cfff8d090"+str(player.GetStatus(player.LEVEL)))
- self.GetChild("PlayerExp").SetText("EXP:"+str(curPoint))
- self.GetChild("NextLvlExp").SetText(uiScriptLocale.CHARACTER_FROM + " " + str(maxPoint))
- #---------------------------
- curEXP = unsigned32(player.GetStatus(player.EXP))
- nextEXP = unsigned32(player.GetStatus(player.NEXT_EXP))
- self.SetExperience(curEXP, nextEXP)
- self.GetChild("PlayerHpText").SetText("|cffa07970"+str(player.GetStatus(player.HP)) + '/' + str(player.GetStatus(player.MAX_HP)))
- self.GetChild("PlayerPeText").SetText("|cffa07970"+str(player.GetStatus(player.SP)) + '/' + str(player.GetStatus(player.MAX_SP)))
- self.GetChild("StrPointsText").SetText("|cffa07970"+str(player.GetStatus(player.ST)))
- self.GetChild("ZrePointsText").SetText("|cffa07970"+str(player.GetStatus(player.DX)))
- self.GetChild("WitPointsText").SetText("|cffa07970"+str(player.GetStatus(player.HT)))
- self.GetChild("IntPointsText").SetText("|cffa07970"+str(player.GetStatus(player.IQ)))
- self.GetChild("StatusPoints").SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+"[|cfff8d090"+str(player.GetStatus(player.STAT))+"|cffa08784]")
- #self.__RefreshStatusPlusButtonList()
- #self.__RefreshStatusMinusButtonList()
- #self.RefreshCharacter()
- #self.RefreshSkill()
- #self.RefreshSkillPlusButtonList()
- self.ref = WaitingDialog()
- self.ref.Open(0.1)
- self.ref.SAFE_SetTimeOverEvent(self.Refreshing)
- def Destroy(self):
- self.ClearDictionary()
- self.__Initialize()
- def Close(self):
- if 0 != self.toolTipSkill:
- self.toolTipSkill.Hide()
- self.Hide()
- def SetSkillToolTip(self, toolTipSkill):
- self.toolTipSkill = toolTipSkill
- def __OnClickStatusPlusButton(self, statusKey):
- try:
- statusPlusCommand=self.statusPlusCommandDict[statusKey]
- net.SendChatPacket(statusPlusCommand)
- except KeyError, msg:
- dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg)
- def __OnClickStatusMinusButton(self, statusKey):
- try:
- statusMinusCommand=self.statusMinusCommandDict[statusKey]
- net.SendChatPacket(statusMinusCommand)
- except KeyError, msg:
- dbg.TraceError("CharacterWindow.__OnClickStatusMinusButton KeyError: %s", msg)
- def __OnClickTabButton(self, stateKey):
- global character,status,bonus,skills,emotions,quests
- latime = self.GetWidth()
- if stateKey == "STATUS":
- character = 1
- status = 0
- bonus = 0
- skills = 0
- emotions = 0
- quests = 0
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if stateKey == "STATUS2":
- character = 0
- status = 1
- bonus = 0
- skills = 0
- emotions = 0
- quests = 0
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if stateKey == "BONUS":
- character = 0
- status = 0
- bonus = 1
- skills = 0
- emotions = 0
- quests = 0
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if stateKey == "SKILL":
- character = 0
- status = 0
- bonus = 0
- skills = 1
- emotions = 0
- quests = 0
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if stateKey == "EMOTICON":
- character = 0
- status = 0
- bonus = 0
- skills = 0
- emotions = 1
- quests = 0
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- if stateKey == "QUEST":
- character = 0
- status = 0
- bonus = 0
- skills = 0
- emotions = 0
- quests = 1
- if latime == 468:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
- self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
- self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
- self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
- self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
- self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
- self.Button6Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_QUEST)
- else:
- self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
- self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
- self.SetState(stateKey)
- #
- def SetState(self, stateKey):
- self.state = stateKey
- for (tabKey, tabButton) in self.tabButtonDict.items():
- if stateKey!=tabKey:
- tabButton.SetUp()
- for pageValue in self.pageDict.itervalues():
- pageValue.Hide()
- for titleBarValue in self.titleBarDict.itervalues():
- titleBarValue.Hide()
- self.titleBarDict[stateKey].Show()
- self.pageDict[stateKey].Show()
- def GetState(self):
- return self.state
- def __GetTotalAtkText(self):
- minAtk=player.GetStatus(player.ATT_MIN)
- maxAtk=player.GetStatus(player.ATT_MAX)
- atkBonus=player.GetStatus(player.ATT_BONUS)
- attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
- if minAtk==maxAtk:
- return "%d" % (minAtk+atkBonus+attackerBonus)
- else:
- return "%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus)
- def __GetTotalMagAtkText(self):
- minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP)
- maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP)
- if minMagAtk==maxMagAtk:
- return "%d" % (minMagAtk)
- else:
- return "%d-%d" % (minMagAtk, maxMagAtk)
- def __GetTotalDefText(self):
- defValue=player.GetStatus(player.DEF_GRADE)
- if constInfo.ADD_DEF_BONUS_ENABLE:
- defValue+=player.GetStatus(player.DEF_BONUS)
- return "%d" % (defValue)
- def RefreshStatus(self):
- self.__RefreshStatusPlusButtonList()
- self.__RefreshStatusMinusButtonList()
- self.RefreshAlignment()
- if self.refreshToolTip:
- self.refreshToolTip()
- def RefreshCaracteristics(self):
- minAtk=player.GetStatus(player.ATT_MIN)
- maxAtk=player.GetStatus(player.ATT_MAX)
- atkBonus=player.GetStatus(player.ATT_BONUS)
- attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
- self.C_Slot_Number[0].SetText(str(player.GetStatus(player.MOVING_SPEED)))
- self.C_Slot_Number[1].SetText(str(player.GetStatus(player.ATT_SPEED)))
- self.C_Slot_Number[2].SetText(str(player.GetStatus(player.CASTING_SPEED)))
- self.C_Slot_Number[4].SetText(str(player.GetStatus(player.MAG_DEF)))
- self.C_Slot_Number[5].SetText(str(player.GetStatus(player.EVADE_RATE)))
- minAtk=player.GetStatus(player.ATT_MIN)
- maxAtk=player.GetStatus(player.ATT_MAX)
- atkBonus=player.GetStatus(player.ATT_BONUS)
- attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
- if minAtk==maxAtk:
- self.C_Slot_Number[6].SetText("%d" % (minAtk+atkBonus+attackerBonus))
- else:
- self.C_Slot_Number[6].SetText("%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus))
- minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP)
- maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP)
- if minMagAtk==maxMagAtk:
- self.C_Slot_Number[3].SetText("%d" % (minMagAtk))
- else:
- self.C_Slot_Number[3].SetText("%d-%d" % (minMagAtk, maxMagAtk))
- defValue=player.GetStatus(player.DEF_GRADE)
- if constInfo.ADD_DEF_BONUS_ENABLE:
- defValue+=player.GetStatus(player.DEF_BONUS)
- self.C_Slot_Number[7].SetText("%d" % (defValue))
- Test_Poits = [player.GetStatus(player.MOVING_SPEED),player.GetStatus(player.ATT_SPEED),player.GetStatus(player.CASTING_SPEED),
- minMagAtk,player.GetStatus(player.MAG_DEF),player.GetStatus(player.EVADE_RATE),minAtk+atkBonus+attackerBonus,defValue]
- #Test_Poits_1 =[0,1,]
- race = net.GetMainActorRace()
- group = net.GetMainActorSkillGroup()
- empire = net.GetMainActorEmpire()
- job = chr.RaceToJob(race)
- if job == 0:
- Test_Poits_2= [100,100,100,8,5,3,10,5]
- if job == 1:
- Test_Poits_2= [100,100,100,8,5,5,8,4]
- if job == 2:
- Test_Poits_2= [100,100,100,12,7,3,9,4]
- if job == 3:
- Test_Poits_2= [100,100,100,14,8,3,7,5]
- if job == 4:
- Test_Poits_2= [100,100,100,8,5,5,8,4]
- #bonemas = player.GetStatus(player.MOVING_SPEED)
- #count_m = 100-player.GetStatus(player.MOVING_SPEED)
- for i in xrange(0,8):
- #count_m = str(i)
- if Test_Poits[i] == Test_Poits_2[i]:
- self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f +%s|cffa08784)"%(Test_Poits_2[i],0))
- if Test_Poits[i] > Test_Poits_2[i]:
- self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f %s|cffa08784)"%(str(Test_Poits_2[i]),str(Test_Poits_2[i]-Test_Poits[i]).replace("-","+")))
- #self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f %s|cffa08784)"%(100,str(count_m).replace("-","+")))
- if Test_Poits[i] < Test_Poits_2[i]:
- self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f -%s|cffa08784)"%(str(Test_Poits_2[i]),str(Test_Poits_2[i]-Test_Poits[i])))
- #self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f -%s|cffa08784)"%(100,str(count_m)))
- def __RefreshStatusPlusButtonList(self):
- statusPlusPoint=player.GetStatus(player.STAT)
- if statusPlusPoint>0:
- self.ShowStatusPlusButtonList()
- else:
- self.HideStatusPlusButtonList()
- def __RefreshStatusMinusButtonList(self):
- statusMinusPoint=self.__GetStatMinusPoint()
- if statusMinusPoint>0:
- self.__ShowStatusMinusButtonList()
- else:
- self.__HideStatusMinusButtonList()
- def RefreshAlignment(self):
- point, grade = player.GetAlignmentData()
- import colorInfo
- COLOR_DICT = { 0 : colorInfo.TITLE_RGB_GOOD_4,
- 1 : colorInfo.TITLE_RGB_GOOD_3,
- 2 : colorInfo.TITLE_RGB_GOOD_2,
- 3 : colorInfo.TITLE_RGB_GOOD_1,
- 4 : colorInfo.TITLE_RGB_NORMAL,
- 5 : colorInfo.TITLE_RGB_EVIL_1,
- 6 : colorInfo.TITLE_RGB_EVIL_2,
- 7 : colorInfo.TITLE_RGB_EVIL_3,
- 8 : colorInfo.TITLE_RGB_EVIL_4, }
- colorList = COLOR_DICT.get(grade, colorInfo.TITLE_RGB_NORMAL)
- gradeColor = ui.GenerateColor(colorList[0], colorList[1], colorList[2])
- self.toolTipAlignment.ClearToolTip()
- self.toolTipAlignment.AutoAppendTextLine(localeInfo.TITLE_NAME_LIST[grade], gradeColor)
- self.toolTipAlignment.AutoAppendTextLine(localeInfo.ALIGNMENT_NAME + str(point))
- self.toolTipAlignment.AlignHorizonalCenter()
- def __ShowStatusMinusButtonList(self):
- for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
- statusMinusButton.Show()
- def __HideStatusMinusButtonList(self):
- for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
- statusMinusButton.Hide()
- def ShowStatusPlusButtonList(self):
- for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
- statusPlusButton.Show()
- def HideStatusPlusButtonList(self):
- for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
- statusPlusButton.Hide()
- def SelectSkill(self, skillSlotIndex):
- mouseController = mouseModule.mouseController
- if FALSE == mouseController.isAttached():
- srcSlotIndex = self.__RealSkillSlotToSourceSlot(skillSlotIndex)
- selectedSkillIndex = player.GetSkillIndex(srcSlotIndex)
- if skill.CanUseSkill(selectedSkillIndex):
- if app.IsPressed(app.DIK_LCONTROL):
- player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, srcSlotIndex)
- return
- mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, srcSlotIndex, selectedSkillIndex)
- else:
- mouseController.DeattachObject()
- def SelectEmptySlot(self, SlotIndex):
- mouseModule.mouseController.DeattachObject()
- ## ToolTip
- def OverInItem(self, slotNumber):
- if mouseModule.mouseController.isAttached():
- return
- if 0 == self.toolTipSkill:
- return
- srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber)
- skillIndex = player.GetSkillIndex(srcSlotIndex)
- skillLevel = player.GetSkillLevel(srcSlotIndex)
- skillGrade = player.GetSkillGrade(srcSlotIndex)
- skillType = skill.GetSkillType(skillIndex)
- ## ACTIVE
- if skill.SKILL_TYPE_ACTIVE == skillType:
- overInSkillGrade = self.__GetSkillGradeFromSlot(slotNumber)
- if overInSkillGrade == skill.SKILL_GRADE_COUNT-1 and skillGrade == skill.SKILL_GRADE_COUNT:
- self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel)
- elif overInSkillGrade == skillGrade:
- self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, overInSkillGrade, skillLevel)
- else:
- self.toolTipSkill.SetSkillOnlyName(srcSlotIndex, skillIndex, overInSkillGrade)
- else:
- self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel)
- def OverOutItem(self):
- if 0 != self.toolTipSkill:
- self.toolTipSkill.HideToolTip()
- ## Quest
- def __SelectQuest(self, slotIndex):
- questIndex = quest.GetQuestIndex(self.questShowingStartIndex+slotIndex)
- import event
- event.QuestButtonClick(-2147483648 + questIndex)
- def RefreshQuest(self):
- if self.isLoaded==0:
- return
- questCount = quest.GetQuestCount()
- questRange = range(quest.QUEST_MAX_NUM)
- if questCount > quest.QUEST_MAX_NUM:
- self.questScrollBar.Show()
- else:
- self.questScrollBar.Hide()
- for i in questRange[:questCount]:
- (questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
- if questName[0] == '*':
- questName = questName[1:]
- elif questName[0] == '&':
- questName = questName[1:]
- elif questName[0] == '~':
- questName = questName[1:]
- elif questName[0] == '+':
- questName = questName[1:]
- self.questNameList[i].SetText(questName)
- self.questNameList[i].Show()
- self.questLastCountList[i].Show()
- self.questLastTimeList[i].Show()
- if len(questCounterName) > 0:
- self.questLastCountList[i].SetText("%s : %d" % (questCounterName, questCounterValue))
- else:
- self.questLastCountList[i].SetText("")
- ## Icon
- self.questSlot.SetSlot(i, i, 1, 1, questIcon)
- for i in questRange[questCount:]:
- self.questNameList[i].Hide()
- self.questLastTimeList[i].Hide()
- self.questLastCountList[i].Hide()
- self.questSlot.ClearSlot(i)
- self.questSlot.HideSlotBaseImage(i)
- self.__UpdateQuestClock()
- def __UpdateQuestClock(self):
- # QUEST_LIMIT_COUNT_BUG_FIX
- for i in xrange(min(quest.GetQuestCount(), quest.QUEST_MAX_NUM)):
- # END_OF_QUEST_LIMIT_COUNT_BUG_FIX
- (lastName, lastTime) = quest.GetQuestLastTime(i)
- clockText = localeInfo.QUEST_UNLIMITED_TIME
- if len(lastName) > 0:
- if lastTime <= 0:
- clockText = localeInfo.QUEST_TIMEOVER
- else:
- questLastMinute = lastTime / 60
- questLastSecond = lastTime % 60
- clockText = lastName + " : "
- if questLastMinute > 0:
- clockText += str(questLastMinute) + localeInfo.QUEST_MIN
- if questLastSecond > 0:
- clockText += " "
- if questLastSecond > 0:
- clockText += str(questLastSecond) + localeInfo.QUEST_SEC
- self.questLastTimeList[i].SetText(clockText)
- ###------Experience
- def SetExperience(self, curPoint, maxPoint):
- curPoint = min(curPoint, maxPoint)
- if maxPoint > 0:
- self.GetChild("ExpImgFull").SetPercentage(curPoint, maxPoint)
- def __GetStatMinusPoint(self):
- POINT_STAT_RESET_COUNT = 112
- return player.GetStatus(POINT_STAT_RESET_COUNT)
- def __OverInStatMinusButton(self, stat):
- try:
- self.__ShowStatToolTip(self.STAT_MINUS_DESCRIPTION[stat] % self.__GetStatMinusPoint())
- except KeyError:
- pass
- self.refreshToolTip = lambda arg=stat: self.__OverInStatMinusButton(arg)
- def __OverOutStatMinusButton(self):
- self.__HideStatToolTip()
- self.refreshToolTip = 0
- def __OverInStatButton(self, stat):
- try:
- self.__ShowStatToolTip(self.STAT_DESCRIPTION[stat])
- except KeyError:
- pass
- def __OverOutStatButton(self):
- self.__HideStatToolTip()
- def __ShowStatToolTip(self, statDesc):
- self.toolTip.ClearToolTip()
- self.toolTip.AppendTextLine(statDesc)
- self.toolTip.Show()
- def __HideStatToolTip(self):
- self.toolTip.Hide()
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- def OnUpdate(self):
- self.ContenidoBonus1()
- self.RefreshCaracteristics()
- self.__UpdateQuestClock()
- ## Skill Process
- def __RefreshSkillPage(self, name, slotCount):
- global SHOW_LIMIT_SUPPORT_SKILL_LIST
- skillPage = self.skillPageDict[name]
- startSlotIndex = skillPage.GetStartIndex()
- if "ACTIVE" == name:
- if self.PAGE_HORSE == self.curSelectedSkillGroup:
- startSlotIndex += slotCount
- getSkillType=skill.GetSkillType
- getSkillIndex=player.GetSkillIndex
- getSkillGrade=player.GetSkillGrade
- getSkillLevel=player.GetSkillLevel
- getSkillLevelUpPoint=skill.GetSkillLevelUpPoint
- getSkillMaxLevel=skill.GetSkillMaxLevel
- for i in xrange(slotCount+1):
- slotIndex = i + startSlotIndex
- skillIndex = getSkillIndex(slotIndex)
- for j in xrange(skill.SKILL_GRADE_COUNT):
- skillPage.ClearSlot(self.__GetRealSkillSlot(j, i))
- if 0 == skillIndex:
- continue
- skillGrade = getSkillGrade(slotIndex)
- skillLevel = getSkillLevel(slotIndex)
- skillType = getSkillType(skillIndex)
- if player.SKILL_INDEX_RIDING == skillIndex:
- if 1 == skillGrade:
- skillLevel += 19
- elif 2 == skillGrade:
- skillLevel += 29
- elif 3 == skillGrade:
- skillLevel = 40
- skillPage.SetSkillSlotNew(slotIndex, skillIndex, max(skillLevel-1, 0), skillLevel)
- skillPage.SetSlotCount(slotIndex, skillLevel)
- ## ACTIVE
- elif skill.SKILL_TYPE_ACTIVE == skillType:
- for j in xrange(skill.SKILL_GRADE_COUNT):
- realSlotIndex = self.__GetRealSkillSlot(j, slotIndex)
- skillPage.SetSkillSlotNew(realSlotIndex, skillIndex, j, skillLevel)
- skillPage.SetCoverButton(realSlotIndex)
- if (skillGrade == skill.SKILL_GRADE_COUNT) and j == (skill.SKILL_GRADE_COUNT-1):
- skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
- elif (not self.__CanUseSkillNow()) or (skillGrade != j):
- skillPage.SetSlotCount(realSlotIndex, 0)
- skillPage.DisableCoverButton(realSlotIndex)
- else:
- skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
- else:
- if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST:
- realSlotIndex = self.__GetETCSkillRealSlotIndex(slotIndex)
- skillPage.SetSkillSlot(realSlotIndex, skillIndex, skillLevel)
- skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
- if skill.CanUseSkill(skillIndex):
- skillPage.SetCoverButton(realSlotIndex)
- skillPage.RefreshSlot()
- def RefreshSkill(self):
- if self.isLoaded==0:
- return
- if self.__IsChangedHorseRidingSkillLevel():
- self.RefreshCharacter()
- return
- global SHOW_ONLY_ACTIVE_SKILL
- if SHOW_ONLY_ACTIVE_SKILL:
- self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT)
- else:
- self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT)
- self.__RefreshSkillPage("SUPPORT", self.SUPPORT_PAGE_SLOT_COUNT)
- self.RefreshSkillPlusButtonList()
- def CanShowPlusButton(self, skillIndex, skillLevel, curStatPoint):
- if 0 == skillIndex:
- return FALSE
- if not skill.CanLevelUpSkill(skillIndex, skillLevel):
- return FALSE
- return TRUE
- def __RefreshSkillPlusButton(self, name):
- global HIDE_SUPPORT_SKILL_POINT
- if HIDE_SUPPORT_SKILL_POINT and "SUPPORT" == name:
- return
- slotWindow = self.skillPageDict[name]
- slotWindow.HideAllSlotButton()
- slotStatType = self.skillPageStatDict[name]
- if 0 == slotStatType:
- return
- statPoint = player.GetStatus(slotStatType)
- startSlotIndex = slotWindow.GetStartIndex()
- if "HORSE" == name:
- startSlotIndex += self.ACTIVE_PAGE_SLOT_COUNT
- if statPoint > 0:
- for i in xrange(self.PAGE_SLOT_COUNT):
- slotIndex = i + startSlotIndex
- skillIndex = player.GetSkillIndex(slotIndex)
- skillGrade = player.GetSkillGrade(slotIndex)
- skillLevel = player.GetSkillLevel(slotIndex)
- if skillIndex == 0:
- continue
- if skillGrade != 0:
- continue
- if name == "HORSE":
- if player.GetStatus(player.LEVEL) >= skill.GetSkillLevelLimit(skillIndex):
- if skillLevel < 20:
- slotWindow.ShowSlotButton(self.__GetETCSkillRealSlotIndex(slotIndex))
- else:
- if "SUPPORT" == name:
- if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST:
- if self.CanShowPlusButton(skillIndex, skillLevel, statPoint):
- slotWindow.ShowSlotButton(slotIndex)
- else:
- if self.CanShowPlusButton(skillIndex, skillLevel, statPoint):
- slotWindow.ShowSlotButton(slotIndex)
- def RefreshSkillPlusButtonList(self):
- if self.isLoaded==0:
- return
- self.RefreshSkillPlusPointLabel()
- if not self.__CanUseSkillNow():
- return
- try:
- if self.PAGE_HORSE == self.curSelectedSkillGroup:
- self.__RefreshSkillPlusButton("HORSE")
- else:
- self.__RefreshSkillPlusButton("ACTIVE")
- self.__RefreshSkillPlusButton("SUPPORT")
- except:
- import exception
- exception.Abort("CharacterWindow.RefreshSkillPlusButtonList.BindObject")
- def RefreshSkillPlusPointLabel(self):
- if self.isLoaded==0:
- return
- if self.PAGE_HORSE == self.curSelectedSkillGroup:
- self.activeSkillPointValue.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+" [|cfff8d090"+str(player.GetStatus(player.SKILL_HORSE))+"|cffa08784]")
- else:
- self.activeSkillPointValue.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+" [|cfff8d090"+str(player.GetStatus(player.SKILL_ACTIVE))+"|cffa08784]")
- ## Skill Level Up Button
- def OnPressedSlotButton(self, slotNumber):
- srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber)
- skillIndex = player.GetSkillIndex(srcSlotIndex)
- curLevel = player.GetSkillLevel(srcSlotIndex)
- maxLevel = skill.GetSkillMaxLevel(skillIndex)
- net.SendChatPacket("/skillup " + str(skillIndex))
- ## Use Skill
- def ClickSkillSlot(self, slotIndex):
- srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotIndex)
- skillIndex = player.GetSkillIndex(srcSlotIndex)
- skillType = skill.GetSkillType(skillIndex)
- if not self.__CanUseSkillNow():
- if skill.SKILL_TYPE_ACTIVE == skillType:
- return
- for slotWindow in self.skillPageDict.values():
- if slotWindow.HasSlot(slotIndex):
- if skill.CanUseSkill(skillIndex):
- player.ClickSkillSlot(srcSlotIndex)
- return
- mouseModule.mouseController.DeattachObject()
- def OnUseSkill(self, slotIndex, coolTime):
- skillIndex = player.GetSkillIndex(slotIndex)
- skillType = skill.GetSkillType(skillIndex)
- ## ACTIVE
- if skill.SKILL_TYPE_ACTIVE == skillType:
- skillGrade = player.GetSkillGrade(slotIndex)
- slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
- ## ETC
- else:
- slotIndex = self.__GetETCSkillRealSlotIndex(slotIndex)
- for slotWindow in self.skillPageDict.values():
- if slotWindow.HasSlot(slotIndex):
- slotWindow.SetSlotCoolTime(slotIndex, coolTime)
- return
- def OnActivateSkill(self, slotIndex):
- skillGrade = player.GetSkillGrade(slotIndex)
- slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
- for slotWindow in self.skillPageDict.values():
- if slotWindow.HasSlot(slotIndex):
- slotWindow.ActivateSlot(slotIndex)
- return
- def OnDeactivateSkill(self, slotIndex):
- skillGrade = player.GetSkillGrade(slotIndex)
- slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
- for slotWindow in self.skillPageDict.values():
- if slotWindow.HasSlot(slotIndex):
- slotWindow.DeactivateSlot(slotIndex)
- return
- def __ShowJobToolTip(self):
- self.toolTipJob.ShowToolTip()
- def __HideJobToolTip(self):
- self.toolTipJob.HideToolTip()
- def __SetJobText(self, mainJob, subJob):
- if player.GetStatus(player.LEVEL)<5:
- subJob=0
- if 949 == app.GetDefaultCodePage():
- self.toolTipJob.ClearToolTip()
- try:
- jobInfoTitle=localeInfo.JOBINFO_TITLE[mainJob][subJob]
- jobInfoData=locale.JOBINFO_DATA_LIST[mainJob][subJob]
- except IndexError:
- print "uiCharacter.CharacterWindow.__SetJobText(mainJob=%d, subJob=%d)" % (mainJob, subJob)
- return
- self.toolTipJob.AutoAppendTextLine(jobInfoTitle)
- self.toolTipJob.AppendSpace(5)
- for jobInfoDataLine in jobInfoData:
- self.toolTipJob.AutoAppendTextLine(jobInfoDataLine)
- self.toolTipJob.AlignHorizonalCenter()
- def __ShowAlignmentToolTip(self):
- self.toolTipAlignment.ShowToolTip()
- def __HideAlignmentToolTip(self):
- self.toolTipAlignment.HideToolTip()
- def RefreshCharacter(self):
- if self.isLoaded==0:
- return
- ## Name
- try:
- characterName = player.GetName()
- guildName = player.GetGuildName()
- self.characterNameValue.SetText("|cffa07970"+characterName)
- if guildName == "":
- self.guildNameValue.SetText("|cffa07970Fãrã Breaslã ")
- else:
- self.guildNameValue.SetText("|cffa07970"+guildName)
- self.guildNameSlot.Show()
- except:
- import exception
- exception.Abort("CharacterWindow.RefreshCharacter.BindObject")
- race = net.GetMainActorRace()
- group = net.GetMainActorSkillGroup()
- empire = net.GetMainActorEmpire()
- ## Job Text
- job = chr.RaceToJob(race)
- self.__SetJobText(job, group)
- self.img2 = self.GetChild("ChrIcon")
- self.img2.LoadImage(FACE_IMAGE_DICT[race])
- self.img2.Show()
- ## GroupName
- self.__SetSkillGroupName(race, group)
- ## Skill
- if 0 == group:
- self.__SelectSkillGroup(0)
- else:
- self.__SetSkillSlotData(race, group, empire)
- if self.__CanUseHorseSkill():
- self.__SelectSkillGroup(0)
- def __SetSkillGroupName(self, race, group):
- job = chr.RaceToJob(race)
- if not self.SKILL_GROUP_NAME_DICT.has_key(job):
- return
- nameList = self.SKILL_GROUP_NAME_DICT[job]
- if 0 == group:
- self.skillGroupButton1.SetText(nameList[1])
- self.skillGroupButton2.SetText(nameList[2])
- self.skillGroupButton1.Show()
- self.skillGroupButton2.Show()
- self.activeSkillGroupName.Hide()
- else:
- if self.__CanUseHorseSkill():
- self.activeSkillGroupName.SetText(nameList.get(group, "Noname"))
- self.activeSkillGroupName.Show()
- self.skillGroupButton1.Show()
- self.skillGroupButton2.Show()
- else:
- # self.activeSkillGroupName.SetText(nameList.get(group, "Noname"))
- self.activeSkillGroupName.Show()
- self.skillGroupButton1.Hide()
- self.skillGroupButton2.Hide()
- def __SetSkillSlotData(self, race, group, empire=0):
- ## SkillIndex
- playerSettingModule.RegisterSkill(race, group, empire)
- ## Event
- self.__SetSkillSlotEvent()
- ## Refresh
- self.RefreshSkill()
- def __SelectSkillGroup(self, index):
- for btn in self.skillGroupButton:
- btn.SetUp()
- self.skillGroupButton[index].Down()
- if self.__CanUseHorseSkill():
- if 0 == index:
- index = net.GetMainActorSkillGroup()-1
- elif 1 == index:
- index = self.PAGE_HORSE
- self.curSelectedSkillGroup = index
- self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire())
- def __CanUseSkillNow(self):
- if 0 == net.GetMainActorSkillGroup():
- return FALSE
- return TRUE
- def __CanUseHorseSkill(self):
- slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_RIDING)
- if not slotIndex:
- return FALSE
- grade = player.GetSkillGrade(slotIndex)
- level = player.GetSkillLevel(slotIndex)
- if level < 0:
- level *= -1
- if grade >= 1 and level >= 1:
- return TRUE
- return FALSE
- def __IsChangedHorseRidingSkillLevel(self):
- ret = FALSE
- if -1 == self.canUseHorseSkill:
- self.canUseHorseSkill = self.__CanUseHorseSkill()
- if self.canUseHorseSkill != self.__CanUseHorseSkill():
- ret = TRUE
- self.canUseHorseSkill = self.__CanUseHorseSkill()
- return ret
- def __GetRealSkillSlot(self, skillGrade, skillSlot):
- return skillSlot + min(skill.SKILL_GRADE_COUNT-1, skillGrade)*skill.SKILL_GRADE_STEP_COUNT
- def __GetETCSkillRealSlotIndex(self, skillSlot):
- if skillSlot > 100:
- return skillSlot
- return skillSlot % self.ACTIVE_PAGE_SLOT_COUNT
- def __RealSkillSlotToSourceSlot(self, realSkillSlot):
- if realSkillSlot > 100:
- return realSkillSlot
- if self.PAGE_HORSE == self.curSelectedSkillGroup:
- return realSkillSlot + self.ACTIVE_PAGE_SLOT_COUNT
- return realSkillSlot % skill.SKILL_GRADE_STEP_COUNT
- def __GetSkillGradeFromSlot(self, skillSlot):
- return int(skillSlot / skill.SKILL_GRADE_STEP_COUNT)
- def SelectSkillGroup(self, index):
- self.__SelectSkillGroup(index)
- def OnQuestScroll(self):
- questCount = quest.GetQuestCount()
- scrollLineCount = max(0, questCount - quest.QUEST_MAX_NUM)
- startIndex = int(scrollLineCount * self.questScrollBar.GetPos())
- if startIndex != self.questShowingStartIndex:
- self.questShowingStartIndex = startIndex
- self.RefreshQuest()
- class WaitingDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.eventTimeOver = lambda *arg: None
- self.eventExit = lambda *arg: None
- def __del__(self):
- ui.ScriptWindow.__del__(self)
- def Open(self, waitTime):
- import time
- curTime = time.clock()
- self.endTime = curTime + waitTime
- self.Show()
- def Close(self):
- self.Hide()
- def Destroy(self):
- self.Hide()
- def SAFE_SetTimeOverEvent(self, event):
- self.eventTimeOver = ui.__mem_func__(event)
- def SAFE_SetExitEvent(self, event):
- self.eventExit = ui.__mem_func__(event)
- def OnUpdate(self):
- import time
- lastTime = max(0, self.endTime - time.clock())
- if 0 == lastTime:
- self.Close()
- self.eventTimeOver()
- else:
- return
- def OnPressExitKey(self):
- self.Close()
- return TRUE
- class Item(ui.ListBoxEx.Item):
- def __init__(self, fileName):
- ui.ListBoxEx.Item.__init__(self)
- self.canLoad=0
- self.text=fileName
- self.textLine=self.__CreateTextLine(fileName[:70])
- def __del__(self):
- ui.ListBoxEx.Item.__del__(self)
- def GetText(self):
- return self.text
- def SetSize(self, width, height):
- ui.ListBoxEx.Item.SetSize(self, 0, 0)
- def __CreateTextLine(self, fileName):
- textLine=ui.TextLine()
- textLine.SetParent(self)
- textLine.SetPosition(0, 0)
- textLine.SetText(fileName)
- textLine.Show()
- return textLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement