View Single Post
08-12-15, 02:44 PM   #1
evilbib
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 30
ADDON_LOADED does not work

So this code below does nothing. No errors.
If I remove the "if addon" line it works, but then it will be executed multiple times. This did work before 6.2.

Somebody can help me?

Lua Code:
  1. local function ApplySkin(self, event, addon)
  2.     if addon == "Skada" then
  3.         local SkadaDisplayBar = Skada.displays["bar"]
  4.         hooksecurefunc(SkadaDisplayBar, "AddDisplayOptions", function(self, win, options)
  5.             options.titleoptions = nil
  6.             options.windowoptions = nil
  7.         end)
  8.         hooksecurefunc(SkadaDisplayBar, "Create", function(self, win)
  9.             local skada = win.bargroup         
  10.             local skadaBorder = CreateFrame("Frame", nil, skada, skada)
  11.             skadaBorder:SetAllPoints()
  12.             skadaBorder:CreateBeautyBorder(12)
  13.             skadaBorder:SetBeautyBorderPadding(3)
  14.         end)
  15.         hooksecurefunc(SkadaDisplayBar, "ApplySettings", function(self, win)
  16.             local skada = win.bargroup
  17.             skada:SetBackdrop({
  18.                 bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
  19.                 edgeFile = nil, tile = false, tileSize = 0, edgeSize = 32,
  20.                 insets = { left = 0, right = 0, top = 0, bottom = 0 }
  21.             })
  22.             skada:SetBackdropColor(0, 0, 0, 0.8)
  23.         end)
  24.     end
  25. end
  26.  
  27. local f = CreateFrame("Frame")
  28. f:RegisterEvent("ADDON_LOADED")
  29. f:SetScript("OnEvent", ApplySkin)
  Reply With Quote