コード例 #1
0
    def SelectMouseButtonEvent(self, dir, event):
        SetMouseButtonSetting(dir, event)

        self.CloseSelectSkill()
        self.mouseModeButtonList[dir].Hide()

        btn = 0
        type = self.NONE
        func = self.NONE
        tooltip_text = ""

        if self.MOUSE_BUTTON_LEFT == dir:
            type = player.MBT_LEFT

        elif self.MOUSE_BUTTON_RIGHT == dir:
            type = player.MBT_RIGHT

        if self.EVENT_MOVE == event:
            btn = self.mouseModeButtonList[dir].GetChild("button_move")
            func = player.MBF_MOVE
            tooltip_text = localeInfo.TASKBAR_MOVE
        elif self.EVENT_ATTACK == event:
            btn = self.mouseModeButtonList[dir].GetChild("button_attack")
            func = player.MBF_ATTACK
            tooltip_text = localeInfo.TASKBAR_ATTACK
        elif self.EVENT_AUTO == event:
            btn = self.mouseModeButtonList[dir].GetChild("button_auto_attack")
            func = player.MBF_AUTO
            tooltip_text = localeInfo.TASKBAR_AUTO
        elif self.EVENT_MOVE_AND_ATTACK == event:
            btn = self.mouseModeButtonList[dir].GetChild(
                "button_move_and_attack")
            func = player.MBF_SMART
            tooltip_text = localeInfo.TASKBAR_ATTACK
        elif self.EVENT_CAMERA == event:
            btn = self.mouseModeButtonList[dir].GetChild("button_camera")
            func = player.MBF_CAMERA
            tooltip_text = localeInfo.TASKBAR_CAMERA
        elif self.EVENT_SKILL == event:
            btn = self.mouseModeButtonList[dir].GetChild("button_skill")
            func = player.MBF_SKILL
            tooltip_text = localeInfo.TASKBAR_SKILL

        if 0 != btn:
            self.curMouseModeButton[dir].SetToolTipText(tooltip_text, 0, -18)
            self.curMouseModeButton[dir].SetUpVisual(btn.GetUpVisualFileName())
            self.curMouseModeButton[dir].SetOverVisual(
                btn.GetOverVisualFileName())
            self.curMouseModeButton[dir].SetDownVisual(
                btn.GetDownVisualFileName())
            self.curMouseModeButton[dir].Show()

        player.SetMouseFunc(type, func)
コード例 #2
0
ファイル: uitaskbar.py プロジェクト: Reizonr1/metin2-adv
	def CloseSelectSkill(self, slotIndex=-1):

		self.mouseModeButtonList[self.MOUSE_BUTTON_RIGHT].Hide()
		for button in self.selectSkillButtonList:
			button.Destroy()

		self.selectSkillButtonList = []

		if -1 != slotIndex:
			self.curSkillButton.Show()
			self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Hide()
			player.SetMouseFunc(player.MBT_RIGHT, player.MBF_SKILL)
			player.ChangeCurrentSkillNumberOnly(slotIndex-1)
		else:
			self.curSkillButton.Hide()
			self.curMouseModeButton[self.MOUSE_BUTTON_RIGHT].Show()