Commit 62d5b1b8 authored by Blazeflack's avatar Blazeflack

Fixed border color issue in CastbarCustomBackdrop tweak

parent c06aed4e
......@@ -44,7 +44,7 @@ end
CT.Configs["CastbarCustomBackdrop"] = ConfigTable
if not isEnabled then return; end
local function PostCastStart(self, unit, name, castid)
local function PostCastChannelStart(self, unit)
local db = self:GetParent().db
if not db or not db.castbar then return; end
......@@ -55,33 +55,12 @@ local function PostCastStart(self, unit, name, castid)
self.bg:SetColorTexture(r, g, b)
else
if self.backdrop then
self.backdrop:SetBackdropColor(r, g, b, a)
if self.backdrop.backdropTexture then
self.backdrop.backdropTexture:SetVertexColor(r, g, b)
self.backdrop.backdropTexture:SetAlpha(a)
end
end
end
end
local function PostChannelStart(self, unit, name, castid)
local db = self:GetParent().db
if not db or not db.castbar then return; end
local color = E.db.CustomTweaks.CastbarCustomBackdrop.backdropColor
local r, g, b, a = color.r, color.g, color.b, color.a
if self.bg and self.bg:IsShown() then
self.bg:SetColorTexture(r, g, b)
else
if self.backdrop then
r, g, b = self.backdrop:GetBackdropColor()
self.backdrop:SetBackdropColor(r, g, b, a)
if self.backdrop.backdropTexture then
self.backdrop.backdropTexture:SetVertexColor(r, g, b)
self.backdrop.backdropTexture:SetAlpha(a)
end
end
end
end
......@@ -96,12 +75,12 @@ local function PostCastInterruptible(self, unit)
self.bg:SetColorTexture(r, g, b)
else
if self.backdrop then
self.backdrop:SetBackdropColor(r, g, b, a)
if self.backdrop.backdropTexture then
self.backdrop.backdropTexture:SetVertexColor(r, g, b)
self.backdrop.backdropTexture:SetAlpha(a)
end
r, g, b = self.backdrop:GetBackdropColor()
self.backdrop:SetBackdropColor(r, g, b, a)
end
end
end
......@@ -115,27 +94,27 @@ f:SetScript("OnEvent", function(self)
local unitframe = _G["ElvUF_"..unit];
local castbar = unitframe and unitframe.Castbar
if castbar then
hooksecurefunc(castbar, "PostCastStart", PostCastStart)
hooksecurefunc(castbar, "PostCastStart", PostCastChannelStart)
hooksecurefunc(castbar, "PostCastInterruptible", PostCastInterruptible)
hooksecurefunc(castbar, "PostChannelStart", PostChannelStart)
hooksecurefunc(castbar, "PostChannelStart", PostCastChannelStart)
end
end
for i = 1, 5 do
local castbar = _G["ElvUF_Arena"..i].Castbar
if castbar then
hooksecurefunc(castbar, "PostCastStart", PostCastStart)
hooksecurefunc(castbar, "PostCastStart", PostCastChannelStart)
hooksecurefunc(castbar, "PostCastInterruptible", PostCastInterruptible)
hooksecurefunc(castbar, "PostChannelStart", PostChannelStart)
hooksecurefunc(castbar, "PostChannelStart", PostCastChannelStart)
end
end
for i = 1, MAX_BOSS_FRAMES do
local castbar = _G["ElvUF_Boss"..i].Castbar
if castbar then
hooksecurefunc(castbar, "PostCastStart", PostCastStart)
hooksecurefunc(castbar, "PostCastStart", PostCastChannelStart)
hooksecurefunc(castbar, "PostCastInterruptible", PostCastInterruptible)
hooksecurefunc(castbar, "PostChannelStart", PostChannelStart)
hooksecurefunc(castbar, "PostChannelStart", PostCastChannelStart)
end
end
end)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment