Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 70.38 KB | None | 0 0
  1. import ui
  2. import uiScriptLocale
  3. import app
  4. import net
  5. import dbg
  6. import snd
  7. import player
  8. import mouseModule
  9. import wndMgr
  10. import skill
  11. import playerSettingModule
  12. import quest
  13. import localeInfo
  14. import uiToolTip
  15. import constInfo
  16. import emotion
  17. import chr
  18. # import localeinfogeo
  19.  
  20. character = 1
  21. status = 0
  22. bonus = 0
  23. skills = 0
  24. emotions = 0
  25. quests = 0
  26. activado = 0
  27. number_on = 5
  28.  
  29. SHOW_ONLY_ACTIVE_SKILL = FALSE
  30. SHOW_LIMIT_SUPPORT_SKILL_LIST = []
  31. HIDE_SUPPORT_SKILL_POINT = FALSE
  32.  
  33. REFRESH_IMAGE_LOCATION_VEGAS_1 = "d:/ymir work/interface/expand_system/chrbutton_big_n.tga"
  34. REFRESH_IMAGE_LOCATION_VEGAS_2 = "d:/ymir work/interface/expand_system/chrbutton_big_a.tga"
  35.  
  36. NAME_CLASS_I = "STATUS"
  37. NAME_CLASS_II = "STATUS2"
  38. NAME_CLASS_III = "BONUS"
  39. NAME_CLASS_IV = "SKILL"
  40. NAME_CLASS_V = "EMOTICON"
  41. NAME_CLASS_VI = "QUEST"
  42.  
  43.  
  44. if localeInfo.IsYMIR():
  45. SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139 ,141,142]
  46. if not localeInfo.IsCHEONMA():
  47. HIDE_SUPPORT_SKILL_POINT = TRUE
  48. SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139 ,141,142]
  49. if localeInfo.IsJAPAN() or (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"):
  50. HIDE_SUPPORT_SKILL_POINT = TRUE
  51. SHOW_LIMIT_SUPPORT_SKILL_LIST = [121, 122, 123, 124, 126, 127, 129, 128, 131, 137, 138, 139]
  52. else:
  53. HIDE_SUPPORT_SKILL_POINT = TRUE
  54.  
  55. FACE_IMAGE_DICT = {
  56. playerSettingModule.RACE_WARRIOR_M : "d:/ymir work/interface/faces/icon_mwarrior.tga",
  57. playerSettingModule.RACE_WARRIOR_W : "d:/ymir work/interface/faces/icon_wwarrior.tga",
  58. playerSettingModule.RACE_ASSASSIN_M : "d:/ymir work/interface/faces/icon_mninja.tga",
  59. playerSettingModule.RACE_ASSASSIN_W : "d:/ymir work/interface/faces/icon_wninja.tga",
  60. playerSettingModule.RACE_SURA_M : "d:/ymir work/interface/faces/icon_msura.tga",
  61. playerSettingModule.RACE_SURA_W : "d:/ymir work/interface/faces/icon_wsura.tga",
  62. playerSettingModule.RACE_SHAMAN_M : "d:/ymir work/interface/faces/icon_mshaman.tga",
  63. playerSettingModule.RACE_SHAMAN_W : "d:/ymir work/interface/faces/icon_wshaman.tga",
  64. }
  65.  
  66. def unsigned32(n):
  67. return n & 0xFFFFFFFFFL
  68.  
  69. class CharacterWindow(ui.ScriptWindow):
  70.  
  71. ACTIVE_PAGE_SLOT_COUNT = 8
  72. SUPPORT_PAGE_SLOT_COUNT = 12
  73.  
  74. PAGE_SLOT_COUNT = 12
  75. PAGE_HORSE = 2
  76.  
  77. SKILL_GROUP_NAME_DICT = {
  78. playerSettingModule.JOB_WARRIOR : { 1 : localeInfo.SKILL_GROUP_WARRIOR_1, 2 : localeInfo.SKILL_GROUP_WARRIOR_2, },
  79. playerSettingModule.JOB_ASSASSIN : { 1 : localeInfo.SKILL_GROUP_ASSASSIN_1, 2 : localeInfo.SKILL_GROUP_ASSASSIN_2, },
  80. playerSettingModule.JOB_SURA : { 1 : localeInfo.SKILL_GROUP_SURA_1, 2 : localeInfo.SKILL_GROUP_SURA_2, },
  81. playerSettingModule.JOB_SHAMAN : { 1 : localeInfo.SKILL_GROUP_SHAMAN_1, 2 : localeInfo.SKILL_GROUP_SHAMAN_2, },
  82. }
  83.  
  84. STAT_DESCRIPTION = {
  85. "HTH" : localeInfo.STAT_TOOLTIP_CON,
  86. "INT" : localeInfo.STAT_TOOLTIP_INT,
  87. "STR" : localeInfo.STAT_TOOLTIP_STR,
  88. "DEX" : localeInfo.STAT_TOOLTIP_DEX,
  89. }
  90.  
  91.  
  92. STAT_MINUS_DESCRIPTION = localeInfo.STAT_MINUS_DESCRIPTION
  93.  
  94. def __init__(self):
  95. ui.ScriptWindow.__init__(self)
  96. self.state = "STATUS"
  97. self.isLoaded = 0
  98.  
  99. self.toolTipSkill = 0
  100.  
  101. self.__Initialize()
  102. self.__LoadWindow()
  103.  
  104. self.statusPlusCommandDict={
  105. "HTH" : "/stat ht",
  106. "INT" : "/stat iq",
  107. "STR" : "/stat st",
  108. "DEX" : "/stat dx",
  109. }
  110.  
  111. self.statusMinusCommandDict={
  112. "HTH-" : "/stat- ht",
  113. "INT-" : "/stat- iq",
  114. "STR-" : "/stat- st",
  115. "DEX-" : "/stat- dx",
  116. }
  117.  
  118. def __del__(self):
  119. ui.ScriptWindow.__del__(self)
  120.  
  121. def __Initialize(self):
  122. self.refreshToolTip = 0
  123. self.curSelectedSkillGroup = 0
  124. self.canUseHorseSkill = -1
  125.  
  126. self.toolTip = None
  127. self.toolTipJob = None
  128. self.toolTipAlignment = None
  129. self.toolTipSkill = None
  130.  
  131. #self.faceImage = None
  132. self.activeSlot = None
  133. self.tabButtonDict = None
  134. self.pageDict = None
  135. self.titleBarDict = None
  136. self.statusPlusButtonDict = None
  137. self.statusMinusButtonDict = None
  138.  
  139. self.skillPageDict = None
  140. self.questShowingStartIndex = 0
  141. self.questScrollBar = None
  142. self.questSlot = None
  143. self.questNameList = None
  144. self.questLastTimeList = None
  145. self.questLastCountList = None
  146. self.skillGroupButton = ()
  147.  
  148. self.activeSlot = None
  149. self.activeSkillPointValue = None
  150. self.skillGroupButton1 = None
  151. self.skillGroupButton2 = None
  152. self.activeSkillGroupName = None
  153. # self.expGauge = None
  154.  
  155. self.first_board = None
  156. self.guildNameSlot = None
  157. self.guildNameValue = None
  158. self.characterNameSlot = None
  159. self.characterNameValue = None
  160.  
  161. self.emotionToolTip = None
  162. self.soloEmotionSlot = None
  163. self.dualEmotionSlot = None
  164. # self.PercentExper = None
  165.  
  166. def Show(self):
  167. self.__LoadWindow()
  168.  
  169. ui.ScriptWindow.Show(self)
  170.  
  171. def __LoadScript(self, fileName):
  172. pyScrLoader = ui.PythonScriptLoader()
  173. pyScrLoader.LoadScriptFile(self, fileName)
  174.  
  175. def __BindObject(self):
  176. self.toolTip = uiToolTip.ToolTip()
  177. self.toolTipJob = uiToolTip.ToolTip()
  178. self.toolTipAlignment = uiToolTip.ToolTip(130)
  179.  
  180. self.Refreshing()
  181.  
  182. self.characterNameSlot = self.GetChild("NameSlot")
  183. self.bonusboard = self.GetChild("BonusBoard")
  184. self.characterNameValue = self.GetChild("NazwaGracza")
  185. self.guildNameSlot = self.GetChild("GuildSlot")
  186. self.guildNameValue = self.GetChild("NazwaGildii")
  187. self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_IN", self.__ShowAlignmentToolTip)
  188. self.characterNameSlot.SAFE_SetStringEvent("MOUSE_OVER_OUT", self.__HideAlignmentToolTip)
  189.  
  190. self.activeSlot = self.GetChild("Skill_Active_Slot")
  191. self.activeSkillPointValue = self.GetChild("Active_Skill_Point_Value")
  192. self.skillGroupButton1 = self.GetChild("Skill_Group_Button_1")
  193. self.skillGroupButton2 = self.GetChild("Skill_Group_Button_2")
  194. self.activeSkillGroupName = self.GetChild("Active_Skill_Group_Name")
  195.  
  196.  
  197. self.GetChild("Expand").SetEvent(self.Functie_glisare_max)
  198. self.GetChild("Minimize").SetEvent(self.Functie_glisare_min)
  199. self.GetChild("Minimize").Hide()
  200.  
  201. #--------------------
  202. self.TabButton1 = self.GetChild("Tab_Button_01")
  203. self.TabButton2 = self.GetChild("Tab_Button_02")
  204. self.TabButton3 = self.GetChild("Tab_Button_03")
  205. self.TabButton4 = self.GetChild("Tab_Button_04")
  206. self.TabButton5 = self.GetChild("Tab_Button_05")
  207. self.TabButton6 = self.GetChild("Tab_Button_06")
  208.  
  209. self.Button1Text = self.GetChild("Button1_Name")
  210. self.Button1Text.Hide()
  211. self.Button2Text = self.GetChild("Button2_Name")
  212. self.Button2Text.Hide()
  213. self.Button3Text = self.GetChild("Button3_Name")
  214. self.Button3Text.Hide()
  215. self.Button4Text = self.GetChild("Button4_Name")
  216. self.Button4Text.Hide()
  217. self.Button5Text = self.GetChild("Button5_Name")
  218. self.Button5Text.Hide()
  219. self.Button6Text = self.GetChild("Button6_Name")
  220. self.Button6Text.Hide()
  221.  
  222. self.tabButtonDict = {
  223. "STATUS" : self.GetChild("Tab_Button_01"),
  224. "STATUS2" : self.GetChild("Tab_Button_02"),
  225. "BONUS" : self.GetChild("Tab_Button_03"),
  226. "SKILL" : self.GetChild("Tab_Button_04"),
  227. "EMOTICON" : self.GetChild("Tab_Button_05"),
  228. "QUEST" : self.GetChild("Tab_Button_06")
  229.  
  230. }
  231.  
  232. self.pageDict = {
  233. "STATUS" : self.GetChild("Character_Page"),
  234. "STATUS2" : self.GetChild("Stats_Page"),
  235. "BONUS" : self.GetChild("Bonus_Page"),
  236. "SKILL" : self.GetChild("Skill_Page"),
  237. "EMOTICON" : self.GetChild("Emoticon_Page"),
  238. "QUEST" : self.GetChild("Quest_Page")
  239. }
  240.  
  241. self.titleBarDict = {
  242. "STATUS" : self.GetChild("Character_TitleBar"),
  243. "STATUS2" : self.GetChild("Stats_TitleBar"),
  244. "BONUS" : self.GetChild("Bonus_TitleBar"),
  245. "SKILL" : self.GetChild("Skill_TitleBar"),
  246. "EMOTICON" : self.GetChild("Emoticon_TitleBar"),
  247. "QUEST" : self.GetChild("Quest_TitleBar")
  248. }
  249.  
  250. self.statusPlusButtonDict = {
  251. "HTH" : self.GetChild("HTH_Plus"),
  252. "INT" : self.GetChild("INT_Plus"),
  253. "STR" : self.GetChild("STR_Plus"),
  254. "DEX" : self.GetChild("DEX_Plus"),
  255. }
  256.  
  257. self.statusMinusButtonDict = {
  258. "HTH-" : self.GetChild("HTH_Minus"),
  259. "INT-" : self.GetChild("INT_Minus"),
  260. "STR-" : self.GetChild("STR_Minus"),
  261. "DEX-" : self.GetChild("DEX_Minus"),
  262. }
  263.  
  264. self.skillPageDict = {
  265. "ACTIVE" : self.GetChild("Skill_Active_Slot"),
  266. "SUPPORT" : self.GetChild("Skill_ETC_Slot"),
  267. "HORSE" : self.GetChild("Skill_Active_Slot"),
  268. }
  269.  
  270. self.skillPageStatDict = {
  271. "SUPPORT" : player.SKILL_SUPPORT,
  272. "ACTIVE" : player.SKILL_ACTIVE,
  273. "HORSE" : player.SKILL_HORSE,
  274. }
  275.  
  276. self.skillGroupButton = (
  277. self.GetChild("Skill_Group_Button_1"),
  278. self.GetChild("Skill_Group_Button_2"),
  279. )
  280.  
  281.  
  282. global SHOW_ONLY_ACTIVE_SKILL
  283. global HIDE_SUPPORT_SKILL_POINT
  284.  
  285. self.soloEmotionSlot = self.GetChild("SoloEmotionSlot")
  286. self.dualEmotionSlot = self.GetChild("DualEmotionSlot")
  287. self.__SetEmotionSlot()
  288.  
  289. self.questShowingStartIndex = 0
  290. self.questScrollBar = self.GetChild("Quest_ScrollBar")
  291. self.questScrollBar.SetScrollEvent(ui.__mem_func__(self.OnQuestScroll))
  292. self.questSlot = self.GetChild("Quest_Slot")
  293. for i in xrange(quest.QUEST_MAX_NUM):
  294. self.questSlot.HideSlotBaseImage(i)
  295. self.questSlot.SetCoverButton(i,\
  296. "d:/ymir work/ui/game/quest/slot_button_01.sub",\
  297. "d:/ymir work/ui/game/quest/slot_button_02.sub",\
  298. "d:/ymir work/ui/game/quest/slot_button_03.sub",\
  299. "d:/ymir work/ui/game/quest/slot_button_03.sub", TRUE)
  300.  
  301. self.questNameList = []
  302. self.questLastTimeList = []
  303. self.questLastCountList = []
  304. for i in xrange(quest.QUEST_MAX_NUM):
  305. self.questNameList.append(self.GetChild("Quest_Name_0" + str(i)))
  306. self.questLastTimeList.append(self.GetChild("Quest_LastTime_0" + str(i)))
  307. self.questLastCountList.append(self.GetChild("Quest_LastCount_0" + str(i)))
  308.  
  309. self.Board_Caracteristicas = self.GetChild("Stats_Page")
  310. self.Board_Caracteristicas_Function()
  311. self.Board_Caracteristicas.Hide()
  312.  
  313. self.Board_Bonus_Function()
  314. # self.Board_Bonus_Function.Show()
  315.  
  316. # self.PercentExper = self.GetChild("PercentExp")
  317.  
  318. def Board_Caracteristicas_Function(self):
  319. self.C_Title = {}
  320. self.C_Slot = {}
  321. self.C_Slot_Number ={}
  322. self.C_Slot_Value ={}
  323. number_title_c = 0
  324. info_c=[
  325. [[30,45+12-10], [uiScriptLocale.MOV_SPEED]],
  326. [[30,45+12+30-12], [uiScriptLocale.ASPD_SPEED]],
  327. [[30,45+12+30+30-14], [uiScriptLocale.CSPD_SPEED]],
  328. [[30,45+12+30+30+30-16], [uiScriptLocale.MATT_SPEED]],
  329. [[30,45+12+30+30+30+30-18], [uiScriptLocale.ATT_GRADE]],
  330. [[30,45+12+30+30+30+30+30-20], [uiScriptLocale.MDEF_SPEED]],
  331. [[30,45+12+30+30+30+30+30+30-22], [uiScriptLocale.DEF_GRADE]],
  332. [[30,45+12+30+30+30+30+30+30+30-24],[uiScriptLocale.ER_SPEED]]
  333. ]
  334. for a in info_c:
  335. self.C_Title[number_title_c] = ui.TextLine()
  336. self.C_Title[number_title_c].SetParent(self.Board_Caracteristicas)
  337. self.C_Title[number_title_c].SetPosition(a[0][0],a[0][1])
  338. self.C_Title[number_title_c].SetText(a[1][0]+":")
  339. self.C_Title[number_title_c].SetPackedFontColor(0xffa08784)
  340. self.C_Title[number_title_c].Show()
  341.  
  342. self.C_Slot[number_title_c] = ui.ImageBox()
  343. self.C_Slot[number_title_c].SetParent(self.Board_Caracteristicas)
  344. self.C_Slot[number_title_c].LoadImage("d:/ymir work/interface/chenare/chenar1_small_s.tga")
  345. self.C_Slot[number_title_c].SetPosition(a[0][0]+115,a[0][1]-5)
  346. # self.C_Slot[number_title_c].MakeTitleBar(50+8)
  347. self.C_Slot[number_title_c].Show()
  348.  
  349. self.C_Slot_Number[number_title_c] = ui.TextLine()
  350. self.C_Slot_Number[number_title_c].SetParent(self.C_Slot[number_title_c])
  351. self.C_Slot_Number[number_title_c].SetPosition(23,6)
  352. self.C_Slot_Number[number_title_c].SetText("0")
  353. self.C_Slot_Number[number_title_c].SetHorizontalAlignCenter()
  354. self.C_Slot_Number[number_title_c].SetPackedFontColor(0xffa07970)
  355. self.C_Slot_Number[number_title_c].Show()
  356.  
  357. self.C_Slot_Value[number_title_c] = ui.TextLine()
  358. self.C_Slot_Value[number_title_c].SetParent(self.Board_Caracteristicas)
  359. self.C_Slot_Value[number_title_c].SetPosition(a[0][0]+200,a[0][1])
  360. self.C_Slot_Value[number_title_c].SetText("(|cffa08784%s|cffcaa76f +%s|cffa08784)"%(0,0))
  361. self.C_Slot_Value[number_title_c].SetHorizontalAlignCenter()
  362. self.C_Slot_Value[number_title_c].SetPackedFontColor(0xffa08784)
  363. self.C_Slot_Value[number_title_c].Show()
  364.  
  365. number_title_c +=1
  366.  
  367.  
  368. def Board_Bonus_Function(self):
  369. self.Board_Bonus ={}
  370. self.Board_Bonus_Slot ={}
  371. self.Board_Bonus_Image ={}
  372. self.Board_Bonus_Expander ={}
  373. self.Board_Bonus_Title ={}
  374. self.Board_Bonus_Search ={}
  375. number_title_b = 0
  376. info_b =[
  377. [[0,0],[uiScriptLocale.OFENSIVE_BONUSES]],
  378. [[0,45],[uiScriptLocale.DEFENSIVE_BONUSES]],
  379. [[0,45+49-4],[uiScriptLocale.ALTE_BONUSURI]]
  380. ]
  381. for e in info_b:
  382. self.Board_Bonus[number_title_b] = ui.NewBoard()
  383. self.Board_Bonus[number_title_b].SetParent(self.GetChild("BonusBoard"))
  384. self.Board_Bonus[number_title_b].SetPosition(e[0][0],e[0][1])
  385. self.Board_Bonus[number_title_b].SetSize(275,34-5)
  386. self.Board_Bonus[number_title_b].Show()
  387.  
  388. self.Board_Bonus_Image[number_title_b] = ui.ImageBox()
  389. self.Board_Bonus_Image[number_title_b].SetParent(self.Board_Bonus[number_title_b])
  390. self.Board_Bonus_Image[number_title_b].SetPosition(6,5)
  391. self.Board_Bonus_Image[number_title_b].LoadImage("d:/ymir work/interface/character/line.tga")
  392. self.Board_Bonus_Image[number_title_b].Show()
  393.  
  394. self.Board_Bonus_Expander[number_title_b] = ui.Button()
  395. self.Board_Bonus_Expander[number_title_b].SetParent(self.Board_Bonus_Image[number_title_b])
  396. self.Board_Bonus_Expander[number_title_b].SetPosition(6,5)
  397. self.Board_Bonus_Expander[number_title_b].SetUpVisual("d:/ymir work/interface/character/buttons/bonus_search_01_normal.tga")
  398. self.Board_Bonus_Expander[number_title_b].SetOverVisual("d:/ymir work/interface/character/buttons/bonus_search_02_hover.tga")
  399. self.Board_Bonus_Expander[number_title_b].SetDownVisual("d:/ymir work/interface/character/buttons/bonus_search_03_active.tga")
  400. self.Board_Bonus_Expander[number_title_b].Show()
  401.  
  402. self.Board_Bonus_Title[number_title_b] = ui.TextLine()
  403. self.Board_Bonus_Title[number_title_b].SetParent(self.Board_Bonus_Image[number_title_b])
  404. self.Board_Bonus_Title[number_title_b].SetPosition(48,12)
  405. self.Board_Bonus_Title[number_title_b].SetText(e[1][0])
  406. self.Board_Bonus_Title[number_title_b].SetPackedFontColor(0xffe6d0a2)
  407. self.Board_Bonus_Title[number_title_b].Show()
  408.  
  409. number_title_b += 1
  410.  
  411. self.Board_Bonus_s = ui.NewBoard()
  412. self.Board_Bonus_s.SetParent(self.GetChild("BonusBoard"))
  413. self.Board_Bonus_s.SetPosition(0,135)
  414. self.Board_Bonus_s.SetSize(275,140)
  415. self.Board_Bonus_s.Show()
  416.  
  417. self.Board_Bonus_Expander[0].SetEvent(lambda : self.Expander_Bonus_Functiones(0)) # 0-2 =1 , 1-1 =2 ,2 = 3
  418. self.Board_Bonus_Expander[1].SetEvent(lambda : self.Expander_Bonus_Functiones(1)) # 0-2 =1 , 1-1 =2 ,2 = 3
  419. self.Board_Bonus_Expander[2].SetEvent(lambda : self.Expander_Bonus_Functiones(2)) # 0-2 =1 , 1-1 =2 ,2 = 3
  420.  
  421. def Expander_Bonus_Functiones(self,number):
  422. global activado
  423. self.ContentBonus(number,activado)
  424. if number == 0:
  425. if activado == 0:
  426. self.Board_Bonus[number].SetSize(275,20+165)
  427. self.Board_Bonus[1].SetPosition(0,223-38)
  428. self.Board_Bonus[2].SetPosition(0,256-27)
  429. self.Board_Bonus_s.Hide()
  430. activado = 1
  431. else:
  432. self.Board_Bonus[number].SetSize(275,34)
  433. self.Board_Bonus[1].SetSize(275,25-5)
  434. self.Board_Bonus[1].SetPosition(0,10+37-2)
  435. self.Board_Bonus[2].SetSize(275,34-5)
  436. self.Board_Bonus[2].SetPosition(0,20+37+37-4)
  437. self.Board_Bonus_s.Show()
  438. activado = 0
  439.  
  440. if number == 1:
  441. if activado == 0:
  442. self.Board_Bonus[number].SetSize(275,20+165)
  443. self.Board_Bonus[2].SetPosition(0,257-27)
  444. self.Board_Bonus_s.Hide()
  445. activado = 1
  446. else:
  447. self.Board_Bonus[number].SetSize(275,34-5)
  448. self.Board_Bonus[number].SetPosition(0,12+37-4)
  449. self.Board_Bonus[0].SetSize(275,34-5)
  450. self.Board_Bonus[2].SetSize(275,34-5)
  451. self.Board_Bonus[2].SetPosition(0,20+37+37-4)
  452. self.Board_Bonus_s.Show()
  453. activado = 0
  454. if number == 2:
  455. if activado == 0:
  456. self.Board_Bonus[number].SetSize(275,20+165)
  457. self.Board_Bonus[2].SetPosition(0,20+37+37-4)
  458. self.Board_Bonus_s.Hide()
  459. activado = 1
  460. else:
  461. self.Board_Bonus[number].SetSize(275,34-5)
  462. self.Board_Bonus[number].SetPosition(0,12+37-4)
  463. self.Board_Bonus[0].SetSize(275,34-5)
  464. self.Board_Bonus[2].SetSize(275,34-5)
  465. self.Board_Bonus[2].SetPosition(0,20+37+37-4)
  466. self.Board_Bonus_s.Show()
  467. activado = 0
  468.  
  469. def ContentBonus(self,number,activacion):
  470. global isLoaded
  471. self.fileListBox = ui.ListBoxEx()
  472. self.fileListBox.SetParent(self.Board_Bonus[number])
  473. self.fileListBox.SetPosition(15, 45)
  474. self.fileListBox.SetViewItemCount(7)
  475. self.fileListBox.Show()
  476.  
  477. self.ScrollBar = ui.ScrollBarNewDesign_Character()
  478. self.ScrollBar.SetParent(self.Board_Bonus[number])
  479. self.ScrollBar.SetPosition(250, 45)
  480. self.ScrollBar.SetScrollBarSize(137)
  481. self.ScrollBar.SetScrollStep(0.6)
  482.  
  483. self.fileListBox.SetScrollBar(self.ScrollBar)
  484. self.ContenidoBonus(number)
  485. self.ContenidoBonus1()
  486.  
  487. if activacion == 0:
  488. isLoaded = 1
  489. self.fileListBox.Show()
  490. self.ScrollBar.Show()
  491. else:
  492. isLoaded = 0
  493. self.fileListBox.Hide()
  494. self.ScrollBar.Hide()
  495.  
  496. def ContenidoBonus(self,number):
  497. global number_on
  498. number_on = number
  499.  
  500.  
  501. def Functie_glisare_max(self):
  502. latime = self.GetChild("board").GetWidth()
  503. latime2 = self.GetChild("TabButtonsBoard").GetWidth()
  504. if latime < 467:
  505. latime = latime+2
  506. latime2 = latime2+2
  507. self.SetSize(latime,393)
  508. self.GetChild("board").SetSize(latime,393)
  509. self.GetChild("TabButtonsBoard").SetSize(latime2,350)
  510. self.GetChild("Skill_TitleBar").SetWidth(latime-15)
  511. self.GetChild("Emoticon_TitleBar").SetWidth(latime-15)
  512. self.GetChild("Quest_TitleBar").SetWidth(latime-15)
  513. self.GetChild("Stats_TitleBar").SetWidth(latime-15)
  514. self.GetChild("Character_TitleBar").SetWidth(latime-15)
  515. self.GetChild("Bonus_TitleBar").SetWidth(latime-15)
  516. self.GetChild("Expand").SetPosition(latime-15-70, 10)
  517. self.GetChild("Minimize").SetPosition(latime-15-70, 10)
  518. self.GetChild("TitleName").SetPosition(0, 12-192)
  519. self.glisare = WaitingDialog()
  520. self.glisare.Open(0.0)
  521. self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_max)
  522. else:
  523. self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  524. self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  525. self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  526. self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  527. self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  528. self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  529. self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  530. self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  531. self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  532. self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  533. self.TabButton6.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  534. self.TabButton6.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  535. if character == 1:
  536. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  537. else:
  538. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  539. if status == 1:
  540. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  541. else:
  542. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  543. if bonus == 1:
  544. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  545. else:
  546. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  547. if skills == 1:
  548. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  549. else:
  550. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  551. if emotions == 1:
  552. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  553. else:
  554. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  555. if quests == 1:
  556. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  557. else:
  558. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  559.  
  560. self.Button1Text.Show()
  561. self.Button2Text.Show()
  562. self.Button3Text.Show()
  563. self.Button4Text.Show()
  564. self.Button5Text.Show()
  565. self.Button6Text.Show()
  566. self.GetChild("Minimize").Show()
  567. self.GetChild("Expand").Hide()
  568.  
  569. def Functie_glisare_min(self):
  570. latime = self.GetChild("board").GetWidth()
  571. latime2 = self.GetChild("TabButtonsBoard").GetWidth()
  572. self.TabButton1.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  573. self.TabButton1.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  574. self.TabButton2.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  575. self.TabButton2.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  576. self.TabButton3.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  577. self.TabButton3.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  578. self.TabButton4.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  579. self.TabButton4.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  580. self.TabButton5.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  581. self.TabButton5.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  582. self.TabButton6.SetOverVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  583. self.TabButton6.SetDownVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  584. if character == 1:
  585. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  586. else:
  587. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  588. if status == 1:
  589. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  590. else:
  591. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  592. if bonus == 1:
  593. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  594. else:
  595. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  596. if skills == 1:
  597. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  598. else:
  599. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  600. if emotions == 1:
  601. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  602. else:
  603. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  604. if quests == 1:
  605. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  606. else:
  607. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  608. self.Button1Text.Hide()
  609. self.Button2Text.Hide()
  610. self.Button3Text.Hide()
  611. self.Button4Text.Hide()
  612. self.Button5Text.Hide()
  613. self.Button6Text.Hide()
  614. if latime>340:
  615. latime = latime-2
  616. latime2 = latime2-2
  617. self.SetSize(latime,393)
  618. self.GetChild("board").SetSize(latime,393)
  619. self.GetChild("TabButtonsBoard").SetSize(latime2,350)
  620. self.GetChild("Skill_TitleBar").SetWidth(latime-15)
  621. self.GetChild("Emoticon_TitleBar").SetWidth(latime-15)
  622. self.GetChild("Quest_TitleBar").SetWidth(latime-15)
  623. self.GetChild("Stats_TitleBar").SetWidth(latime-15)
  624. self.GetChild("Bonus_TitleBar").SetWidth(latime-15)
  625. self.GetChild("Character_TitleBar").SetWidth(latime-15)
  626. self.GetChild("Expand").SetPosition(latime-15-70, 10)
  627. self.GetChild("Minimize").SetPosition(latime-15-70, 10)
  628. self.GetChild("TitleName").SetPosition(0, 12-192)
  629. self.glisare = WaitingDialog()
  630. self.glisare.Open(0.0)
  631. self.glisare.SAFE_SetTimeOverEvent(self.Functie_glisare_min)
  632. else:
  633. self.GetChild("Expand").Show()
  634. self.GetChild("Minimize").Hide()
  635.  
  636.  
  637. def __SetSkillSlotEvent(self):
  638. for skillPageValue in self.skillPageDict.itervalues():
  639. skillPageValue.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  640. skillPageValue.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectSkill))
  641. skillPageValue.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
  642. skillPageValue.SetUnselectItemSlotEvent(ui.__mem_func__(self.ClickSkillSlot))
  643. skillPageValue.SetUseSlotEvent(ui.__mem_func__(self.ClickSkillSlot))
  644. skillPageValue.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  645. skillPageValue.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  646. skillPageValue.SetPressedSlotButtonEvent(ui.__mem_func__(self.OnPressedSlotButton))
  647. skillPageValue.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
  648. "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
  649. "d:/ymir work/ui/game/windows/btn_plus_down.sub")
  650.  
  651. def __SetEmotionSlot(self):
  652.  
  653. self.emotionToolTip = uiToolTip.ToolTip()
  654.  
  655. for slot in (self.soloEmotionSlot, self.dualEmotionSlot):
  656. slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  657. slot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectEmotion))
  658. slot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot))
  659. slot.SetUseSlotEvent(ui.__mem_func__(self.__ClickEmotionSlot))
  660. slot.SetOverInItemEvent(ui.__mem_func__(self.__OverInEmotion))
  661. slot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutEmotion))
  662. slot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
  663. "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
  664. "d:/ymir work/ui/game/windows/btn_plus_down.sub")
  665.  
  666. for slotIdx, datadict in emotion.EMOTION_DICT.items():
  667. emotionIdx = slotIdx
  668.  
  669. slot = self.soloEmotionSlot
  670. if slotIdx > 50:
  671. slot = self.dualEmotionSlot
  672.  
  673. slot.SetEmotionSlot(slotIdx, emotionIdx)
  674. slot.SetCoverButton(slotIdx)
  675.  
  676. def __SelectEmotion(self, slotIndex):
  677. if not slotIndex in emotion.EMOTION_DICT:
  678. return
  679.  
  680. if app.IsPressed(app.DIK_LCONTROL):
  681. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_EMOTION, slotIndex)
  682. return
  683.  
  684. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EMOTION, slotIndex, slotIndex)
  685.  
  686. def __ClickEmotionSlot(self, slotIndex):
  687. print "click emotion"
  688. if not slotIndex in emotion.EMOTION_DICT:
  689. return
  690.  
  691. print "check acting"
  692. if player.IsActingEmotion():
  693. return
  694.  
  695. command = emotion.EMOTION_DICT[slotIndex]["command"]
  696. print "command", command
  697.  
  698. if slotIndex > 50:
  699. vid = player.GetTargetVID()
  700.  
  701. if 0 == vid or vid == player.GetMainCharacterIndex() or chr.IsNPC(vid) or chr.IsEnemy(vid):
  702. import chat
  703. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.EMOTION_CHOOSE_ONE)
  704. return
  705.  
  706. command += " " + chr.GetNameByVID(vid)
  707.  
  708. print "send_command", command
  709. net.SendChatPacket(command)
  710.  
  711. def ActEmotion(self, emotionIndex):
  712. self.__ClickEmotionSlot(emotionIndex)
  713.  
  714. def __OverInEmotion(self, slotIndex):
  715. if self.emotionToolTip:
  716.  
  717. if not slotIndex in emotion.EMOTION_DICT:
  718. return
  719.  
  720. self.emotionToolTip.ClearToolTip()
  721. self.emotionToolTip.SetTitle(emotion.EMOTION_DICT[slotIndex]["name"])
  722. self.emotionToolTip.AlignHorizonalCenter()
  723. self.emotionToolTip.ShowToolTip()
  724.  
  725. def __OverOutEmotion(self):
  726. if self.emotionToolTip:
  727. self.emotionToolTip.HideToolTip()
  728.  
  729. def ContenidoBonus1(self):
  730. global isLoaded
  731. global number_on
  732. if number_on == 0:
  733. world = 0
  734. self.Bonusuri_ofensive_val = [
  735. 63,
  736. 64,
  737. 43,
  738. 54,
  739. 55,
  740. 56,
  741. 57,
  742. 53,
  743. 47,
  744. 48,
  745. 37,
  746. 38,
  747. 39,
  748. 40,
  749. 41
  750. ]
  751. self.Bonusuri_ofensive_nume = [
  752. uiScriptLocale.TOOLTIP_APPLY_STEAL_HP,
  753. uiScriptLocale.TOOLTIP_APPLY_STEAL_SP,
  754. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  755. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  756. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  757. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_SURA,
  758. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  759. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  760. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  761. uiScriptLocale.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  762. uiScriptLocale.TOOLTIP_APPLY_POISON_PCT,
  763. uiScriptLocale.TOOLTIP_APPLY_STUN_PCT,
  764. uiScriptLocale.TOOLTIP_APPLY_SLOW_PCT,
  765. uiScriptLocale.TOOLTIP_APPLY_CRITICAL_PCT,
  766. uiScriptLocale.TOOLTIP_APPLY_PENETRATE_PCT
  767. ]
  768.  
  769. for i in self.Bonusuri_ofensive_nume:
  770. self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_ofensive_val[world])),"%" ))) #"|cffa08784"+str(i))
  771. world = world + 1
  772.  
  773. self.Bonusuri_defensive_val = [
  774. 59,
  775. 60,
  776. 61,
  777. 62,
  778. 69,
  779. 70,
  780. 71,
  781. 74,
  782. 73,
  783. 72,
  784. 77,
  785. 67,
  786. 79,
  787. 68
  788. ]
  789. self.Bonusuri_defensive_nume = [
  790. uiScriptLocale.TOOLTIP_APPLY_RESIST_WARRIOR,
  791. uiScriptLocale.TOOLTIP_APPLY_RESIST_ASSASSIN,
  792. uiScriptLocale.TOOLTIP_APPLY_RESIST_SURA,
  793. uiScriptLocale.TOOLTIP_APPLY_RESIST_SHAMAN,
  794. uiScriptLocale.TOOLTIP_APPLY_RESIST_SWORD,
  795. uiScriptLocale.TOOLTIP_APPLY_RESIST_TWOHAND,
  796. uiScriptLocale.TOOLTIP_APPLY_RESIST_DAGGER,
  797. uiScriptLocale.TOOLTIP_RESIST_BOW,
  798. uiScriptLocale.TOOLTIP_APPLY_RESIST_FAN,
  799. uiScriptLocale.TOOLTIP_APPLY_RESIST_BELL,
  800. uiScriptLocale.TOOLTIP_RESIST_MAGIC,
  801. uiScriptLocale.TOOLTIP_APPLY_BLOCK,
  802. uiScriptLocale.TOOLTIP_APPLY_REFLECT_MELEE,
  803. uiScriptLocale.TOOLTIP_APPLY_DODGE
  804. ]
  805.  
  806. if number_on == 1:
  807. world = 0
  808. for i in self.Bonusuri_defensive_nume:
  809. self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_defensive_val[world])),"%" ))) #"|cffa08784"+str(i))
  810. world = world + 1
  811.  
  812. self.Bonusuri_alte_val = [
  813. 32,
  814. 33
  815. ]
  816. self.Bonusuri_alte_nume = [
  817. uiScriptLocale.TOOLTIP_HP_REGEN,
  818. uiScriptLocale.TOOLTIP_SP_REGEN,
  819. ]
  820.  
  821. if number_on == 2:
  822. world = 0
  823. for i in self.Bonusuri_alte_nume:
  824. # self.fileListBox = ui.ListBoxEx()
  825. self.fileListBox.AppendItem(Item("|cffa08784 %s |cffcaa76f %s%s "% (i+":",player.GetStatus(int(self.Bonusuri_alte_val[world])),"%" ))) #"|cffa08784"+str(i))
  826. world = world + 1
  827.  
  828. def __BindEvent(self):
  829. for i in xrange(len(self.skillGroupButton)):
  830. self.skillGroupButton[i].SetEvent(lambda arg=i: self.__SelectSkillGroup(arg))
  831.  
  832. self.RefreshQuest()
  833. self.__HideJobToolTip()
  834.  
  835. for (tabKey, tabButton) in self.tabButtonDict.items():
  836. tabButton.SetEvent(ui.__mem_func__(self.__OnClickTabButton), tabKey)
  837.  
  838. for (statusPlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
  839. statusPlusButton.SAFE_SetEvent(self.__OnClickStatusPlusButton, statusPlusKey)
  840. statusPlusButton.ShowToolTip = lambda arg=statusPlusKey: self.__OverInStatButton(arg)
  841. statusPlusButton.HideToolTip = lambda arg=statusPlusKey: self.__OverOutStatButton()
  842.  
  843. for (statusMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
  844. statusMinusButton.SAFE_SetEvent(self.__OnClickStatusMinusButton, statusMinusKey)
  845. statusMinusButton.ShowToolTip = lambda arg=statusMinusKey: self.__OverInStatMinusButton(arg)
  846. statusMinusButton.HideToolTip = lambda arg=statusMinusKey: self.__OverOutStatMinusButton()
  847.  
  848. for titleBarValue in self.titleBarDict.itervalues():
  849. titleBarValue.SetCloseEvent(ui.__mem_func__(self.Hide))
  850.  
  851. self.questSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectQuest))
  852.  
  853. def __LoadWindow(self):
  854. if self.isLoaded == 1:
  855. return
  856.  
  857. self.isLoaded = 1
  858.  
  859. try:
  860. if localeInfo.IsARABIC() or localeInfo.IsVIETNAM() or localeInfo.IsJAPAN():
  861. self.__LoadScript("uiscript/CharacterWindow.py")
  862. else:
  863. self.__LoadScript("uiscript/CharacterWindow.py")
  864.  
  865. self.__BindObject()
  866. self.__BindEvent()
  867. except:
  868. import exception
  869. exception.Abort("CharacterWindow.__LoadWindow")
  870.  
  871. #self.tabButtonDict["EMOTICON"].Disable()
  872. self.SetState("STATUS")
  873.  
  874. def Refreshing(self):
  875. if self.isLoaded == 0:
  876. try:
  877. self.__LoadScript("uiscript/CharacterWindow.py")
  878. except:
  879. import exception
  880. exception.Abort("CharacterWindow.__LoadWindow")
  881.  
  882. curPoint = unsigned32(player.GetStatus(player.EXP))
  883. maxPoint = unsigned32(player.GetStatus(player.NEXT_EXP))
  884.  
  885. curPoint = min(curPoint, maxPoint)
  886. curPoint = max(curPoint, 0)
  887. maxPoint = max(maxPoint, 0)
  888. self.GetChild("PercentExp").SetText("%s %.2f%%" % ("", float(curPoint) / max(1, float(maxPoint)) * 100))
  889.  
  890. self.GetChild("LevelText").SetText("|cfff8d090"+str(player.GetStatus(player.LEVEL)))
  891. self.GetChild("PlayerExp").SetText("EXP:"+str(curPoint))
  892. self.GetChild("NextLvlExp").SetText(uiScriptLocale.CHARACTER_FROM + " " + str(maxPoint))
  893.  
  894. #---------------------------
  895. curEXP = unsigned32(player.GetStatus(player.EXP))
  896. nextEXP = unsigned32(player.GetStatus(player.NEXT_EXP))
  897. self.SetExperience(curEXP, nextEXP)
  898.  
  899.  
  900. self.GetChild("PlayerHpText").SetText("|cffa07970"+str(player.GetStatus(player.HP)) + '/' + str(player.GetStatus(player.MAX_HP)))
  901. self.GetChild("PlayerPeText").SetText("|cffa07970"+str(player.GetStatus(player.SP)) + '/' + str(player.GetStatus(player.MAX_SP)))
  902.  
  903. self.GetChild("StrPointsText").SetText("|cffa07970"+str(player.GetStatus(player.ST)))
  904. self.GetChild("ZrePointsText").SetText("|cffa07970"+str(player.GetStatus(player.DX)))
  905. self.GetChild("WitPointsText").SetText("|cffa07970"+str(player.GetStatus(player.HT)))
  906. self.GetChild("IntPointsText").SetText("|cffa07970"+str(player.GetStatus(player.IQ)))
  907.  
  908. self.GetChild("StatusPoints").SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+"[|cfff8d090"+str(player.GetStatus(player.STAT))+"|cffa08784]")
  909.  
  910.  
  911. #self.__RefreshStatusPlusButtonList()
  912. #self.__RefreshStatusMinusButtonList()
  913. #self.RefreshCharacter()
  914.  
  915. #self.RefreshSkill()
  916. #self.RefreshSkillPlusButtonList()
  917.  
  918. self.ref = WaitingDialog()
  919. self.ref.Open(0.1)
  920. self.ref.SAFE_SetTimeOverEvent(self.Refreshing)
  921.  
  922.  
  923. def Destroy(self):
  924. self.ClearDictionary()
  925.  
  926. self.__Initialize()
  927.  
  928. def Close(self):
  929. if 0 != self.toolTipSkill:
  930. self.toolTipSkill.Hide()
  931.  
  932. self.Hide()
  933.  
  934. def SetSkillToolTip(self, toolTipSkill):
  935. self.toolTipSkill = toolTipSkill
  936.  
  937. def __OnClickStatusPlusButton(self, statusKey):
  938. try:
  939. statusPlusCommand=self.statusPlusCommandDict[statusKey]
  940. net.SendChatPacket(statusPlusCommand)
  941. except KeyError, msg:
  942. dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg)
  943.  
  944. def __OnClickStatusMinusButton(self, statusKey):
  945. try:
  946. statusMinusCommand=self.statusMinusCommandDict[statusKey]
  947. net.SendChatPacket(statusMinusCommand)
  948. except KeyError, msg:
  949. dbg.TraceError("CharacterWindow.__OnClickStatusMinusButton KeyError: %s", msg)
  950.  
  951.  
  952. def __OnClickTabButton(self, stateKey):
  953. global character,status,bonus,skills,emotions,quests
  954. latime = self.GetWidth()
  955. if stateKey == "STATUS":
  956. character = 1
  957. status = 0
  958. bonus = 0
  959. skills = 0
  960. emotions = 0
  961. quests = 0
  962. if latime == 468:
  963. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  964. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  965. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  966. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  967. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  968. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  969. self.Button1Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_MAIN)
  970. self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
  971. self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
  972. self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
  973. self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
  974. self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
  975. else:
  976. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  977. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  978. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  979. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  980. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  981. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  982. if stateKey == "STATUS2":
  983. character = 0
  984. status = 1
  985. bonus = 0
  986. skills = 0
  987. emotions = 0
  988. quests = 0
  989. if latime == 468:
  990. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  991. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  992. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  993. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  994. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  995. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  996. self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
  997. self.Button2Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_STATS)
  998. self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
  999. self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
  1000. self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
  1001. self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
  1002. else:
  1003. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1004. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  1005. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1006. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1007. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1008. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1009. if stateKey == "BONUS":
  1010. character = 0
  1011. status = 0
  1012. bonus = 1
  1013. skills = 0
  1014. emotions = 0
  1015. quests = 0
  1016. if latime == 468:
  1017. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1018. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1019. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  1020. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1021. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1022. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1023. self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
  1024. self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
  1025. self.Button3Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_BONUS)
  1026. self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
  1027. self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
  1028. self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
  1029. else:
  1030. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1031. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1032. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  1033. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1034. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1035. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1036. if stateKey == "SKILL":
  1037. character = 0
  1038. status = 0
  1039. bonus = 0
  1040. skills = 1
  1041. emotions = 0
  1042. quests = 0
  1043. if latime == 468:
  1044. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1045. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1046. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1047. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  1048. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1049. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1050. self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
  1051. self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
  1052. self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
  1053. self.Button4Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_SKILL)
  1054. self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
  1055. self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
  1056. else:
  1057. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1058. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1059. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1060. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  1061. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1062. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1063. if stateKey == "EMOTICON":
  1064. character = 0
  1065. status = 0
  1066. bonus = 0
  1067. skills = 0
  1068. emotions = 1
  1069. quests = 0
  1070. if latime == 468:
  1071. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1072. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1073. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1074. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1075. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  1076. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1077. self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
  1078. self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
  1079. self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
  1080. self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
  1081. self.Button5Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_ACTION)
  1082. self.Button6Text.SetText(uiScriptLocale.CHARACTER_QUEST)
  1083. else:
  1084. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1085. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1086. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1087. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1088. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  1089. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1090. if stateKey == "QUEST":
  1091. character = 0
  1092. status = 0
  1093. bonus = 0
  1094. skills = 0
  1095. emotions = 0
  1096. quests = 1
  1097. if latime == 468:
  1098. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1099. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1100. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1101. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1102. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_n.tga")
  1103. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_big_a.tga")
  1104. self.Button1Text.SetText(uiScriptLocale.CHARACTER_MAIN)
  1105. self.Button2Text.SetText(uiScriptLocale.CHARACTER_STATS)
  1106. self.Button3Text.SetText(uiScriptLocale.CHARACTER_BONUS)
  1107. self.Button4Text.SetText(uiScriptLocale.CHARACTER_SKILL)
  1108. self.Button5Text.SetText(uiScriptLocale.CHARACTER_ACTION)
  1109. self.Button6Text.SetText("|cfff8d090"+uiScriptLocale.CHARACTER_QUEST)
  1110. else:
  1111. self.TabButton1.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1112. self.TabButton2.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1113. self.TabButton3.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1114. self.TabButton4.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1115. self.TabButton5.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_n.tga")
  1116. self.TabButton6.SetUpVisual("d:/ymir work/interface/expand_system/chrbutton_small_a.tga")
  1117. self.SetState(stateKey)
  1118.  
  1119. #
  1120. def SetState(self, stateKey):
  1121. self.state = stateKey
  1122.  
  1123. for (tabKey, tabButton) in self.tabButtonDict.items():
  1124. if stateKey!=tabKey:
  1125. tabButton.SetUp()
  1126. for pageValue in self.pageDict.itervalues():
  1127. pageValue.Hide()
  1128. for titleBarValue in self.titleBarDict.itervalues():
  1129. titleBarValue.Hide()
  1130.  
  1131. self.titleBarDict[stateKey].Show()
  1132. self.pageDict[stateKey].Show()
  1133.  
  1134.  
  1135. def GetState(self):
  1136. return self.state
  1137.  
  1138. def __GetTotalAtkText(self):
  1139. minAtk=player.GetStatus(player.ATT_MIN)
  1140. maxAtk=player.GetStatus(player.ATT_MAX)
  1141. atkBonus=player.GetStatus(player.ATT_BONUS)
  1142. attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
  1143.  
  1144. if minAtk==maxAtk:
  1145. return "%d" % (minAtk+atkBonus+attackerBonus)
  1146. else:
  1147. return "%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus)
  1148.  
  1149. def __GetTotalMagAtkText(self):
  1150. minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP)
  1151. maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP)
  1152.  
  1153. if minMagAtk==maxMagAtk:
  1154. return "%d" % (minMagAtk)
  1155. else:
  1156. return "%d-%d" % (minMagAtk, maxMagAtk)
  1157.  
  1158. def __GetTotalDefText(self):
  1159. defValue=player.GetStatus(player.DEF_GRADE)
  1160. if constInfo.ADD_DEF_BONUS_ENABLE:
  1161. defValue+=player.GetStatus(player.DEF_BONUS)
  1162. return "%d" % (defValue)
  1163.  
  1164. def RefreshStatus(self):
  1165. self.__RefreshStatusPlusButtonList()
  1166. self.__RefreshStatusMinusButtonList()
  1167. self.RefreshAlignment()
  1168.  
  1169. if self.refreshToolTip:
  1170. self.refreshToolTip()
  1171.  
  1172. def RefreshCaracteristics(self):
  1173. minAtk=player.GetStatus(player.ATT_MIN)
  1174. maxAtk=player.GetStatus(player.ATT_MAX)
  1175. atkBonus=player.GetStatus(player.ATT_BONUS)
  1176. attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
  1177.  
  1178.  
  1179. self.C_Slot_Number[0].SetText(str(player.GetStatus(player.MOVING_SPEED)))
  1180. self.C_Slot_Number[1].SetText(str(player.GetStatus(player.ATT_SPEED)))
  1181. self.C_Slot_Number[2].SetText(str(player.GetStatus(player.CASTING_SPEED)))
  1182. self.C_Slot_Number[4].SetText(str(player.GetStatus(player.MAG_DEF)))
  1183. self.C_Slot_Number[5].SetText(str(player.GetStatus(player.EVADE_RATE)))
  1184.  
  1185. minAtk=player.GetStatus(player.ATT_MIN)
  1186. maxAtk=player.GetStatus(player.ATT_MAX)
  1187. atkBonus=player.GetStatus(player.ATT_BONUS)
  1188. attackerBonus=player.GetStatus(player.ATTACKER_BONUS)
  1189.  
  1190. if minAtk==maxAtk:
  1191. self.C_Slot_Number[6].SetText("%d" % (minAtk+atkBonus+attackerBonus))
  1192. else:
  1193. self.C_Slot_Number[6].SetText("%d-%d" % (minAtk+atkBonus+attackerBonus, maxAtk+atkBonus+attackerBonus))
  1194.  
  1195. minMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MIN_MAGIC_WEP)
  1196. maxMagAtk=player.GetStatus(player.MAG_ATT)+player.GetStatus(player.MAX_MAGIC_WEP)
  1197.  
  1198. if minMagAtk==maxMagAtk:
  1199. self.C_Slot_Number[3].SetText("%d" % (minMagAtk))
  1200. else:
  1201. self.C_Slot_Number[3].SetText("%d-%d" % (minMagAtk, maxMagAtk))
  1202.  
  1203. defValue=player.GetStatus(player.DEF_GRADE)
  1204. if constInfo.ADD_DEF_BONUS_ENABLE:
  1205. defValue+=player.GetStatus(player.DEF_BONUS)
  1206. self.C_Slot_Number[7].SetText("%d" % (defValue))
  1207.  
  1208. Test_Poits = [player.GetStatus(player.MOVING_SPEED),player.GetStatus(player.ATT_SPEED),player.GetStatus(player.CASTING_SPEED),
  1209. minMagAtk,player.GetStatus(player.MAG_DEF),player.GetStatus(player.EVADE_RATE),minAtk+atkBonus+attackerBonus,defValue]
  1210. #Test_Poits_1 =[0,1,]
  1211.  
  1212. race = net.GetMainActorRace()
  1213. group = net.GetMainActorSkillGroup()
  1214. empire = net.GetMainActorEmpire()
  1215.  
  1216. job = chr.RaceToJob(race)
  1217. if job == 0:
  1218. Test_Poits_2= [100,100,100,8,5,3,10,5]
  1219. if job == 1:
  1220. Test_Poits_2= [100,100,100,8,5,5,8,4]
  1221. if job == 2:
  1222. Test_Poits_2= [100,100,100,12,7,3,9,4]
  1223. if job == 3:
  1224. Test_Poits_2= [100,100,100,14,8,3,7,5]
  1225. if job == 4:
  1226. Test_Poits_2= [100,100,100,8,5,5,8,4]
  1227.  
  1228. #bonemas = player.GetStatus(player.MOVING_SPEED)
  1229. #count_m = 100-player.GetStatus(player.MOVING_SPEED)
  1230. for i in xrange(0,8):
  1231. #count_m = str(i)
  1232. if Test_Poits[i] == Test_Poits_2[i]:
  1233. self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f +%s|cffa08784)"%(Test_Poits_2[i],0))
  1234. if Test_Poits[i] > Test_Poits_2[i]:
  1235. 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("-","+")))
  1236. #self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f %s|cffa08784)"%(100,str(count_m).replace("-","+")))
  1237. if Test_Poits[i] < Test_Poits_2[i]:
  1238. self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f -%s|cffa08784)"%(str(Test_Poits_2[i]),str(Test_Poits_2[i]-Test_Poits[i])))
  1239. #self.C_Slot_Value[i].SetText("(|cffa08784%s|cffcaa76f -%s|cffa08784)"%(100,str(count_m)))
  1240.  
  1241.  
  1242.  
  1243.  
  1244. def __RefreshStatusPlusButtonList(self):
  1245. statusPlusPoint=player.GetStatus(player.STAT)
  1246.  
  1247. if statusPlusPoint>0:
  1248. self.ShowStatusPlusButtonList()
  1249. else:
  1250. self.HideStatusPlusButtonList()
  1251.  
  1252. def __RefreshStatusMinusButtonList(self):
  1253. statusMinusPoint=self.__GetStatMinusPoint()
  1254.  
  1255. if statusMinusPoint>0:
  1256. self.__ShowStatusMinusButtonList()
  1257. else:
  1258. self.__HideStatusMinusButtonList()
  1259.  
  1260. def RefreshAlignment(self):
  1261. point, grade = player.GetAlignmentData()
  1262.  
  1263. import colorInfo
  1264. COLOR_DICT = { 0 : colorInfo.TITLE_RGB_GOOD_4,
  1265. 1 : colorInfo.TITLE_RGB_GOOD_3,
  1266. 2 : colorInfo.TITLE_RGB_GOOD_2,
  1267. 3 : colorInfo.TITLE_RGB_GOOD_1,
  1268. 4 : colorInfo.TITLE_RGB_NORMAL,
  1269. 5 : colorInfo.TITLE_RGB_EVIL_1,
  1270. 6 : colorInfo.TITLE_RGB_EVIL_2,
  1271. 7 : colorInfo.TITLE_RGB_EVIL_3,
  1272. 8 : colorInfo.TITLE_RGB_EVIL_4, }
  1273. colorList = COLOR_DICT.get(grade, colorInfo.TITLE_RGB_NORMAL)
  1274. gradeColor = ui.GenerateColor(colorList[0], colorList[1], colorList[2])
  1275.  
  1276. self.toolTipAlignment.ClearToolTip()
  1277. self.toolTipAlignment.AutoAppendTextLine(localeInfo.TITLE_NAME_LIST[grade], gradeColor)
  1278. self.toolTipAlignment.AutoAppendTextLine(localeInfo.ALIGNMENT_NAME + str(point))
  1279. self.toolTipAlignment.AlignHorizonalCenter()
  1280.  
  1281. def __ShowStatusMinusButtonList(self):
  1282. for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
  1283. statusMinusButton.Show()
  1284.  
  1285. def __HideStatusMinusButtonList(self):
  1286. for (stateMinusKey, statusMinusButton) in self.statusMinusButtonDict.items():
  1287. statusMinusButton.Hide()
  1288.  
  1289. def ShowStatusPlusButtonList(self):
  1290. for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
  1291. statusPlusButton.Show()
  1292.  
  1293. def HideStatusPlusButtonList(self):
  1294. for (statePlusKey, statusPlusButton) in self.statusPlusButtonDict.items():
  1295. statusPlusButton.Hide()
  1296.  
  1297. def SelectSkill(self, skillSlotIndex):
  1298.  
  1299. mouseController = mouseModule.mouseController
  1300.  
  1301. if FALSE == mouseController.isAttached():
  1302.  
  1303. srcSlotIndex = self.__RealSkillSlotToSourceSlot(skillSlotIndex)
  1304. selectedSkillIndex = player.GetSkillIndex(srcSlotIndex)
  1305.  
  1306. if skill.CanUseSkill(selectedSkillIndex):
  1307.  
  1308. if app.IsPressed(app.DIK_LCONTROL):
  1309.  
  1310. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, srcSlotIndex)
  1311. return
  1312.  
  1313. mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, srcSlotIndex, selectedSkillIndex)
  1314.  
  1315. else:
  1316.  
  1317. mouseController.DeattachObject()
  1318.  
  1319. def SelectEmptySlot(self, SlotIndex):
  1320. mouseModule.mouseController.DeattachObject()
  1321.  
  1322. ## ToolTip
  1323. def OverInItem(self, slotNumber):
  1324.  
  1325. if mouseModule.mouseController.isAttached():
  1326. return
  1327.  
  1328. if 0 == self.toolTipSkill:
  1329. return
  1330.  
  1331. srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber)
  1332. skillIndex = player.GetSkillIndex(srcSlotIndex)
  1333. skillLevel = player.GetSkillLevel(srcSlotIndex)
  1334. skillGrade = player.GetSkillGrade(srcSlotIndex)
  1335. skillType = skill.GetSkillType(skillIndex)
  1336.  
  1337. ## ACTIVE
  1338. if skill.SKILL_TYPE_ACTIVE == skillType:
  1339. overInSkillGrade = self.__GetSkillGradeFromSlot(slotNumber)
  1340.  
  1341. if overInSkillGrade == skill.SKILL_GRADE_COUNT-1 and skillGrade == skill.SKILL_GRADE_COUNT:
  1342. self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel)
  1343. elif overInSkillGrade == skillGrade:
  1344. self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, overInSkillGrade, skillLevel)
  1345. else:
  1346. self.toolTipSkill.SetSkillOnlyName(srcSlotIndex, skillIndex, overInSkillGrade)
  1347.  
  1348. else:
  1349. self.toolTipSkill.SetSkillNew(srcSlotIndex, skillIndex, skillGrade, skillLevel)
  1350.  
  1351. def OverOutItem(self):
  1352. if 0 != self.toolTipSkill:
  1353. self.toolTipSkill.HideToolTip()
  1354.  
  1355. ## Quest
  1356. def __SelectQuest(self, slotIndex):
  1357. questIndex = quest.GetQuestIndex(self.questShowingStartIndex+slotIndex)
  1358.  
  1359. import event
  1360. event.QuestButtonClick(-2147483648 + questIndex)
  1361.  
  1362. def RefreshQuest(self):
  1363.  
  1364. if self.isLoaded==0:
  1365. return
  1366.  
  1367. questCount = quest.GetQuestCount()
  1368. questRange = range(quest.QUEST_MAX_NUM)
  1369.  
  1370. if questCount > quest.QUEST_MAX_NUM:
  1371. self.questScrollBar.Show()
  1372. else:
  1373. self.questScrollBar.Hide()
  1374.  
  1375. for i in questRange[:questCount]:
  1376. (questName, questIcon, questCounterName, questCounterValue) = quest.GetQuestData(self.questShowingStartIndex+i)
  1377.  
  1378. if questName[0] == '*':
  1379. questName = questName[1:]
  1380. elif questName[0] == '&':
  1381. questName = questName[1:]
  1382. elif questName[0] == '~':
  1383. questName = questName[1:]
  1384. elif questName[0] == '+':
  1385. questName = questName[1:]
  1386.  
  1387. self.questNameList[i].SetText(questName)
  1388. self.questNameList[i].Show()
  1389. self.questLastCountList[i].Show()
  1390. self.questLastTimeList[i].Show()
  1391.  
  1392. if len(questCounterName) > 0:
  1393. self.questLastCountList[i].SetText("%s : %d" % (questCounterName, questCounterValue))
  1394. else:
  1395. self.questLastCountList[i].SetText("")
  1396.  
  1397. ## Icon
  1398. self.questSlot.SetSlot(i, i, 1, 1, questIcon)
  1399.  
  1400. for i in questRange[questCount:]:
  1401. self.questNameList[i].Hide()
  1402. self.questLastTimeList[i].Hide()
  1403. self.questLastCountList[i].Hide()
  1404. self.questSlot.ClearSlot(i)
  1405. self.questSlot.HideSlotBaseImage(i)
  1406.  
  1407. self.__UpdateQuestClock()
  1408.  
  1409. def __UpdateQuestClock(self):
  1410. # QUEST_LIMIT_COUNT_BUG_FIX
  1411. for i in xrange(min(quest.GetQuestCount(), quest.QUEST_MAX_NUM)):
  1412. # END_OF_QUEST_LIMIT_COUNT_BUG_FIX
  1413. (lastName, lastTime) = quest.GetQuestLastTime(i)
  1414.  
  1415. clockText = localeInfo.QUEST_UNLIMITED_TIME
  1416. if len(lastName) > 0:
  1417.  
  1418. if lastTime <= 0:
  1419. clockText = localeInfo.QUEST_TIMEOVER
  1420.  
  1421. else:
  1422. questLastMinute = lastTime / 60
  1423. questLastSecond = lastTime % 60
  1424.  
  1425. clockText = lastName + " : "
  1426.  
  1427. if questLastMinute > 0:
  1428. clockText += str(questLastMinute) + localeInfo.QUEST_MIN
  1429. if questLastSecond > 0:
  1430. clockText += " "
  1431.  
  1432. if questLastSecond > 0:
  1433. clockText += str(questLastSecond) + localeInfo.QUEST_SEC
  1434.  
  1435. self.questLastTimeList[i].SetText(clockText)
  1436.  
  1437.  
  1438. ###------Experience
  1439. def SetExperience(self, curPoint, maxPoint):
  1440. curPoint = min(curPoint, maxPoint)
  1441. if maxPoint > 0:
  1442. self.GetChild("ExpImgFull").SetPercentage(curPoint, maxPoint)
  1443.  
  1444. def __GetStatMinusPoint(self):
  1445. POINT_STAT_RESET_COUNT = 112
  1446. return player.GetStatus(POINT_STAT_RESET_COUNT)
  1447.  
  1448. def __OverInStatMinusButton(self, stat):
  1449. try:
  1450. self.__ShowStatToolTip(self.STAT_MINUS_DESCRIPTION[stat] % self.__GetStatMinusPoint())
  1451. except KeyError:
  1452. pass
  1453.  
  1454. self.refreshToolTip = lambda arg=stat: self.__OverInStatMinusButton(arg)
  1455.  
  1456. def __OverOutStatMinusButton(self):
  1457. self.__HideStatToolTip()
  1458. self.refreshToolTip = 0
  1459.  
  1460. def __OverInStatButton(self, stat):
  1461. try:
  1462. self.__ShowStatToolTip(self.STAT_DESCRIPTION[stat])
  1463. except KeyError:
  1464. pass
  1465.  
  1466. def __OverOutStatButton(self):
  1467. self.__HideStatToolTip()
  1468.  
  1469. def __ShowStatToolTip(self, statDesc):
  1470. self.toolTip.ClearToolTip()
  1471. self.toolTip.AppendTextLine(statDesc)
  1472. self.toolTip.Show()
  1473.  
  1474. def __HideStatToolTip(self):
  1475. self.toolTip.Hide()
  1476.  
  1477. def OnPressEscapeKey(self):
  1478. self.Close()
  1479. return TRUE
  1480.  
  1481. def OnUpdate(self):
  1482. self.ContenidoBonus1()
  1483. self.RefreshCaracteristics()
  1484. self.__UpdateQuestClock()
  1485.  
  1486. ## Skill Process
  1487. def __RefreshSkillPage(self, name, slotCount):
  1488. global SHOW_LIMIT_SUPPORT_SKILL_LIST
  1489.  
  1490. skillPage = self.skillPageDict[name]
  1491.  
  1492. startSlotIndex = skillPage.GetStartIndex()
  1493. if "ACTIVE" == name:
  1494. if self.PAGE_HORSE == self.curSelectedSkillGroup:
  1495. startSlotIndex += slotCount
  1496.  
  1497. getSkillType=skill.GetSkillType
  1498. getSkillIndex=player.GetSkillIndex
  1499. getSkillGrade=player.GetSkillGrade
  1500. getSkillLevel=player.GetSkillLevel
  1501. getSkillLevelUpPoint=skill.GetSkillLevelUpPoint
  1502. getSkillMaxLevel=skill.GetSkillMaxLevel
  1503. for i in xrange(slotCount+1):
  1504.  
  1505. slotIndex = i + startSlotIndex
  1506. skillIndex = getSkillIndex(slotIndex)
  1507.  
  1508. for j in xrange(skill.SKILL_GRADE_COUNT):
  1509. skillPage.ClearSlot(self.__GetRealSkillSlot(j, i))
  1510.  
  1511. if 0 == skillIndex:
  1512. continue
  1513.  
  1514. skillGrade = getSkillGrade(slotIndex)
  1515. skillLevel = getSkillLevel(slotIndex)
  1516. skillType = getSkillType(skillIndex)
  1517.  
  1518.  
  1519. if player.SKILL_INDEX_RIDING == skillIndex:
  1520. if 1 == skillGrade:
  1521. skillLevel += 19
  1522. elif 2 == skillGrade:
  1523. skillLevel += 29
  1524. elif 3 == skillGrade:
  1525. skillLevel = 40
  1526.  
  1527. skillPage.SetSkillSlotNew(slotIndex, skillIndex, max(skillLevel-1, 0), skillLevel)
  1528. skillPage.SetSlotCount(slotIndex, skillLevel)
  1529.  
  1530. ## ACTIVE
  1531. elif skill.SKILL_TYPE_ACTIVE == skillType:
  1532. for j in xrange(skill.SKILL_GRADE_COUNT):
  1533. realSlotIndex = self.__GetRealSkillSlot(j, slotIndex)
  1534. skillPage.SetSkillSlotNew(realSlotIndex, skillIndex, j, skillLevel)
  1535. skillPage.SetCoverButton(realSlotIndex)
  1536.  
  1537. if (skillGrade == skill.SKILL_GRADE_COUNT) and j == (skill.SKILL_GRADE_COUNT-1):
  1538. skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
  1539. elif (not self.__CanUseSkillNow()) or (skillGrade != j):
  1540. skillPage.SetSlotCount(realSlotIndex, 0)
  1541. skillPage.DisableCoverButton(realSlotIndex)
  1542. else:
  1543. skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
  1544.  
  1545.  
  1546. else:
  1547. if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST:
  1548. realSlotIndex = self.__GetETCSkillRealSlotIndex(slotIndex)
  1549. skillPage.SetSkillSlot(realSlotIndex, skillIndex, skillLevel)
  1550. skillPage.SetSlotCountNew(realSlotIndex, skillGrade, skillLevel)
  1551.  
  1552. if skill.CanUseSkill(skillIndex):
  1553. skillPage.SetCoverButton(realSlotIndex)
  1554.  
  1555. skillPage.RefreshSlot()
  1556.  
  1557.  
  1558. def RefreshSkill(self):
  1559.  
  1560. if self.isLoaded==0:
  1561. return
  1562.  
  1563. if self.__IsChangedHorseRidingSkillLevel():
  1564. self.RefreshCharacter()
  1565. return
  1566.  
  1567.  
  1568. global SHOW_ONLY_ACTIVE_SKILL
  1569. if SHOW_ONLY_ACTIVE_SKILL:
  1570. self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT)
  1571. else:
  1572. self.__RefreshSkillPage("ACTIVE", self.ACTIVE_PAGE_SLOT_COUNT)
  1573. self.__RefreshSkillPage("SUPPORT", self.SUPPORT_PAGE_SLOT_COUNT)
  1574.  
  1575. self.RefreshSkillPlusButtonList()
  1576.  
  1577. def CanShowPlusButton(self, skillIndex, skillLevel, curStatPoint):
  1578.  
  1579.  
  1580. if 0 == skillIndex:
  1581. return FALSE
  1582.  
  1583.  
  1584. if not skill.CanLevelUpSkill(skillIndex, skillLevel):
  1585. return FALSE
  1586.  
  1587. return TRUE
  1588.  
  1589. def __RefreshSkillPlusButton(self, name):
  1590. global HIDE_SUPPORT_SKILL_POINT
  1591. if HIDE_SUPPORT_SKILL_POINT and "SUPPORT" == name:
  1592. return
  1593.  
  1594. slotWindow = self.skillPageDict[name]
  1595. slotWindow.HideAllSlotButton()
  1596.  
  1597. slotStatType = self.skillPageStatDict[name]
  1598. if 0 == slotStatType:
  1599. return
  1600.  
  1601. statPoint = player.GetStatus(slotStatType)
  1602. startSlotIndex = slotWindow.GetStartIndex()
  1603. if "HORSE" == name:
  1604. startSlotIndex += self.ACTIVE_PAGE_SLOT_COUNT
  1605.  
  1606. if statPoint > 0:
  1607. for i in xrange(self.PAGE_SLOT_COUNT):
  1608. slotIndex = i + startSlotIndex
  1609. skillIndex = player.GetSkillIndex(slotIndex)
  1610. skillGrade = player.GetSkillGrade(slotIndex)
  1611. skillLevel = player.GetSkillLevel(slotIndex)
  1612.  
  1613. if skillIndex == 0:
  1614. continue
  1615. if skillGrade != 0:
  1616. continue
  1617.  
  1618. if name == "HORSE":
  1619. if player.GetStatus(player.LEVEL) >= skill.GetSkillLevelLimit(skillIndex):
  1620. if skillLevel < 20:
  1621. slotWindow.ShowSlotButton(self.__GetETCSkillRealSlotIndex(slotIndex))
  1622.  
  1623. else:
  1624. if "SUPPORT" == name:
  1625. if not SHOW_LIMIT_SUPPORT_SKILL_LIST or skillIndex in SHOW_LIMIT_SUPPORT_SKILL_LIST:
  1626. if self.CanShowPlusButton(skillIndex, skillLevel, statPoint):
  1627. slotWindow.ShowSlotButton(slotIndex)
  1628. else:
  1629. if self.CanShowPlusButton(skillIndex, skillLevel, statPoint):
  1630. slotWindow.ShowSlotButton(slotIndex)
  1631.  
  1632.  
  1633. def RefreshSkillPlusButtonList(self):
  1634.  
  1635. if self.isLoaded==0:
  1636. return
  1637.  
  1638. self.RefreshSkillPlusPointLabel()
  1639.  
  1640. if not self.__CanUseSkillNow():
  1641. return
  1642.  
  1643. try:
  1644. if self.PAGE_HORSE == self.curSelectedSkillGroup:
  1645. self.__RefreshSkillPlusButton("HORSE")
  1646. else:
  1647. self.__RefreshSkillPlusButton("ACTIVE")
  1648.  
  1649. self.__RefreshSkillPlusButton("SUPPORT")
  1650.  
  1651. except:
  1652. import exception
  1653. exception.Abort("CharacterWindow.RefreshSkillPlusButtonList.BindObject")
  1654.  
  1655. def RefreshSkillPlusPointLabel(self):
  1656. if self.isLoaded==0:
  1657. return
  1658.  
  1659. if self.PAGE_HORSE == self.curSelectedSkillGroup:
  1660. self.activeSkillPointValue.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+" [|cfff8d090"+str(player.GetStatus(player.SKILL_HORSE))+"|cffa08784]")
  1661.  
  1662. else:
  1663. self.activeSkillPointValue.SetText("|cffa08784"+uiScriptLocale.CHARACTER_PSTATUS+" [|cfff8d090"+str(player.GetStatus(player.SKILL_ACTIVE))+"|cffa08784]")
  1664.  
  1665. ## Skill Level Up Button
  1666. def OnPressedSlotButton(self, slotNumber):
  1667. srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotNumber)
  1668.  
  1669. skillIndex = player.GetSkillIndex(srcSlotIndex)
  1670. curLevel = player.GetSkillLevel(srcSlotIndex)
  1671. maxLevel = skill.GetSkillMaxLevel(skillIndex)
  1672.  
  1673. net.SendChatPacket("/skillup " + str(skillIndex))
  1674.  
  1675. ## Use Skill
  1676. def ClickSkillSlot(self, slotIndex):
  1677.  
  1678. srcSlotIndex = self.__RealSkillSlotToSourceSlot(slotIndex)
  1679. skillIndex = player.GetSkillIndex(srcSlotIndex)
  1680. skillType = skill.GetSkillType(skillIndex)
  1681.  
  1682. if not self.__CanUseSkillNow():
  1683. if skill.SKILL_TYPE_ACTIVE == skillType:
  1684. return
  1685.  
  1686. for slotWindow in self.skillPageDict.values():
  1687. if slotWindow.HasSlot(slotIndex):
  1688. if skill.CanUseSkill(skillIndex):
  1689. player.ClickSkillSlot(srcSlotIndex)
  1690. return
  1691.  
  1692. mouseModule.mouseController.DeattachObject()
  1693.  
  1694.  
  1695. def OnUseSkill(self, slotIndex, coolTime):
  1696.  
  1697. skillIndex = player.GetSkillIndex(slotIndex)
  1698. skillType = skill.GetSkillType(skillIndex)
  1699.  
  1700. ## ACTIVE
  1701. if skill.SKILL_TYPE_ACTIVE == skillType:
  1702. skillGrade = player.GetSkillGrade(slotIndex)
  1703. slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
  1704. ## ETC
  1705. else:
  1706. slotIndex = self.__GetETCSkillRealSlotIndex(slotIndex)
  1707.  
  1708. for slotWindow in self.skillPageDict.values():
  1709. if slotWindow.HasSlot(slotIndex):
  1710. slotWindow.SetSlotCoolTime(slotIndex, coolTime)
  1711. return
  1712.  
  1713. def OnActivateSkill(self, slotIndex):
  1714.  
  1715. skillGrade = player.GetSkillGrade(slotIndex)
  1716. slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
  1717.  
  1718. for slotWindow in self.skillPageDict.values():
  1719. if slotWindow.HasSlot(slotIndex):
  1720. slotWindow.ActivateSlot(slotIndex)
  1721. return
  1722.  
  1723. def OnDeactivateSkill(self, slotIndex):
  1724.  
  1725. skillGrade = player.GetSkillGrade(slotIndex)
  1726. slotIndex = self.__GetRealSkillSlot(skillGrade, slotIndex)
  1727.  
  1728. for slotWindow in self.skillPageDict.values():
  1729. if slotWindow.HasSlot(slotIndex):
  1730. slotWindow.DeactivateSlot(slotIndex)
  1731. return
  1732.  
  1733. def __ShowJobToolTip(self):
  1734. self.toolTipJob.ShowToolTip()
  1735.  
  1736. def __HideJobToolTip(self):
  1737. self.toolTipJob.HideToolTip()
  1738.  
  1739. def __SetJobText(self, mainJob, subJob):
  1740. if player.GetStatus(player.LEVEL)<5:
  1741. subJob=0
  1742.  
  1743. if 949 == app.GetDefaultCodePage():
  1744. self.toolTipJob.ClearToolTip()
  1745.  
  1746. try:
  1747. jobInfoTitle=localeInfo.JOBINFO_TITLE[mainJob][subJob]
  1748. jobInfoData=locale.JOBINFO_DATA_LIST[mainJob][subJob]
  1749. except IndexError:
  1750. print "uiCharacter.CharacterWindow.__SetJobText(mainJob=%d, subJob=%d)" % (mainJob, subJob)
  1751. return
  1752.  
  1753. self.toolTipJob.AutoAppendTextLine(jobInfoTitle)
  1754. self.toolTipJob.AppendSpace(5)
  1755.  
  1756. for jobInfoDataLine in jobInfoData:
  1757. self.toolTipJob.AutoAppendTextLine(jobInfoDataLine)
  1758.  
  1759. self.toolTipJob.AlignHorizonalCenter()
  1760.  
  1761. def __ShowAlignmentToolTip(self):
  1762. self.toolTipAlignment.ShowToolTip()
  1763.  
  1764. def __HideAlignmentToolTip(self):
  1765. self.toolTipAlignment.HideToolTip()
  1766.  
  1767. def RefreshCharacter(self):
  1768.  
  1769. if self.isLoaded==0:
  1770. return
  1771.  
  1772. ## Name
  1773. try:
  1774. characterName = player.GetName()
  1775. guildName = player.GetGuildName()
  1776. self.characterNameValue.SetText("|cffa07970"+characterName)
  1777. if guildName == "":
  1778. self.guildNameValue.SetText("|cffa07970Fãrã Breaslã ")
  1779. else:
  1780. self.guildNameValue.SetText("|cffa07970"+guildName)
  1781. self.guildNameSlot.Show()
  1782. except:
  1783. import exception
  1784. exception.Abort("CharacterWindow.RefreshCharacter.BindObject")
  1785.  
  1786. race = net.GetMainActorRace()
  1787. group = net.GetMainActorSkillGroup()
  1788. empire = net.GetMainActorEmpire()
  1789.  
  1790. ## Job Text
  1791. job = chr.RaceToJob(race)
  1792. self.__SetJobText(job, group)
  1793.  
  1794.  
  1795. self.img2 = self.GetChild("ChrIcon")
  1796. self.img2.LoadImage(FACE_IMAGE_DICT[race])
  1797. self.img2.Show()
  1798.  
  1799. ## GroupName
  1800. self.__SetSkillGroupName(race, group)
  1801.  
  1802. ## Skill
  1803. if 0 == group:
  1804. self.__SelectSkillGroup(0)
  1805.  
  1806. else:
  1807. self.__SetSkillSlotData(race, group, empire)
  1808.  
  1809. if self.__CanUseHorseSkill():
  1810. self.__SelectSkillGroup(0)
  1811.  
  1812. def __SetSkillGroupName(self, race, group):
  1813.  
  1814. job = chr.RaceToJob(race)
  1815.  
  1816. if not self.SKILL_GROUP_NAME_DICT.has_key(job):
  1817. return
  1818.  
  1819. nameList = self.SKILL_GROUP_NAME_DICT[job]
  1820.  
  1821. if 0 == group:
  1822. self.skillGroupButton1.SetText(nameList[1])
  1823. self.skillGroupButton2.SetText(nameList[2])
  1824. self.skillGroupButton1.Show()
  1825. self.skillGroupButton2.Show()
  1826. self.activeSkillGroupName.Hide()
  1827.  
  1828. else:
  1829.  
  1830. if self.__CanUseHorseSkill():
  1831. self.activeSkillGroupName.SetText(nameList.get(group, "Noname"))
  1832. self.activeSkillGroupName.Show()
  1833. self.skillGroupButton1.Show()
  1834. self.skillGroupButton2.Show()
  1835.  
  1836. else:
  1837. # self.activeSkillGroupName.SetText(nameList.get(group, "Noname"))
  1838. self.activeSkillGroupName.Show()
  1839. self.skillGroupButton1.Hide()
  1840. self.skillGroupButton2.Hide()
  1841.  
  1842. def __SetSkillSlotData(self, race, group, empire=0):
  1843.  
  1844. ## SkillIndex
  1845. playerSettingModule.RegisterSkill(race, group, empire)
  1846.  
  1847. ## Event
  1848. self.__SetSkillSlotEvent()
  1849.  
  1850. ## Refresh
  1851. self.RefreshSkill()
  1852.  
  1853. def __SelectSkillGroup(self, index):
  1854. for btn in self.skillGroupButton:
  1855. btn.SetUp()
  1856. self.skillGroupButton[index].Down()
  1857.  
  1858. if self.__CanUseHorseSkill():
  1859. if 0 == index:
  1860. index = net.GetMainActorSkillGroup()-1
  1861. elif 1 == index:
  1862. index = self.PAGE_HORSE
  1863.  
  1864. self.curSelectedSkillGroup = index
  1865. self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire())
  1866.  
  1867. def __CanUseSkillNow(self):
  1868. if 0 == net.GetMainActorSkillGroup():
  1869. return FALSE
  1870.  
  1871. return TRUE
  1872.  
  1873. def __CanUseHorseSkill(self):
  1874.  
  1875. slotIndex = player.GetSkillSlotIndex(player.SKILL_INDEX_RIDING)
  1876.  
  1877. if not slotIndex:
  1878. return FALSE
  1879.  
  1880. grade = player.GetSkillGrade(slotIndex)
  1881. level = player.GetSkillLevel(slotIndex)
  1882. if level < 0:
  1883. level *= -1
  1884. if grade >= 1 and level >= 1:
  1885. return TRUE
  1886.  
  1887. return FALSE
  1888.  
  1889. def __IsChangedHorseRidingSkillLevel(self):
  1890. ret = FALSE
  1891.  
  1892. if -1 == self.canUseHorseSkill:
  1893. self.canUseHorseSkill = self.__CanUseHorseSkill()
  1894.  
  1895. if self.canUseHorseSkill != self.__CanUseHorseSkill():
  1896. ret = TRUE
  1897.  
  1898. self.canUseHorseSkill = self.__CanUseHorseSkill()
  1899. return ret
  1900.  
  1901. def __GetRealSkillSlot(self, skillGrade, skillSlot):
  1902. return skillSlot + min(skill.SKILL_GRADE_COUNT-1, skillGrade)*skill.SKILL_GRADE_STEP_COUNT
  1903.  
  1904. def __GetETCSkillRealSlotIndex(self, skillSlot):
  1905. if skillSlot > 100:
  1906. return skillSlot
  1907. return skillSlot % self.ACTIVE_PAGE_SLOT_COUNT
  1908.  
  1909. def __RealSkillSlotToSourceSlot(self, realSkillSlot):
  1910. if realSkillSlot > 100:
  1911. return realSkillSlot
  1912. if self.PAGE_HORSE == self.curSelectedSkillGroup:
  1913. return realSkillSlot + self.ACTIVE_PAGE_SLOT_COUNT
  1914. return realSkillSlot % skill.SKILL_GRADE_STEP_COUNT
  1915.  
  1916. def __GetSkillGradeFromSlot(self, skillSlot):
  1917. return int(skillSlot / skill.SKILL_GRADE_STEP_COUNT)
  1918.  
  1919. def SelectSkillGroup(self, index):
  1920. self.__SelectSkillGroup(index)
  1921.  
  1922. def OnQuestScroll(self):
  1923. questCount = quest.GetQuestCount()
  1924. scrollLineCount = max(0, questCount - quest.QUEST_MAX_NUM)
  1925. startIndex = int(scrollLineCount * self.questScrollBar.GetPos())
  1926.  
  1927. if startIndex != self.questShowingStartIndex:
  1928. self.questShowingStartIndex = startIndex
  1929. self.RefreshQuest()
  1930.  
  1931. class WaitingDialog(ui.ScriptWindow):
  1932. def __init__(self):
  1933. ui.ScriptWindow.__init__(self)
  1934. self.eventTimeOver = lambda *arg: None
  1935. self.eventExit = lambda *arg: None
  1936.  
  1937. def __del__(self):
  1938. ui.ScriptWindow.__del__(self)
  1939.  
  1940. def Open(self, waitTime):
  1941. import time
  1942. curTime = time.clock()
  1943. self.endTime = curTime + waitTime
  1944.  
  1945. self.Show()
  1946.  
  1947. def Close(self):
  1948. self.Hide()
  1949.  
  1950. def Destroy(self):
  1951. self.Hide()
  1952.  
  1953. def SAFE_SetTimeOverEvent(self, event):
  1954. self.eventTimeOver = ui.__mem_func__(event)
  1955.  
  1956. def SAFE_SetExitEvent(self, event):
  1957. self.eventExit = ui.__mem_func__(event)
  1958.  
  1959. def OnUpdate(self):
  1960. import time
  1961. lastTime = max(0, self.endTime - time.clock())
  1962. if 0 == lastTime:
  1963. self.Close()
  1964. self.eventTimeOver()
  1965. else:
  1966. return
  1967.  
  1968.  
  1969. def OnPressExitKey(self):
  1970. self.Close()
  1971. return TRUE
  1972.  
  1973.  
  1974. class Item(ui.ListBoxEx.Item):
  1975. def __init__(self, fileName):
  1976. ui.ListBoxEx.Item.__init__(self)
  1977. self.canLoad=0
  1978. self.text=fileName
  1979. self.textLine=self.__CreateTextLine(fileName[:70])
  1980.  
  1981. def __del__(self):
  1982. ui.ListBoxEx.Item.__del__(self)
  1983.  
  1984. def GetText(self):
  1985. return self.text
  1986.  
  1987. def SetSize(self, width, height):
  1988. ui.ListBoxEx.Item.SetSize(self, 0, 0)
  1989.  
  1990. def __CreateTextLine(self, fileName):
  1991. textLine=ui.TextLine()
  1992. textLine.SetParent(self)
  1993. textLine.SetPosition(0, 0)
  1994. textLine.SetText(fileName)
  1995. textLine.Show()
  1996. return textLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement