View Single Post
04-09-19, 05:09 PM   #1
GreyFox777
A Cliff Giant
Join Date: Jan 2017
Posts: 75
Glow color issue

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:
  1. -- Castbar (Centered)
  2. do
  3.         local s = CreateFrame("StatusBar", "oUF_LumenCastbar"..self.unitType, self)
  4.         s:RegisterEvent("PLAYER_ENTERING_WORLD")
  5.         s:RegisterEvent("UNIT_FLAGS")
  6.         s:RegisterEvent("PLAYER_TARGET_CHANGED")
  7.         s:RegisterEvent("UNIT_SPELLCAST_START")
  8.         s:RegisterEvent("UNIT_SPELLCAST_STOP")
  9.         s:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START")
  10.         s:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
  11.         s:RegisterEvent("UNIT_SPELLCAST_FAILED")
  12.  
  13.         s:SetScript("OnEvent", function()
  14.         if UnitExists("target") and UnitReaction("target", "player") ~= nil and UnitReaction("target", "player") <5 then
  15.         s:SetPoint("CENTER", UIParent, 0,-195)
  16. else
  17.         s:SetPoint("CENTER", UIParent, 0,-3195)
  18. end
  19. end)
  20.         s:SetHeight(26)
  21.         s:SetWidth(433)
  22.         s:SetStatusBarTexture(m.textures.status_texture)
  23.         s:SetFrameStrata("BACKGROUND")
  24.         s:SetFrameLevel(13)
  25. --      s.CompleteColor = {0.0, 0, 0,0}
  26.         s.FailColor = {1.0, 0.00, 0.00}
  27.     -- Helper
  28.         local h = CreateFrame("Frame", nil, s)
  29.         h:SetFrameLevel(0)
  30.         h:SetPoint("TOPLEFT", -4, 4)
  31.         h:SetPoint("BOTTOMRIGHT", 4, -4)
  32.     -- Backdrop
  33.         local b = s:CreateTexture(nil, "BORDER")
  34.         b:SetTexture(m.textures.status_texture)
  35.         b:SetAllPoints(s)
  36.     -- Glow
  37.         g = CreateFrame("Frame", nil, s)
  38.         g:SetScale(4)
  39.         g:SetPoint("TOPLEFT", s, "TOPLEFT", -6, 6)
  40.         g:SetPoint("BOTTOMRIGHT", s, "BOTTOMRIGHT", 6, -6)
  41.         g:SetBackdrop({edgeFile =  m.textures.glow_texture,
  42.         tile = false, tileSize = 10, edgeSize = 6, insets = {left = -4, right = -4, top = -4, bottom = -4}})
  43.         s.FailColor = {1.0, 0.00, 0.00}
  44.     -- Spark
  45.         local sp = s:CreateTexture(nil, "ARTWORK", nil, 1)
  46.         sp:SetBlendMode("ADD")
  47.         sp:SetAlpha(0.5)
  48.         sp:SetHeight(s:GetHeight()*2.5)
  49.     -- Spell text
  50.         local txt = core.createFontString(s, font, cfg.fontsize +2, "THINOUTLINE", 8, 27, "LEFT", 150)
  51.         txt:SetPoint("LEFT", 26, -1)
  52.         txt:SetJustifyH("LEFT")
  53.         txt:SetPoint("RIGHT", s, "LEFT", 450, 0)
  54.     -- Time
  55.         local t = core.createFontString(s, font, cfg.fontsize +2, "THINOUTLINE", 8, 27, "LEFT", 150)
  56.         t:SetPoint("RIGHT", 0, 0)
  57.     -- Icon
  58.         local i = s:CreateTexture(nil, "ARTWORK", nil, 1)
  59.         i:SetPoint("RIGHT",s,"LEFT",24,0)
  60.         i:SetSize(s:GetHeight(),s:GetHeight())
  61.         i:SetTexCoord(0.1, 0.9, 0.1, 0.9)
  62.     -- Helper2 for icon
  63.         local h2 = CreateFrame("Frame", nil, s)
  64.         h2:SetFrameLevel(0)
  65.         h2:SetPoint("TOPLEFT", i, "TOPLEFT", -4, 4)
  66.         h2:SetPoint("BOTTOMRIGHT", i,"BOTTOMRIGHT", 4, -4)
  67.  
  68.         s.OnUpdate = cast.OnCastbarUpdate
  69.         s.PostCastStart = cast.PostCastStartTargetCentered
  70.         s.PostChannelStart = cast.PostCastStartTargetCentered
  71. --      s.PostCastStop = cast.PostCastStop
  72. --      s.PostChannelStop = cast.PostChannelStop
  73.         s.PostCastFailed = cast.PostCastFailedTargetCentered
  74.         s.PostCastInterrupted = cast.PostCastFailedTargetCentered
  75.  
  76.         self.CastbarTargetCentered = s
  77.         self.CastbarTargetCentered.bg = b
  78.         self.CastbarTargetCentered.Text = txt
  79.         self.CastbarTargetCentered.Time = t
  80.         self.CastbarTargetCentered.Icon = i
  81.         self.CastbarTargetCentered.Spark = sp
  82. self.CastbarTargetCentered:Hide()
  83. end

and castbar lua:

Lua Code:
  1. if not (self.notInterruptible) and UnitCanAttack("player", unit) then
  2. self:SetStatusBarColor(unpack(cfg.colors.interruptiblecolor))
  3. g:SetBackdropBorderColor(unpack(cfg.colors.interruptiblecolor))
  4. end

here i get always error now:
Code:
attempt to call method 'SetBackdropBorderColor' (a nil value)
.
  Reply With Quote