Guest User

Untitled

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