Advertisement
deadx2

Untitled

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