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@48: local M = B:RegisterModule('BuffFrame') Nenue@48: Nenue@49: M.PlayerBuffsActive = {} Nenue@48: function M:OnInitialize() Nenue@48: local displays = M.displays Nenue@49: Nenue@48: -- suffix tables Nenue@48: M.drawn = B.Abstract(displays, 'drawn', M.drawn ) Nenue@48: -- Lesser extent of guide frames that have been positioned Nenue@48: M.positioned = B.Abstract(displays, 'positioned', M.positioned) Nenue@48: -- Backdrop style frame Nenue@48: M.decors = B.Abstract(displays, 'decorator', M.decors) Nenue@48: -- Static positioning frames Nenue@48: M.guides = B.Abstract(displays, 'guides', M.guides) Nenue@48: -- Anchor points for guides Nenue@48: M.anchors = B.Abstract(displays, 'anchor', M.anchors) Nenue@48: -- Stored functions for doing icon texture adjustments Nenue@48: M.zoom = B.Abstract(displays, 'zoom', M.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@49: return M.Conf[name .. k] or M.Conf['BuffButton' .. k] Nenue@48: end, Nenue@48: __newindex = function(_, k , v) Nenue@49: M.Conf[name..k] = v Nenue@48: end, Nenue@48: }) Nenue@48: end Nenue@48: Nenue@48: M:RegisterUnitEvent("UNIT_AURA", "player", "vehicle") Nenue@48: M:RegisterEvent("GROUP_ROSTER_UPDATE") Nenue@48: M:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") Nenue@48: hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", M.PostBuffAnchors) Nenue@48: hooksecurefunc("RaidBuffTray_Update", M.UpdateRaidBuffs) Nenue@48: end Nenue@48: Nenue@48: function M:OnUpdate () Nenue@48: local displays = M.displays Nenue@48: M.ShowConsolidated = (IsInGroup() and GetCVarBool("consolidateBuffs")) Nenue@48: M.ShowMissingBuffs = (IsInGroup() and M.Conf.RaidShowMissing) Nenue@48: Nenue@48: for name, auraType in pairs(displays) do Nenue@48: Nenue@48: M.UpdateBuffs(auraType.buffName, true) Nenue@49: --print(name, auraType) Nenue@48: _G[name..'Anchor']:EnableMouse(B.Conf.ConfigMode) Nenue@48: end Nenue@48: Nenue@48: M.UpdateRaidBuffs() Nenue@48: M.UpdateBuffsTodo() Nenue@48: end