actionbar: add option to change animation trigger

This commit is contained in:
shagu
2020-03-28 12:52:39 +01:00
parent 797563e9eb
commit f5c285753a
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -459,6 +459,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "altself", "0")
pfUI:UpdateConfig("bars", nil, "rightself", "0")
pfUI:UpdateConfig("bars", nil, "animation", "zoomfade")
pfUI:UpdateConfig("bars", nil, "animmode", "keypress")
pfUI:UpdateConfig("bars", nil, "animalways", "0")
pfUI:UpdateConfig("bars", nil, "reagents", "1")
pfUI:UpdateConfig("bars", nil, "hunterbar", "0")
+6 -1
View File
@@ -275,7 +275,7 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
-- trigger action animation
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
if self:GetAlpha() > .1 or C.bars.animalways == "1" then
if C.bars.animmode == "keypress" and ( self:GetAlpha() > .1 or C.bars.animalways == "1" ) then
self.animation.active = 0
self.animation:Show()
end
@@ -401,6 +401,11 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
-- active border
if active then
if C.bars.animmode == "statechange" and not self.active:IsShown() then
self.animation.active = 0
self.animation:Show()
end
self.backdrop:SetBackdropBorderColor(cr,cg,cb,1)
self.active:Show()
else
+5
View File
@@ -1115,6 +1115,10 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
"elasticzoom:" .. T["Elastic Zoom"],
"wobblezoom:" .. T["Wobble Zoom"],
},
["animationmode"] = {
"keypress:" .. T["On Key Press"],
"statechange:" .. T["On State Change"]
},
["actionbarbuttons"] = {
"1","2","3","4","5","6","7","8","9","10","11","12"
},
@@ -1828,6 +1832,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
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["Button Animation Trigger"], C.bars, "animmode", "dropdown", pfUI.gui.dropdowns.animationmode)
CreateConfig(U["bars"], T["Show Animation On Hidden Bars"], C.bars, "animalways", "checkbox")
CreateConfig(U["bars"], T["Show Reagent Count"], C.bars, "reagents", "checkbox")
CreateConfig(U["bars"], T["Highlight Equipped Items"], C.bars, "showequipped", "checkbox")