unitframes: add clickcasting support for tbc

This commit is contained in:
shagu
2020-03-08 10:39:18 +01:00
parent 3024a42644
commit 369cd813fd
+25 -2
View File
@@ -898,8 +898,31 @@ function pfUI.uf:EnableScripts()
-- handle secure unit button templates (> vanilla)
if f.SetAttribute then
f.showmenu = pfUI.uf.RightClickAction
f:SetAttribute("type1", "target")
f:SetAttribute("type2", "showmenu")
f:SetAttribute("*type1", "target")
f:SetAttribute("*type2", "showmenu")
if f.config.clickcast == "1" then
-- clickcast: shift modifier
if pfUI_config.unitframes.clickcast_shift ~= "" then
f:SetAttribute("shift-type1", "spell")
f:SetAttribute("shift-spell1", pfUI_config.unitframes.clickcast_shift)
end
-- clickcast: alt modifier
if pfUI_config.unitframes.clickcast_alt ~= "" then
f:SetAttribute("alt-type1", "spell")
f:SetAttribute("alt-spell1", pfUI_config.unitframes.clickcast_alt)
end
-- clickcast: ctrl modifier
if pfUI_config.unitframes.clickcast_ctrl ~= "" then
f:SetAttribute("ctrl-type1", "spell")
f:SetAttribute("ctrl-spell1", pfUI_config.unitframes.clickcast_ctrl)
end
-- clickcast: default
if pfUI_config.unitframes.clickcast ~= "" then
f:SetAttribute("type1", "spell")
f:SetAttribute("spell1", pfUI_config.unitframes.clickcast)
end
end
else
f:SetScript("OnClick", pfUI.uf.OnClick)
end