Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.95 KB | None | 0 0
  1. import ui
  2. import net
  3. import item
  4. import skill
  5. import localeInfo
  6. import wndMgr
  7. import player
  8. import constInfo
  9. import mouseModule
  10. import uiScriptLocale
  11. import app
  12.  
  13. MOUSE_SETTINGS = [0, 0]
  14.  
  15. def InitMouseButtonSettings(left, right):
  16. global MOUSE_SETTINGS
  17. MOUSE_SETTINGS = [left, right]
  18.  
  19. def SetMouseButtonSetting(dir, event):
  20. global MOUSE_SETTINGS
  21. MOUSE_SETTINGS[dir] = event
  22.  
  23. def GetMouseButtonSettings():
  24. global MOUSE_SETTINGS
  25. return MOUSE_SETTINGS
  26.  
  27. def SaveMouseButtonSettings():
  28. global MOUSE_SETTINGS
  29. open("mouse.cfg", "w").write("%s\t%s" % tuple(MOUSE_SETTINGS))
  30.  
  31. def LoadMouseButtonSettings():
  32. global MOUSE_SETTINGS
  33. tokens = open("mouse.cfg", "r").read().split()
  34.  
  35. if len(tokens) != 2:
  36. raise RuntimeError, "MOUSE_SETTINGS_FILE_ERROR"
  37.  
  38. MOUSE_SETTINGS[0] = int(tokens[0])
  39. MOUSE_SETTINGS[1] = int(tokens[1])
  40.  
  41. def unsigned32(n):
  42. return n & 0xFFFFFFFFL
  43.  
  44. #-------------------Giftbox Begin------------------------------
  45.  
  46. # class GiftBox(ui.ScriptWindow):
  47. # class TextToolTip(ui.Window):
  48. # def __init__(self):
  49. # ui.Window.__init__(self, "TOP_MOST")
  50. # self.SetWindowName("GiftBox")
  51. # textLine = ui.TextLine()
  52. # textLine.SetParent(self)
  53. # textLine.SetHorizontalAlignCenter()
  54. # textLine.SetOutline()
  55. # textLine.Show()
  56. # self.textLine = textLine
  57.  
  58. # def __del__(self):
  59. # ui.Window.__del__(self)
  60.  
  61. # def SetText(self, text):
  62. # self.textLine.SetText(text)
  63.  
  64. # def OnRender(self):
  65. # (mouseX, mouseY) = wndMgr.GetMousePosition()
  66. # self.textLine.SetPosition(mouseX, mouseY - 15)
  67.  
  68. # def __init__(self):
  69. # print "NEW TASKBAR ----------------------------------------------------------------------------"
  70. # ui.ScriptWindow.__init__(self)
  71. # self.tooltipGift = self.TextToolTip()
  72. # self.tooltipGift.Show()
  73.  
  74. # def __del__(self):
  75. # print "---------------------------------------------------------------------------- DELETE TASKBAR"
  76. # ui.ScriptWindow.__del__(self)
  77.  
  78. # def LoadWindow(self):
  79. # try:
  80. # pyScrLoader = ui.PythonScriptLoader()
  81. # pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "giftbox.py")
  82. # except:
  83. # import exception
  84. # exception.Abort("GiftBox.LoadWindow.LoadObject")
  85.  
  86. # self.giftBoxIcon = self.GetChild("GiftBox_Icon")
  87. # self.giftBoxToolTip = self.GetChild("GiftBox_ToolTip")
  88.  
  89. # def Destroy(self):
  90. # self.giftBoxIcon = 0
  91. # self.giftBoxToolTip = 0
  92.  
  93. #-------------------Giftbox End------------------------------
  94.  
  95. # class EnergyBar(ui.ScriptWindow):
  96. # class TextToolTip(ui.Window):
  97. # def __init__(self):
  98. # ui.Window.__init__(self, "TOP_MOST")
  99. # self.SetWindowName("EnergyBar")
  100. # textLine = ui.TextLine()
  101. # textLine.SetParent(self)
  102. # textLine.SetHorizontalAlignCenter()
  103. # textLine.SetOutline()
  104. # textLine.Show()
  105. # self.textLine = textLine
  106.  
  107. # def __del__(self):
  108. # ui.Window.__del__(self)
  109.  
  110. # def SetText(self, text):
  111. # self.textLine.SetText(text)
  112.  
  113. # def OnRender(self):
  114. # (mouseX, mouseY) = wndMgr.GetMousePosition()
  115. # self.textLine.SetPosition(mouseX, mouseY - 15)
  116.  
  117. # def __init__(self):
  118. # print "NEW TASKBAR ----------------------------------------------------------------------------"
  119. # ui.ScriptWindow.__init__(self)
  120. # self.tooltipEnergy = self.TextToolTip()
  121. # self.tooltipEnergy.Show()
  122.  
  123. # def __del__(self):
  124. # print "---------------------------------------------------------------------------- DELETE TASKBAR"
  125. # ui.ScriptWindow.__del__(self)
  126.  
  127. # def LoadWindow(self):
  128. # try:
  129. # pyScrLoader = ui.PythonScriptLoader()
  130. # pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "EnergyBar.py")
  131. # except:
  132. # import exception
  133. # exception.Abort("EnergyBar.LoadWindow.LoadObject")
  134.  
  135. # self.energyEmpty = self.GetChild("EnergyGauge_Empty")
  136. # self.energyHungry = self.GetChild("EnergyGauge_Hungry")
  137. # self.energyFull = self.GetChild("EnergyGauge_Full")
  138.  
  139. # self.energyGaugeBoard = self.GetChild("EnergyGauge_Board")
  140. # self.energyGaugeToolTip = self.GetChild("EnergyGauge_ToolTip")
  141.  
  142.  
  143. # def Destroy(self):
  144. # self.energyEmpty = None
  145. # self.energyHungry = None
  146. # self.energyFull = None
  147. # self.energyGaugeBoard = 0
  148. # self.energyGaugeToolTip = 0
  149. # self.tooltipEnergy = 0
  150.  
  151. # Gauge
  152. # def RefreshStatus(self):
  153. # pointEnergy = player.GetStatus (player.ENERGY)
  154. # leftTimeEnergy = player.GetStatus (player.ENERGY_END_TIME) - app.GetGlobalTimeStamp()
  155. # 충기환 지속 시간 = 2시간.
  156. # self.SetEnergy (pointEnergy, leftTimeEnergy, 7200)
  157.  
  158. # def SetEnergy (self, point, leftTime, maxTime):
  159. # leftTime = max (leftTime, 0)
  160. # maxTime = max (maxTime, 0)
  161.  
  162. # self.energyEmpty.Hide()
  163. # self.energyHungry.Hide()
  164. # self.energyFull.Hide()
  165.  
  166. # if leftTime == 0:
  167. # self.energyEmpty.Show()
  168. # elif ((leftTime * 100) / maxTime) < 15:
  169. # self.energyHungry.Show()
  170. # else:
  171. # self.energyFull.Show()
  172.  
  173. # self.tooltipEnergy.SetText("%s" % (localeInfo.TOOLTIP_ENERGY(point)))
  174.  
  175. # def OnUpdate(self):
  176. # if True == self.energyGaugeToolTip.IsIn():
  177. # self.RefreshStatus()
  178. # self.tooltipEnergy.Show()
  179. # else:
  180. # self.tooltipEnergy.Hide()
  181.  
  182. class ExpandedTaskBar(ui.ScriptWindow):
  183. BUTTON_DRAGON_SOUL = 0
  184. def __init__(self):
  185. ui.Window.__init__(self)
  186. self.SetWindowName("ExpandedTaskBar")
  187.  
  188. def LoadWindow(self):
  189. try:
  190. pyScrLoader = ui.PythonScriptLoader()
  191. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "ExpandedTaskBar.py")
  192. except:
  193. import exception
  194. exception.Abort("ExpandedTaskBar.LoadWindow.LoadObject")
  195.  
  196. self.expandedTaskBarBoard = self.GetChild("ExpanedTaskBar_Board")
  197.  
  198. self.toggleButtonDict = {}
  199. self.toggleButtonDict[ExpandedTaskBar.BUTTON_DRAGON_SOUL] = self.GetChild("DragonSoulButton")
  200. self.toggleButtonDict[ExpandedTaskBar.BUTTON_DRAGON_SOUL].SetParent(self)
  201.  
  202. def SetTop(self):
  203. super(ExpandedTaskBar, self).SetTop()
  204. for button in self.toggleButtonDict.values():
  205. button.SetTop()
  206.  
  207. def Show(self):
  208. ui.ScriptWindow.Show(self)
  209.  
  210. def Close(self):
  211. self.Hide()
  212.  
  213. def SetToolTipText(self, eButton, text):
  214. self.toggleButtonDict[eButton].SetToolTipText(text)
  215.  
  216. def SetToggleButtonEvent(self, eButton, kEventFunc):
  217. self.toggleButtonDict[eButton].SetEvent(kEventFunc)
  218.  
  219. def OnPressEscapeKey(self):
  220. self.Close()
  221. return True
  222.  
  223. class TaskBar(ui.ScriptWindow):
  224.  
  225. BUTTON_CHARACTER = 0
  226. BUTTON_INVENTORY = 1
  227. BUTTON_MESSENGER = 2
  228. BUTTON_SYSTEM = 3
  229. BUTTON_CHAT = 4
  230. BUTTON_EXPAND = 4
  231. IS_EXPANDED = False
  232.  
  233. MOUSE_BUTTON_LEFT = 0
  234. MOUSE_BUTTON_RIGHT = 1
  235. NONE = 255
  236.  
  237. EVENT_MOVE = 0
  238. EVENT_ATTACK = 1
  239. EVENT_MOVE_AND_ATTACK = 2
  240. EVENT_CAMERA = 3
  241. EVENT_SKILL = 4
  242. EVENT_AUTO = 5
  243.  
  244. GAUGE_WIDTH = 95
  245. GAUGE_HEIGHT = 13
  246.  
  247. QUICKPAGE_NUMBER_FILENAME = [
  248. "d:/ymir work/ui/game/taskbar/1.sub",
  249. "d:/ymir work/ui/game/taskbar/2.sub",
  250. "d:/ymir work/ui/game/taskbar/3.sub",
  251. "d:/ymir work/ui/game/taskbar/4.sub",
  252. ]
  253.  
  254. #gift icon show and hide
  255. # def ShowGift(self):
  256. # if not localeInfo.IsBRAZIL():
  257. # self.wndGiftBox.Show()
  258.  
  259. # def HideGift(self):
  260. # self.wndGiftBox.Hide()
  261.  
  262. class TextToolTip(ui.Window):
  263. def __init__(self):
  264. ui.Window.__init__(self, "TOP_MOST")
  265.  
  266. textLine = ui.TextLine()
  267. textLine.SetParent(self)
  268. textLine.SetHorizontalAlignCenter()
  269. textLine.SetOutline()
  270. textLine.Show()
  271. self.textLine = textLine
  272.  
  273. def __del__(self):
  274. ui.Window.__del__(self)
  275.  
  276. def SetText(self, text):
  277. self.textLine.SetText(text)
  278.  
  279. def OnRender(self):
  280. (mouseX, mouseY) = wndMgr.GetMousePosition()
  281. self.textLine.SetPosition(mouseX, mouseY - 15)
  282.  
  283. class SkillButton(ui.SlotWindow):
  284.  
  285. def __init__(self):
  286. ui.SlotWindow.__init__(self)
  287.  
  288. self.event = 0
  289. self.arg = 0
  290.  
  291. self.slotIndex = 0
  292. self.skillIndex = 0
  293.  
  294. slotIndex = 0
  295. wndMgr.SetSlotBaseImage(self.hWnd, "d:/ymir work/ui/public/slot_base.sub", 1.0, 1.0, 1.0, 1.0)
  296. wndMgr.AppendSlot(self.hWnd, slotIndex, 0, 0, 32, 32)
  297. self.SetCoverButton(slotIndex, "d:/ymir work/ui/public/slot_cover_button_01.sub",\
  298. "d:/ymir work/ui/public/slot_cover_button_02.sub",\
  299. "d:/ymir work/ui/public/slot_cover_button_03.sub",\
  300. "d:/ymir work/ui/public/slot_cover_button_04.sub", True, False)
  301. self.SetSize(32, 32)
  302.  
  303. def __del__(self):
  304. ui.SlotWindow.__del__(self)
  305.  
  306. def Destroy(self):
  307. if 0 != self.tooltipSkill:
  308. self.tooltipSkill.HideToolTip()
  309.  
  310. def RefreshSkill(self):
  311. if 0 != self.slotIndex:
  312. self.SetSkill(self.slotIndex)
  313.  
  314. def SetSkillToolTip(self, tooltip):
  315. self.tooltipSkill = tooltip
  316.  
  317. def SetSkill(self, skillSlotNumber):
  318. slotNumber = 0
  319. skillIndex = player.GetSkillIndex(skillSlotNumber)
  320. skillGrade = player.GetSkillGrade(skillSlotNumber)
  321. skillLevel = player.GetSkillLevel(skillSlotNumber)
  322. skillType = skill.GetSkillType(skillIndex)
  323.  
  324. self.skillIndex = skillIndex
  325. if 0 == self.skillIndex:
  326. self.ClearSlot(slotNumber)
  327. return
  328.  
  329. self.slotIndex = skillSlotNumber
  330.  
  331. self.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel)
  332. self.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
  333.  
  334. ## NOTE : CoolTime 체크
  335. if player.IsSkillCoolTime(skillSlotNumber):
  336. (coolTime, elapsedTime) = player.GetSkillCoolTime(skillSlotNumber)
  337. self.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)
  338.  
  339. ## NOTE : Activate 되어 있다면 아이콘도 업데이트
  340. if player.IsSkillActive(skillSlotNumber):
  341. self.ActivateSlot(slotNumber)
  342.  
  343. def SetSkillEvent(self, event, arg=0):
  344. self.event = event
  345. self.arg = arg
  346.  
  347. def GetSkillIndex(self):
  348. return self.skillIndex
  349.  
  350. def GetSlotIndex(self):
  351. return self.slotIndex
  352.  
  353. def Activate(self, coolTime):
  354. self.SetSlotCoolTime(0, coolTime)
  355.  
  356. if skill.IsToggleSkill(self.skillIndex):
  357. self.ActivateSlot(0)
  358.  
  359. def Deactivate(self):
  360. if skill.IsToggleSkill(self.skillIndex):
  361. self.DeactivateSlot(0)
  362.  
  363. def OnOverInItem(self, dummy):
  364. self.tooltipSkill.SetSkill(self.skillIndex)
  365.  
  366. def OnOverOutItem(self):
  367. self.tooltipSkill.HideToolTip()
  368.  
  369. def OnSelectItemSlot(self, dummy):
  370. if 0 != self.event:
  371. if 0 != self.arg:
  372. self.event(self.arg)
  373. else:
  374. self.event()
  375.  
  376. def __init__(self):
  377. #print "NEW TASKBAR ----------------------------------------------------------------------------"
  378.  
  379. ui.ScriptWindow.__init__(self, "TOP_MOST")
  380.  
  381. self.quickPageNumImageBox = None
  382. self.tooltipItem = 0
  383. self.tooltipSkill = 0
  384. self.mouseModeButtonList = [ ui.ScriptWindow("TOP_MOST"), ui.ScriptWindow("TOP_MOST") ]
  385.  
  386. self.tooltipHP = self.TextToolTip()
  387. self.tooltipHP.Show()
  388. self.tooltipSP = self.TextToolTip()
  389. self.tooltipSP.Show()
  390. self.tooltipST = self.TextToolTip()
  391. self.tooltipST.Show()
  392. self.tooltipEXP = self.TextToolTip()
  393. self.tooltipEXP.Show()
  394.  
  395. self.skillCategoryNameList = [ "ACTIVE_1", "ACTIVE_2", "ACTIVE_3" ]
  396. self.skillPageStartSlotIndexDict = {
  397. "ACTIVE_1" : 1,
  398. "ACTIVE_2" : 21,
  399. "ACTIVE_3" : 41,
  400. }
  401.  
  402. self.selectSkillButtonList = []
  403.  
  404. self.lastUpdateQuickSlot = 0
  405. self.SetWindowName("TaskBar")
  406.  
  407. def __del__(self):
  408. #print "---------------------------------------------------------------------------- DELETE TASKBAR"
  409. ui.ScriptWindow.__del__(self)
  410.  
  411. def LoadWindow(self):
  412. try:
  413. pyScrLoader = ui.PythonScriptLoader()
  414.  
  415. if constInfo.IN_GAME_SHOP_ENABLE:
  416. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "TaskBar.py")
  417. else:
  418. pyScrLoader.LoadScriptFile(self, "UIScript/TaskBar.py")
  419. pyScrLoader.LoadScriptFile(self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT], "UIScript/MouseButtonWindow.py")
  420. pyScrLoader.LoadScriptFile(self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT], "UIScript/RightMouseButtonWindow.py")
  421. except:
  422. import exception
  423. exception.Abort("TaskBar.LoadWindow.LoadObject")
  424.  
  425. self.quickslot = []
  426. self.quickslot.append(self.GetChild("quick_slot_1"))
  427. self.quickslot.append(self.GetChild("quick_slot_2"))
  428. for slot in self.quickslot:
  429. slot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  430. slot.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptyQuickSlot))
  431. slot.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemQuickSlot))
  432. slot.SetUnselectItemSlotEvent(ui.__mem_func__(self.UnselectItemQuickSlot))
  433. slot.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
  434. slot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  435.  
  436. toggleButtonDict = {}
  437. toggleButtonDict[TaskBar.BUTTON_CHARACTER]=self.GetChild("CharacterButton")
  438. toggleButtonDict[TaskBar.BUTTON_INVENTORY]=self.GetChild("InventoryButton")
  439. toggleButtonDict[TaskBar.BUTTON_MESSENGER]=self.GetChild("MessengerButton")
  440. toggleButtonDict[TaskBar.BUTTON_SYSTEM]=self.GetChild("SystemButton")
  441.  
  442. # ChatButton, ExpandButton 둘 중 하나는 반드시 존재한다.
  443. try:
  444. toggleButtonDict[TaskBar.BUTTON_CHAT]=self.GetChild("ChatButton")
  445. except:
  446. toggleButtonDict[TaskBar.BUTTON_EXPAND]=self.GetChild("ExpandButton")
  447. TaskBar.IS_EXPANDED = True
  448.  
  449.  
  450. if localeInfo.IsARABIC():
  451. systemButton = toggleButtonDict[TaskBar.BUTTON_SYSTEM]
  452. if systemButton.ToolTipText:
  453. tx, ty = systemButton.ToolTipText.GetLocalPosition()
  454. tw = systemButton.ToolTipText.GetWidth()
  455. systemButton.ToolTipText.SetPosition(-tw/2, ty)
  456.  
  457.  
  458. expGauge = []
  459. expGauge.append(self.GetChild("EXPGauge_01"))
  460. expGauge.append(self.GetChild("EXPGauge_02"))
  461. expGauge.append(self.GetChild("EXPGauge_03"))
  462. expGauge.append(self.GetChild("EXPGauge_04"))
  463.  
  464. for exp in expGauge:
  465. exp.SetSize(0, 0)
  466.  
  467.  
  468. self.quickPageNumImageBox=self.GetChild("QuickPageNumber")
  469.  
  470. self.GetChild("QuickPageUpButton").SetEvent(ui.__mem_func__(self.__OnClickQuickPageUpButton))
  471. self.GetChild("QuickPageDownButton").SetEvent(ui.__mem_func__(self.__OnClickQuickPageDownButton))
  472.  
  473. mouseLeftButtonModeButton = self.GetChild("LeftMouseButton")
  474. mouseRightButtonModeButton = self.GetChild("RightMouseButton")
  475. mouseLeftButtonModeButton.SetEvent(ui.__mem_func__(self.ToggleLeftMouseButtonModeWindow))
  476. mouseRightButtonModeButton.SetEvent(ui.__mem_func__(self.ToggleRightMouseButtonModeWindow))
  477. self.curMouseModeButton = [ mouseLeftButtonModeButton, mouseRightButtonModeButton ]
  478.  
  479. (xLocalRight, yLocalRight) = mouseRightButtonModeButton.GetLocalPosition()
  480. self.curSkillButton = self.SkillButton()
  481. self.curSkillButton.SetParent(self)
  482. self.curSkillButton.SetPosition(xLocalRight, 3)
  483. self.curSkillButton.SetSkillEvent(ui.__mem_func__(self.ToggleRightMouseButtonModeWindow))
  484. self.curSkillButton.Hide()
  485.  
  486. (xLeft, yLeft) = mouseLeftButtonModeButton.GetGlobalPosition()
  487. (xRight, yRight) = mouseRightButtonModeButton.GetGlobalPosition()
  488. leftModeButtonList = self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT]
  489. leftModeButtonList.SetPosition(xLeft, yLeft - leftModeButtonList.GetHeight()-5)
  490. rightModeButtonList = self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT]
  491. rightModeButtonList.SetPosition(xRight - rightModeButtonList.GetWidth() + 32, yRight - rightModeButtonList.GetHeight()-5)
  492. rightModeButtonList.GetChild("button_skill").SetEvent(lambda adir=self.MOUSE_BUTTON_RIGHT, aevent=self.EVENT_SKILL: self.SelectMouseButtonEvent(adir, aevent))
  493. rightModeButtonList.GetChild("button_skill").Hide()
  494.  
  495. mouseImage = ui.ImageBox("TOP_MOST")
  496. mouseImage.AddFlag("float")
  497. mouseImage.LoadImage("d:/ymir work/ui/game/taskbar/mouse_button_camera_01.sub")
  498. mouseImage.SetPosition(xRight, wndMgr.GetScreenHeight() - 34)
  499. mouseImage.Hide()
  500. self.mouseImage = mouseImage
  501.  
  502. dir = self.MOUSE_BUTTON_LEFT
  503. wnd = self.mouseModeButtonList[dir]
  504. wnd.GetChild("button_move_and_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_MOVE_AND_ATTACK: self.SelectMouseButtonEvent(adir, aevent))
  505. wnd.GetChild("button_auto_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_AUTO: self.SelectMouseButtonEvent(adir, aevent))
  506. wnd.GetChild("button_camera").SetEvent(lambda adir=dir, aevent=self.EVENT_CAMERA: self.SelectMouseButtonEvent(adir, aevent))
  507.  
  508. dir = self.MOUSE_BUTTON_RIGHT
  509. wnd = self.mouseModeButtonList[dir]
  510. wnd.GetChild("button_move_and_attack").SetEvent(lambda adir=dir, aevent=self.EVENT_MOVE_AND_ATTACK: self.SelectMouseButtonEvent(adir, aevent))
  511. wnd.GetChild("button_camera").SetEvent(lambda adir=dir, aevent=self.EVENT_CAMERA: self.SelectMouseButtonEvent(adir, aevent))
  512.  
  513. self.toggleButtonDict = toggleButtonDict
  514. self.expGauge = expGauge
  515.  
  516. if constInfo.IN_GAME_SHOP_ENABLE:
  517. self.rampageGauge1 = self.GetChild("RampageGauge")
  518. self.rampageGauge1.OnMouseOverIn = ui.__mem_func__(self.__RampageGauge_OverIn)
  519. self.rampageGauge2 = self.GetChild("RampageGauge2")
  520. self.rampageGauge2.OnMouseOverOut = ui.__mem_func__(self.__RampageGauge_OverOut)
  521. self.rampageGauge2.OnMouseLeftButtonUp = ui.__mem_func__(self.__RampageGauge_Click)
  522. print "[DEBUG]: constInfo.IN_GAME_SHOP_ENABLE / self.rampageGauge1",constInfo.IN_GAME_SHOP_ENABLE, self.rampageGauge1
  523. self.__RampageGauge_OverOut()
  524.  
  525. self.hpGauge = self.GetChild("HPGauge")
  526. self.mpGauge = self.GetChild("SPGauge")
  527. self.stGauge = self.GetChild("STGauge")
  528. self.hpRecoveryGaugeBar = self.GetChild("HPRecoveryGaugeBar")
  529. self.spRecoveryGaugeBar = self.GetChild("SPRecoveryGaugeBar")
  530.  
  531. self.hpGaugeBoard=self.GetChild("HPGauge_Board")
  532. self.mpGaugeBoard=self.GetChild("SPGauge_Board")
  533. self.stGaugeBoard=self.GetChild("STGauge_Board")
  534. self.expGaugeBoard=self.GetChild("EXP_Gauge_Board")
  535.  
  536. #giftbox object
  537. # wndGiftBox = GiftBox()
  538. # wndGiftBox.LoadWindow()
  539. # self.wndGiftBox = wndGiftBox
  540.  
  541. self.__LoadMouseSettings()
  542. self.RefreshStatus()
  543. self.RefreshQuickSlot()
  544.  
  545. def __RampageGauge_OverIn(self):
  546. print "rampage_over_in"
  547. self.rampageGauge2.Show()
  548. self.rampageGauge1.Hide()
  549.  
  550. def __RampageGauge_OverOut(self):
  551. print "rampage_over_out"
  552. self.rampageGauge2.Hide()
  553. self.rampageGauge1.Show()
  554.  
  555. def __RampageGauge_Click(self):
  556. print "rampage_up"
  557. net.SendChatPacket("/in_game_mall")
  558. # gift icon hide when click mall icon
  559. # self.wndGiftBox.Hide()
  560.  
  561. def __LoadMouseSettings(self):
  562. try:
  563. LoadMouseButtonSettings()
  564. (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings()
  565. if not self.__IsInSafeMouseButtonSettingRange(mouseLeftButtonEvent) or not self.__IsInSafeMouseButtonSettingRange(mouseRightButtonEvent):
  566. raise RuntimeError, "INVALID_MOUSE_BUTTON_SETTINGS"
  567. except:
  568. InitMouseButtonSettings(self.EVENT_MOVE_AND_ATTACK, self.EVENT_CAMERA)
  569. (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings()
  570.  
  571. try:
  572. self.SelectMouseButtonEvent(self.MOUSE_BUTTON_LEFT, mouseLeftButtonEvent)
  573. self.SelectMouseButtonEvent(self.MOUSE_BUTTON_RIGHT, mouseRightButtonEvent)
  574. except:
  575. InitMouseButtonSettings(self.EVENT_MOVE_AND_ATTACK, self.EVENT_CAMERA)
  576. (mouseLeftButtonEvent, mouseRightButtonEvent) = GetMouseButtonSettings()
  577.  
  578. self.SelectMouseButtonEvent(self.MOUSE_BUTTON_LEFT, mouseLeftButtonEvent)
  579. self.SelectMouseButtonEvent(self.MOUSE_BUTTON_RIGHT, mouseRightButtonEvent)
  580.  
  581.  
  582.  
  583. def __IsInSafeMouseButtonSettingRange(self, arg):
  584. return arg >= self.EVENT_MOVE and arg <= self.EVENT_AUTO
  585.  
  586. def Destroy(self):
  587. SaveMouseButtonSettings()
  588.  
  589. self.ClearDictionary()
  590. self.mouseModeButtonList[0].ClearDictionary()
  591. self.mouseModeButtonList[1].ClearDictionary()
  592. self.mouseModeButtonList = 0
  593. self.curMouseModeButton = 0
  594. self.curSkillButton = 0
  595. self.selectSkillButtonList = 0
  596.  
  597.  
  598. self.expGauge = None
  599. self.hpGauge = None
  600. self.mpGauge = None
  601. self.stGauge = None
  602. self.hpRecoveryGaugeBar = None
  603. self.spRecoveryGaugeBar = None
  604.  
  605. self.tooltipItem = 0
  606. self.tooltipSkill = 0
  607. self.quickslot = 0
  608. self.toggleButtonDict = 0
  609.  
  610. self.hpGaugeBoard = 0
  611. self.mpGaugeBoard = 0
  612. self.stGaugeBoard = 0
  613.  
  614. self.expGaugeBoard = 0
  615.  
  616. self.tooltipHP = 0
  617. self.tooltipSP = 0
  618. self.tooltipST = 0
  619. self.tooltipEXP = 0
  620.  
  621. self.mouseImage = None
  622.  
  623. def __OnClickQuickPageUpButton(self):
  624. player.SetQuickPage(player.GetQuickPage()-1)
  625.  
  626. def __OnClickQuickPageDownButton(self):
  627. player.SetQuickPage(player.GetQuickPage()+1)
  628.  
  629. def SetToggleButtonEvent(self, eButton, kEventFunc):
  630. self.toggleButtonDict[eButton].SetEvent(kEventFunc)
  631.  
  632. def SetItemToolTip(self, tooltipItem):
  633. self.tooltipItem = tooltipItem
  634.  
  635. def SetSkillToolTip(self, tooltipSkill):
  636. self.tooltipSkill = tooltipSkill
  637. self.curSkillButton.SetSkillToolTip(self.tooltipSkill)
  638.  
  639. ## Mouse Image
  640. def ShowMouseImage(self):
  641. self.mouseImage.SetTop()
  642. self.mouseImage.Show()
  643.  
  644. def HideMouseImage(self):
  645. player.SetQuickCameraMode(False)
  646. self.mouseImage.Hide()
  647.  
  648. ## Gauge
  649. def RefreshStatus(self):
  650. curHP = player.GetStatus(player.HP)
  651. maxHP = player.GetStatus(player.MAX_HP)
  652. curSP = player.GetStatus(player.SP)
  653. maxSP = player.GetStatus(player.MAX_SP)
  654. curEXP = unsigned32(player.GetStatus(player.EXP))
  655. nextEXP = unsigned32(player.GetStatus(player.NEXT_EXP))
  656. recoveryHP = player.GetStatus(player.HP_RECOVERY)
  657. recoverySP = player.GetStatus(player.SP_RECOVERY)
  658.  
  659. self.RefreshStamina()
  660.  
  661. self.SetHP(curHP, recoveryHP, maxHP)
  662. self.SetSP(curSP, recoverySP, maxSP)
  663. self.SetExperience(curEXP, nextEXP)
  664.  
  665. def RefreshStamina(self):
  666. curST = player.GetStatus(player.STAMINA)
  667. maxST = player.GetStatus(player.MAX_STAMINA)
  668. self.SetST(curST, maxST)
  669.  
  670. def RefreshSkill(self):
  671. self.curSkillButton.RefreshSkill()
  672. for button in self.selectSkillButtonList:
  673. button.RefreshSkill()
  674.  
  675. def SetHP(self, curPoint, recoveryPoint, maxPoint):
  676. curPoint = min(curPoint, maxPoint)
  677. if maxPoint > 0:
  678. self.hpGauge.SetPercentage(curPoint, maxPoint)
  679. self.tooltipHP.SetText("%s : %d / %d" % (localeInfo.TASKBAR_HP, curPoint, maxPoint))
  680.  
  681. if 0 == recoveryPoint:
  682. self.hpRecoveryGaugeBar.Hide()
  683. else:
  684. destPoint = min(maxPoint, curPoint + recoveryPoint)
  685. newWidth = int(self.GAUGE_WIDTH * (float(destPoint) / float(maxPoint)))
  686. self.hpRecoveryGaugeBar.SetSize(newWidth, self.GAUGE_HEIGHT)
  687. self.hpRecoveryGaugeBar.Show()
  688.  
  689. def SetSP(self, curPoint, recoveryPoint, maxPoint):
  690. curPoint = min(curPoint, maxPoint)
  691. if maxPoint > 0:
  692. self.mpGauge.SetPercentage(curPoint, maxPoint)
  693. self.tooltipSP.SetText("%s : %d / %d" % (localeInfo.TASKBAR_SP, curPoint, maxPoint))
  694.  
  695. if 0 == recoveryPoint:
  696. self.spRecoveryGaugeBar.Hide()
  697. else:
  698. destPoint = min(maxPoint, curPoint + recoveryPoint)
  699. newWidth = int(self.GAUGE_WIDTH * (float(destPoint) / float(maxPoint)))
  700. self.spRecoveryGaugeBar.SetSize(newWidth, self.GAUGE_HEIGHT)
  701. self.spRecoveryGaugeBar.Show()
  702.  
  703. def SetST(self, curPoint, maxPoint):
  704. curPoint = min(curPoint, maxPoint)
  705. if maxPoint > 0:
  706. self.stGauge.SetPercentage(curPoint, maxPoint)
  707. self.tooltipST.SetText("%s : %d / %d" % (localeInfo.TASKBAR_ST, curPoint, maxPoint))
  708.  
  709. def SetExperience(self, curPoint, maxPoint):
  710.  
  711. curPoint = min(curPoint, maxPoint)
  712. curPoint = max(curPoint, 0)
  713. maxPoint = max(maxPoint, 0)
  714.  
  715. quarterPoint = maxPoint / 4
  716. FullCount = 0
  717.  
  718. if 0 != quarterPoint:
  719. FullCount = min(4, curPoint / quarterPoint)
  720.  
  721. for i in xrange(4):
  722. self.expGauge[i].Hide()
  723.  
  724. for i in xrange(FullCount):
  725. self.expGauge[i].SetRenderingRect(0.0, 0.0, 0.0, 0.0)
  726. self.expGauge[i].Show()
  727.  
  728. if 0 != quarterPoint:
  729. if FullCount < 4:
  730. Percentage = float(curPoint % quarterPoint) / quarterPoint - 1.0
  731. self.expGauge[FullCount].SetRenderingRect(0.0, Percentage, 0.0, 0.0)
  732. self.expGauge[FullCount].Show()
  733.  
  734. #####
  735. self.tooltipEXP.SetText("%s : %.2f%%" % (localeInfo.TASKBAR_EXP, float(curPoint) / max(1, float(maxPoint)) * 100))
  736.  
  737.  
  738. ## QuickSlot
  739. def RefreshQuickSlot(self):
  740.  
  741. pageNum = player.GetQuickPage()
  742.  
  743. try:
  744. self.quickPageNumImageBox.LoadImage(TaskBar.QUICKPAGE_NUMBER_FILENAME[pageNum])
  745. except:
  746. pass
  747.  
  748. startNumber = 0
  749. for slot in self.quickslot:
  750.  
  751. for i in xrange(4):
  752.  
  753. slotNumber = i+startNumber
  754.  
  755. (Type, Position) = player.GetLocalQuickSlot(slotNumber)
  756.  
  757. if player.SLOT_TYPE_NONE == Type:
  758. slot.ClearSlot(slotNumber)
  759. continue
  760.  
  761. if player.SLOT_TYPE_INVENTORY == Type:
  762.  
  763. itemIndex = player.GetItemIndex(Position)
  764. itemCount = player.GetItemCount(Position)
  765. if itemCount <= 1:
  766. itemCount = 0
  767.  
  768. ## 자동물약 (#72723, #72724) 특수처리 - 아이템인데도 슬롯에 활성화/비활성화 표시를 위한 작업임 - [hyo]
  769. if constInfo.IS_AUTO_POTION(itemIndex):
  770. # metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
  771. metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
  772.  
  773. if 0 != int(metinSocket[0]):
  774. slot.ActivateSlot(slotNumber)
  775. else:
  776. slot.DeactivateSlot(slotNumber)
  777.  
  778. slot.SetItemSlot(slotNumber, itemIndex, itemCount)
  779.  
  780. elif player.SLOT_TYPE_SKILL == Type:
  781.  
  782. skillIndex = player.GetSkillIndex(Position)
  783. if 0 == skillIndex:
  784. slot.ClearSlot(slotNumber)
  785. continue
  786.  
  787. skillType = skill.GetSkillType(skillIndex)
  788. if skill.SKILL_TYPE_GUILD == skillType:
  789. import guild
  790. skillGrade = 0
  791. skillLevel = guild.GetSkillLevel(Position)
  792.  
  793. else:
  794. skillGrade = player.GetSkillGrade(Position)
  795. skillLevel = player.GetSkillLevel(Position)
  796.  
  797. slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel)
  798. slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
  799. slot.SetCoverButton(slotNumber)
  800.  
  801. ## NOTE : CoolTime 체크
  802. if player.IsSkillCoolTime(Position):
  803. (coolTime, elapsedTime) = player.GetSkillCoolTime(Position)
  804. slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)
  805.  
  806. ## NOTE : Activate 되어 있다면 아이콘도 업데이트
  807. if player.IsSkillActive(Position):
  808. slot.ActivateSlot(slotNumber)
  809.  
  810. elif player.SLOT_TYPE_EMOTION == Type:
  811.  
  812. emotionIndex = Position
  813. slot.SetEmotionSlot(slotNumber, emotionIndex)
  814. slot.SetCoverButton(slotNumber)
  815. slot.SetSlotCount(slotNumber, 0)
  816.  
  817. slot.RefreshSlot()
  818. startNumber += 4
  819.  
  820. def canAddQuickSlot(self, Type, slotNumber):
  821.  
  822. if player.SLOT_TYPE_INVENTORY == Type:
  823.  
  824. itemIndex = player.GetItemIndex(slotNumber)
  825. return item.CanAddToQuickSlotItem(itemIndex)
  826.  
  827. return True
  828.  
  829. def AddQuickSlot(self, localSlotIndex):
  830. AttachedSlotType = mouseModule.mouseController.GetAttachedType()
  831. AttachedSlotNumber = mouseModule.mouseController.GetAttachedSlotNumber()
  832. AttachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()
  833.  
  834. if player.SLOT_TYPE_QUICK_SLOT == AttachedSlotType:
  835. player.RequestMoveGlobalQuickSlotToLocalQuickSlot(AttachedSlotNumber, localSlotIndex)
  836.  
  837. elif player.SLOT_TYPE_EMOTION == AttachedSlotType:
  838.  
  839. player.RequestAddLocalQuickSlot(localSlotIndex, AttachedSlotType, AttachedItemIndex)
  840.  
  841. elif True == self.canAddQuickSlot(AttachedSlotType, AttachedSlotNumber):
  842.  
  843. ## Online Code
  844. player.RequestAddLocalQuickSlot(localSlotIndex, AttachedSlotType, AttachedSlotNumber)
  845.  
  846. mouseModule.mouseController.DeattachObject()
  847. self.RefreshQuickSlot()
  848.  
  849. def SelectEmptyQuickSlot(self, slotIndex):
  850.  
  851. if True == mouseModule.mouseController.isAttached():
  852. self.AddQuickSlot(slotIndex)
  853.  
  854. def SelectItemQuickSlot(self, localQuickSlotIndex):
  855.  
  856. if True == mouseModule.mouseController.isAttached():
  857. self.AddQuickSlot(localQuickSlotIndex)
  858.  
  859. else:
  860. globalQuickSlotIndex=player.LocalQuickSlotIndexToGlobalQuickSlotIndex(localQuickSlotIndex)
  861. mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_QUICK_SLOT, globalQuickSlotIndex, globalQuickSlotIndex)
  862.  
  863. def UnselectItemQuickSlot(self, localSlotIndex):
  864.  
  865. if False == mouseModule.mouseController.isAttached():
  866. player.RequestUseLocalQuickSlot(localSlotIndex)
  867. return
  868.  
  869. elif mouseModule.mouseController.isAttached():
  870. mouseModule.mouseController.DeattachObject()
  871. return
  872.  
  873.  
  874. def OnUseSkill(self, usedSlotIndex, coolTime):
  875.  
  876. QUICK_SLOT_SLOT_COUNT = 4
  877. slotIndex = 0
  878.  
  879. ## Current Skill Button
  880. if usedSlotIndex == self.curSkillButton.GetSlotIndex():
  881. self.curSkillButton.Activate(coolTime)
  882.  
  883. ## Quick Slot
  884. for slotWindow in self.quickslot:
  885.  
  886. for i in xrange(QUICK_SLOT_SLOT_COUNT):
  887.  
  888. (Type, Position) = player.GetLocalQuickSlot(slotIndex)
  889.  
  890. if Type == player.SLOT_TYPE_SKILL:
  891. if usedSlotIndex == Position:
  892. slotWindow.SetSlotCoolTime(slotIndex, coolTime)
  893. return
  894.  
  895. slotIndex += 1
  896.  
  897. def OnActivateSkill(self, usedSlotIndex):
  898. slotIndex = 0
  899.  
  900. ## Current Skill Button
  901. if usedSlotIndex == self.curSkillButton.GetSlotIndex():
  902. self.curSkillButton.Deactivate()
  903.  
  904. ## Quick Slot
  905. for slotWindow in self.quickslot:
  906.  
  907. for i in xrange(4):
  908.  
  909. (Type, Position) = player.GetLocalQuickSlot(slotIndex)
  910.  
  911. if Type == player.SLOT_TYPE_SKILL:
  912. if usedSlotIndex == Position:
  913. slotWindow.ActivateSlot(slotIndex)
  914. return
  915.  
  916. slotIndex += 1
  917.  
  918. def OnDeactivateSkill(self, usedSlotIndex):
  919. slotIndex = 0
  920.  
  921. ## Current Skill Button
  922. if usedSlotIndex == self.curSkillButton.GetSlotIndex():
  923. self.curSkillButton.Deactivate()
  924.  
  925. ## Quick Slot
  926. for slotWindow in self.quickslot:
  927.  
  928. for i in xrange(4):
  929.  
  930. (Type, Position) = player.GetLocalQuickSlot(slotIndex)
  931.  
  932. if Type == player.SLOT_TYPE_SKILL:
  933. if usedSlotIndex == Position:
  934. slotWindow.DeactivateSlot(slotIndex)
  935. return
  936.  
  937. slotIndex += 1
  938.  
  939. ## ToolTip
  940. def OverInItem(self, slotNumber):
  941. if mouseModule.mouseController.isAttached():
  942. return
  943.  
  944. (Type, Position) = player.GetLocalQuickSlot(slotNumber)
  945.  
  946. if player.SLOT_TYPE_INVENTORY == Type:
  947. self.tooltipItem.SetInventoryItem(Position)
  948. self.tooltipSkill.HideToolTip()
  949.  
  950. elif player.SLOT_TYPE_SKILL == Type:
  951.  
  952. skillIndex = player.GetSkillIndex(Position)
  953. skillType = skill.GetSkillType(skillIndex)
  954.  
  955. if skill.SKILL_TYPE_GUILD == skillType:
  956. import guild
  957. skillGrade = 0
  958. skillLevel = guild.GetSkillLevel(Position)
  959.  
  960. else:
  961. skillGrade = player.GetSkillGrade(Position)
  962. skillLevel = player.GetSkillLevel(Position)
  963.  
  964. self.tooltipSkill.SetSkillNew(Position, skillIndex, skillGrade, skillLevel)
  965. self.tooltipItem.HideToolTip()
  966.  
  967. def OverOutItem(self):
  968. if 0 != self.tooltipItem:
  969. self.tooltipItem.HideToolTip()
  970. if 0 != self.tooltipSkill:
  971. self.tooltipSkill.HideToolTip()
  972.  
  973. def OnUpdate(self):
  974. if app.GetGlobalTime() - self.lastUpdateQuickSlot > 500:
  975. self.lastUpdateQuickSlot = app.GetGlobalTime()
  976. self.RefreshQuickSlot()
  977.  
  978. if True == self.hpGaugeBoard.IsIn():
  979. self.tooltipHP.Show()
  980. else:
  981. self.tooltipHP.Hide()
  982.  
  983. if True == self.mpGaugeBoard.IsIn():
  984. self.tooltipSP.Show()
  985. else:
  986. self.tooltipSP.Hide()
  987.  
  988. if True == self.stGaugeBoard.IsIn():
  989. self.tooltipST.Show()
  990. else:
  991. self.tooltipST.Hide()
  992.  
  993. if True == self.expGaugeBoard.IsIn():
  994. self.tooltipEXP.Show()
  995. else:
  996. self.tooltipEXP.Hide()
  997.  
  998. ## Skill
  999. def ToggleLeftMouseButtonModeWindow(self):
  1000.  
  1001. wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_LEFT]
  1002.  
  1003. if True == wndMouseButtonMode.IsShow():
  1004.  
  1005. wndMouseButtonMode.Hide()
  1006.  
  1007. else:
  1008. wndMouseButtonMode.Show()
  1009.  
  1010. def ToggleRightMouseButtonModeWindow(self):
  1011.  
  1012. wndMouseButtonMode = self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT]
  1013.  
  1014. if True == wndMouseButtonMode.IsShow():
  1015.  
  1016. wndMouseButtonMode.Hide()
  1017. self.CloseSelectSkill()
  1018.  
  1019. else:
  1020. wndMouseButtonMode.Show()
  1021. self.OpenSelectSkill()
  1022.  
  1023. def OpenSelectSkill(self):
  1024.  
  1025. PAGE_SLOT_COUNT = 6
  1026.  
  1027. (xSkillButton, y) = self.curSkillButton.GetGlobalPosition()
  1028. y -= (37 + 32 + 1)
  1029.  
  1030. for key in self.skillCategoryNameList:
  1031.  
  1032. appendCount = 0
  1033. startNumber = self.skillPageStartSlotIndexDict[key]
  1034. x = xSkillButton
  1035.  
  1036. getSkillIndex=player.GetSkillIndex
  1037. getSkillLevel=player.GetSkillLevel
  1038. for i in xrange(PAGE_SLOT_COUNT):
  1039.  
  1040. skillIndex = getSkillIndex(startNumber+i)
  1041. skillLevel = getSkillLevel(startNumber+i)
  1042.  
  1043. if 0 == skillIndex:
  1044. continue
  1045. if 0 == skillLevel:
  1046. continue
  1047. if skill.IsStandingSkill(skillIndex):
  1048. continue
  1049.  
  1050. ## FIXME : 스킬 하나당 슬롯 하나씩 할당하는건 아무리 봐도 부하가 크다.
  1051. ## 이 부분은 시간을 나면 고치도록. - [levites]
  1052. skillButton = self.SkillButton()
  1053. skillButton.SetSkill(startNumber+i)
  1054. skillButton.SetPosition(x, y)
  1055. skillButton.SetSkillEvent(ui.__mem_func__(self.CloseSelectSkill), startNumber+i+1)
  1056. skillButton.SetSkillToolTip(self.tooltipSkill)
  1057. skillButton.SetTop()
  1058. skillButton.Show()
  1059. self.selectSkillButtonList.append(skillButton)
  1060.  
  1061. appendCount += 1
  1062. x -= 32
  1063.  
  1064. if appendCount > 0:
  1065. y -= 32
  1066.  
  1067. def CloseSelectSkill(self, slotIndex=-1):
  1068.  
  1069. self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT].Hide()
  1070. for button in self.selectSkillButtonList:
  1071. button.Destroy()
  1072.  
  1073. self.selectSkillButtonList = []
  1074.  
  1075. if -1 != slotIndex:
  1076. self.curSkillButton.Show()
  1077. self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide()
  1078. player.SetMouseFunc(player.MBT_RIGHT, player.MBF_SKILL)
  1079. player.ChangeCurrentSkillNumberOnly(slotIndex-1)
  1080. else:
  1081. self.curSkillButton.Hide()
  1082. self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Show()
  1083.  
  1084. def SelectMouseButtonEvent(self, dir, event):
  1085. SetMouseButtonSetting(dir, event)
  1086.  
  1087. self.CloseSelectSkill()
  1088. self.mouseModeButtonList[dir].Hide()
  1089.  
  1090. btn = 0
  1091. type = self.NONE
  1092. func = self.NONE
  1093. tooltip_text = ""
  1094.  
  1095. if self.MOUSE_BUTTON_LEFT == dir:
  1096. type = player.MBT_LEFT
  1097.  
  1098. elif self.MOUSE_BUTTON_RIGHT == dir:
  1099. type = player.MBT_RIGHT
  1100.  
  1101. if self.EVENT_MOVE == event:
  1102. btn = self.mouseModeButtonList[dir].GetChild("button_move")
  1103. func = player.MBF_MOVE
  1104. tooltip_text = localeInfo.TASKBAR_MOVE
  1105. elif self.EVENT_ATTACK == event:
  1106. btn = self.mouseModeButtonList[dir].GetChild("button_attack")
  1107. func = player.MBF_ATTACK
  1108. tooltip_text = localeInfo.TASKBAR_ATTACK
  1109. elif self.EVENT_AUTO == event:
  1110. btn = self.mouseModeButtonList[dir].GetChild("button_auto_attack")
  1111. func = player.MBF_AUTO
  1112. tooltip_text = localeInfo.TASKBAR_AUTO
  1113. elif self.EVENT_MOVE_AND_ATTACK == event:
  1114. btn = self.mouseModeButtonList[dir].GetChild("button_move_and_attack")
  1115. func = player.MBF_SMART
  1116. tooltip_text = localeInfo.TASKBAR_ATTACK
  1117. elif self.EVENT_CAMERA == event:
  1118. btn = self.mouseModeButtonList[dir].GetChild("button_camera")
  1119. func = player.MBF_CAMERA
  1120. tooltip_text = localeInfo.TASKBAR_CAMERA
  1121. elif self.EVENT_SKILL == event:
  1122. btn = self.mouseModeButtonList[dir].GetChild("button_skill")
  1123. func = player.MBF_SKILL
  1124. tooltip_text = localeInfo.TASKBAR_SKILL
  1125.  
  1126. if 0 != btn:
  1127. self.curMouseModeButton[dir].SetToolTipText(tooltip_text, 0, -18)
  1128. self.curMouseModeButton[dir].SetUpVisual(btn.GetUpVisualFileName())
  1129. self.curMouseModeButton[dir].SetOverVisual(btn.GetOverVisualFileName())
  1130. self.curMouseModeButton[dir].SetDownVisual(btn.GetDownVisualFileName())
  1131. self.curMouseModeButton[dir].Show()
  1132.  
  1133. player.SetMouseFunc(type, func)
  1134.  
  1135. def OnChangeCurrentSkill(self, skillSlotNumber):
  1136. self.curSkillButton.SetSkill(skillSlotNumber)
  1137. self.curSkillButton.Show()
  1138. self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement