mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
unitframes: allow to use macros in clickcasting
This commit is contained in:
+19
-3
@@ -1609,8 +1609,18 @@ function pfUI.uf:EnableClickCast()
|
|||||||
if self.SetAttribute then
|
if self.SetAttribute then
|
||||||
-- set attributes for tbc+
|
-- set attributes for tbc+
|
||||||
local prefix = modifier == "" and "" or modifier .. "-"
|
local prefix = modifier == "" and "" or modifier .. "-"
|
||||||
self:SetAttribute(prefix.."type"..bid, "spell")
|
|
||||||
self:SetAttribute(prefix.."spell"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
|
-- check for "/" in the beginning of the string, to detect macros
|
||||||
|
if string.find(pfUI_config.unitframes["clickcast"..bconf..mconf], "^%/(.+)") then
|
||||||
|
self:SetAttribute(prefix.."type"..bid, "macro")
|
||||||
|
self:SetAttribute(prefix.."macrotext"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
|
||||||
|
self:SetAttribute(prefix.."spell"..bid, nil)
|
||||||
|
else
|
||||||
|
self:SetAttribute(prefix.."type"..bid, "spell")
|
||||||
|
self:SetAttribute(prefix.."spell"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
|
||||||
|
self:SetAttribute(prefix.."macro"..bid, nil)
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
-- fill clickaction table for vanillla
|
-- fill clickaction table for vanillla
|
||||||
self.clickactions = self.clickactions or {}
|
self.clickactions = self.clickactions or {}
|
||||||
@@ -1646,7 +1656,13 @@ function pfUI.uf:ClickAction(button)
|
|||||||
if this.clickactions and this.clickactions[modstring] then
|
if this.clickactions and this.clickactions[modstring] then
|
||||||
local tswitch = UnitIsUnit(unitstr, "target")
|
local tswitch = UnitIsUnit(unitstr, "target")
|
||||||
TargetUnit(unitstr)
|
TargetUnit(unitstr)
|
||||||
CastSpellByName(this.clickactions[modstring])
|
|
||||||
|
if string.find(this.clickactions[modstring], "^%/(.+)") then
|
||||||
|
RunMacroText(this.clickactions[modstring])
|
||||||
|
else
|
||||||
|
CastSpellByName(this.clickactions[modstring])
|
||||||
|
end
|
||||||
|
|
||||||
if not tswitch then TargetLastTarget() end
|
if not tswitch then TargetLastTarget() end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user