actionbar: add option to selfcast on rightclick

This commit is contained in:
shagu
2020-03-28 12:02:20 +01:00
parent 27ab717482
commit 013dcdc4f8
3 changed files with 9 additions and 1 deletions
+1
View File
@@ -457,6 +457,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "keydown", "0")
pfUI:UpdateConfig("bars", nil, "altself", "0")
pfUI:UpdateConfig("bars", nil, "rightself", "0")
pfUI:UpdateConfig("bars", nil, "animation", "zoomfade")
pfUI:UpdateConfig("bars", nil, "animalways", "0")
pfUI:UpdateConfig("bars", nil, "reagents", "1")
+6
View File
@@ -296,6 +296,7 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
local mouse = arg1 and not keystate
local keystate = keystate
local slfcast = C.bars.altself == "1" and IsAltKeyDown() and true or self.slfcast
slfcast = C.bars.rightself == "1" and arg1 and arg1 == "RightButton" and true or slfcast
self.slfcast = nil
if ( pfUI_config.bars.keydown == "1" and keystate == "down" ) or (pfUI_config.bars.keydown == "0" and keystate == "up" ) or self.bar == 11 or mouse then
@@ -834,6 +835,11 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
f:SetAttribute(("*type-S%dRight"):format(state), "action")
f:SetAttribute(("*action-S%d"):format(state), action)
f:SetAttribute(("*action-S%dRight"):format(state), action)
if C.bars.rightself == "1" then
f:SetAttribute(("*unit-S%dRight"):format(state), "player")
else
f:SetAttribute(("*unit-S%dRight"):format(state), nil)
end
end
end
end
+2 -1
View File
@@ -1825,7 +1825,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateGUIEntry(T["Actionbar"], T["General"], function()
CreateConfig(U["bars"], T["Trigger Actions On Key Down"], C.bars, "keydown", "checkbox")
CreateConfig(U["bars"], T["Alt Self Cast For All Hotkeys"], C.bars, "altself", "checkbox")
CreateConfig(U["bars"], T["Self Cast: Alt Key"], C.bars, "altself", "checkbox")
CreateConfig(U["bars"], T["Self Cast: Right Click"], C.bars, "rightself", "checkbox")
CreateConfig(U["bars"], T["Button Animation"], C.bars, "animation", "dropdown", pfUI.gui.dropdowns.actionbuttonanimations)
CreateConfig(U["bars"], T["Show Animation On Hidden Bars"], C.bars, "animalways", "checkbox")
CreateConfig(U["bars"], T["Show Reagent Count"], C.bars, "reagents", "checkbox")