View Single Post
12-06-17, 11:35 AM   #1
Naisz
A Deviate Faerie Dragon
 
Naisz's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2015
Posts: 12
Auras.PostCreateIcon?

Hello folks!

At first id like to thank everyone for the initial help they gave me on here. My layout is coming together the way i want to. But sadly im running into a Problem again with displaying Auras, or rather setting the TexCoord of the related icon.

this is located inside another .lua file
Lua Code:
  1. local _,ns = ...
  2.  
  3. [-unrelated code-]
  4.  
  5. ns:UpdateAuraIcon = function(element, button)
  6.          button.overlay:SetAlpha(0)
  7.          button.icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  8.      button.icon:SetDrawLayer('ARTWORK')
  9. end

inside my Layout file im doing
Lua Code:
  1. local Auras = CreateFrame('Frame', nil, self)
  2.                 Auras.gap = true
  3.                 Auras.size = 20
  4.                 Auras:SetHeight(60)
  5.                 Auras:SetWidth(200)
  6.                 Auras:SetPoint('BOTTOMLEFT', self.Health, 'TOPLEFT', 0, 0)
  7.                 Auras.initialAnchor = 'BOTTOMLEFT'
  8.                 Auras['growth-x'] = 'RIGHT'
  9.                 Auras['growth-y'] = 'UP'
  10.                 Auras.numBuffs = cfg.numBuffs
  11.                 Auras.numDebuffs = cfg.numDebuffs
  12.                 Auras.spacing = 1
  13.                 Auras.showStealableBuffs = true
  14.  
  15.                 Auras.PostCreateIcon = ns.UpdateAuraIcon
  16.                 Auras.PostUpdateIcon = ns.PostUpdateIcon
  17.                 self.Auras = Auras

For some reason, ns.UpdateAuraIcon doesnt trigger as far as i experienced

Other stuff inside the namespace, for example cfg.numBuffs is working fine. But it feels like it isnt triggering the function outside the .lua-file but inside the namespace? Am i doing something wrong regarding functions inside the namespace?

Thanks in advance and greetings!

EDIT:

I solved the issue by doing

lua Code:
  1. function ns:UpdateAuraIcon(button)

i dont know why the other option didnt work, if someone knows. please feel free to explain

Last edited by Naisz : 12-06-17 at 12:47 PM. Reason: SOLVED
  Reply With Quote