Have some issue with api started last week.
My cast bar glowing texture are not working anymore (blizzard changes something)
Now i cannot understand what is actually wrong...
i post the piece of code, if some one can help
target.lua:
Lua Code:
-- Castbar (Centered)
do
local s = CreateFrame("StatusBar", "oUF_LumenCastbar"..self.unitType, self)
s:RegisterEvent("PLAYER_ENTERING_WORLD")
s:RegisterEvent("UNIT_FLAGS")
s:RegisterEvent("PLAYER_TARGET_CHANGED")
s:RegisterEvent("UNIT_SPELLCAST_START")
s:RegisterEvent("UNIT_SPELLCAST_STOP")
s:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
s:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
s:RegisterEvent("UNIT_SPELLCAST_FAILED")
s:SetScript("OnEvent", function()
if UnitExists("target") and UnitReaction("target", "player") ~= nil and UnitReaction("target", "player") <5 then
s:SetPoint("CENTER", UIParent, 0,-195)
else
s:SetPoint("CENTER", UIParent, 0,-3195)
end
end)
s:SetHeight(26)
s:SetWidth(433)
s:SetStatusBarTexture(m.textures.status_texture)
s:SetFrameStrata("BACKGROUND")
s:SetFrameLevel(13)
-- s.CompleteColor = {0.0, 0, 0,0}
s.FailColor = {1.0, 0.00, 0.00}
-- Helper
local h = CreateFrame("Frame", nil, s)
h:SetFrameLevel(0)
h:SetPoint("TOPLEFT", -4, 4)
h:SetPoint("BOTTOMRIGHT", 4, -4)
-- Backdrop
local b = s:CreateTexture(nil, "BORDER")
b:SetTexture(m.textures.status_texture)
b:SetAllPoints(s)
-- Glow
g = CreateFrame("Frame", nil, s)
g:SetScale(4)
g:SetPoint("TOPLEFT", s, "TOPLEFT", -6, 6)
g:SetPoint("BOTTOMRIGHT", s, "BOTTOMRIGHT", 6, -6)
g:SetBackdrop({edgeFile = m.textures.glow_texture,
tile = false, tileSize = 10, edgeSize = 6, insets = {left = -4, right = -4, top = -4, bottom = -4}})
s.FailColor = {1.0, 0.00, 0.00}
-- Spark
local sp = s:CreateTexture(nil, "ARTWORK", nil, 1)
sp:SetBlendMode("ADD")
sp:SetAlpha(0.5)
sp:SetHeight(s:GetHeight()*2.5)
-- Spell text
local txt = core.createFontString(s, font, cfg.fontsize +2, "THINOUTLINE", 8, 27, "LEFT", 150)
txt:SetPoint("LEFT", 26, -1)
txt:SetJustifyH("LEFT")
txt:SetPoint("RIGHT", s, "LEFT", 450, 0)
-- Time
local t = core.createFontString(s, font, cfg.fontsize +2, "THINOUTLINE", 8, 27, "LEFT", 150)
t:SetPoint("RIGHT", 0, 0)
-- Icon
local i = s:CreateTexture(nil, "ARTWORK", nil, 1)
i:SetPoint("RIGHT",s,"LEFT",24,0)
i:SetSize(s:GetHeight(),s:GetHeight())
i:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-- Helper2 for icon
local h2 = CreateFrame("Frame", nil, s)
h2:SetFrameLevel(0)
h2:SetPoint("TOPLEFT", i, "TOPLEFT", -4, 4)
h2:SetPoint("BOTTOMRIGHT", i,"BOTTOMRIGHT", 4, -4)
s.OnUpdate = cast.OnCastbarUpdate
s.PostCastStart = cast.PostCastStartTargetCentered
s.PostChannelStart = cast.PostCastStartTargetCentered
-- s.PostCastStop = cast.PostCastStop
-- s.PostChannelStop = cast.PostChannelStop
s.PostCastFailed = cast.PostCastFailedTargetCentered
s.PostCastInterrupted = cast.PostCastFailedTargetCentered
self.CastbarTargetCentered = s
self.CastbarTargetCentered.bg = b
self.CastbarTargetCentered.Text = txt
self.CastbarTargetCentered.Time = t
self.CastbarTargetCentered.Icon = i
self.CastbarTargetCentered.Spark = sp
self.CastbarTargetCentered:Hide()
end
and castbar lua:
Lua Code:
if not (self.notInterruptible) and UnitCanAttack("player", unit) then
self:SetStatusBarColor(unpack(cfg.colors.interruptiblecolor))
g:SetBackdropBorderColor(unpack(cfg.colors.interruptiblecolor))
end
here i get always error now:
Code:
attempt to call method 'SetBackdropBorderColor' (a nil value)
.