actionbar: update usable on range change

This commit is contained in:
shagu
2019-12-23 02:11:05 +01:00
parent f47cf6255e
commit fb2c3bad79
+15 -15
View File
@@ -368,21 +368,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
end
local function ButtonRangeUpdate(self)
local self = self or this
-- update range display
if C.bars.glowrange == "1" and self.bar ~= 11 and self.bar ~= 12 and HasAction(self.id) and ActionHasRange(self.id) and IsActionInRange(self.id) == 0 then
if not self.outofrange then
self.outofrange = true
updatecache[self.slot] = true
end
elseif self.outofrange then
self.outofrange = nil
updatecache[self.slot] = true
end
end
local function ButtonDrag(self)
local self = self or this
@@ -524,6 +509,21 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
end
end
local function ButtonRangeUpdate(self)
local self = self or this
-- update range display
if C.bars.glowrange == "1" and self.bar ~= 11 and self.bar ~= 12 and HasAction(self.id) and ActionHasRange(self.id) and IsActionInRange(self.id) == 0 then
if not self.outofrange then
self.outofrange = true
ButtonUpdateUsable(self)
end
elseif self.outofrange then
self.outofrange = nil
ButtonUpdateUsable(self)
end
end
local function ButtonUpdateCooldown(button)
if not button then return end
local start, duration, enable