attack on right mouse click (#48)

This commit is contained in:
Khiu
2025-09-05 11:51:45 -07:00
committed by GitHub
parent f2ab38b40e
commit 3e98efcdc0
+9 -1
View File
@@ -280,7 +280,14 @@ ui.BarUpdate = function()
end
ui.BarClick = function()
TargetUnit(this.parent.guid)
if arg1 == "LeftButton" then
TargetUnit(this.parent.guid)
elseif arg1 == "RightButton" then
TargetUnit(this.parent.guid)
if (not PlayerFrame.inCombat) then
AttackTarget()
end
end
end
local function CreateBarFirstSection(unitFrame, guid)
@@ -349,6 +356,7 @@ local function CreateBarSecondSection(unitFrame, guid)
unitFrame.secondSection = secondSection
secondSection.parent = unitFrame
secondSection:RegisterForClicks("LeftButtonUp", "RightButtonUp")
secondSection:SetScript("OnClick", ui.BarClick)
secondSection:SetScript("OnEnter", ui.BarEnter)
secondSection:SetScript("OnLeave", ui.BarLeave)