From 369cd813fd64a4b0fe043f2773d055d2b0f8d713 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 8 Mar 2020 10:39:18 +0100 Subject: [PATCH] unitframes: add clickcasting support for tbc --- api/unitframes.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 9004016f..d2df5e5b 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -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