Nenue@48: -------------------------------------------- Nenue@48: -- Veneer Nenue@48: -- Nick Nenue@48: -- @project-revision@ @project-hash@ Nenue@48: -- @file-revision@ @file-hash@ Nenue@48: -- Created: 4/28/2016 5:58 AM Nenue@48: -------------------------------------------- Nenue@48: Nenue@48: local B = select(2,...).frame Nenue@50: local Aura = B:RegisterModule('BuffFrame') Nenue@48: Nenue@50: Aura.PlayerBuffsActive = {} Nenue@50: function Aura:OnInitialize() Nenue@50: local displays = Aura.displays Nenue@49: Nenue@48: -- suffix tables Nenue@50: Aura.drawn = B.Abstract(displays, 'drawn', Aura.drawn ) Nenue@48: -- Lesser extent of guide frames that have been positioned Nenue@50: Aura.positioned = B.Abstract(displays, 'positioned', Aura.positioned) Nenue@48: -- Backdrop style frame Nenue@50: Aura.decors = B.Abstract(displays, 'decorator', Aura.decors) Nenue@48: -- Static positioning frames Nenue@50: Aura.guides = B.Abstract(displays, 'guides', Aura.guides) Nenue@48: -- Anchor points for guides Nenue@50: Aura.anchors = B.Abstract(displays, 'anchor', Aura.anchors) Nenue@48: -- Stored functions for doing icon texture adjustments Nenue@50: Aura.zoom = B.Abstract(displays, 'zoom', Aura.zoom ) Nenue@48: Nenue@48: Nenue@48: for name, display in pairs(displays) do Nenue@48: display.conf = setmetatable({}, { Nenue@48: __index = function(_, k) Nenue@48: --print('config check '.. name .. k) Nenue@50: return Aura.Conf[name .. k] or Aura.Conf['BuffButton' .. k] Nenue@48: end, Nenue@48: __newindex = function(_, k , v) Nenue@50: Aura.Conf[name..k] = v Nenue@48: end, Nenue@48: }) Nenue@48: end Nenue@48: Nenue@50: Aura:RegisterUnitEvent("UNIT_AURA", "player", "vehicle") Nenue@50: Aura:RegisterEvent("GROUP_ROSTER_UPDATE") Nenue@50: Aura:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") Nenue@50: hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", Aura.PostBuffAnchors) Nenue@59: --hooksecurefunc("RaidBuffTray_Update", Aura.UpdateRaidBuffs) Nenue@48: end Nenue@48: Nenue@50: function Aura:OnUpdate () Nenue@50: local displays = Aura.displays Nenue@50: Aura.ShowConsolidated = (IsInGroup() and GetCVarBool("consolidateBuffs")) Nenue@50: Aura.ShowMissingBuffs = (IsInGroup() and Aura.Conf.RaidShowMissing) Nenue@48: Nenue@48: for name, auraType in pairs(displays) do Nenue@48: Nenue@50: Aura.UpdateBuffs(auraType.buffName, true) Nenue@49: --print(name, auraType) Nenue@48: _G[name..'Anchor']:EnableMouse(B.Conf.ConfigMode) Nenue@48: end Nenue@48: Nenue@50: Aura.UpdateRaidBuffs() Nenue@50: Aura.UpdateBuffsTodo() Nenue@48: end