comparison BuffFrame/BuffFrame.lua @ 50:d7655c4e6e06 v1.0-release

disambiguate local module names
author Nenue
date Fri, 29 Apr 2016 10:52:43 -0400
parents 16465f3fd919
children 07ef62fe201f
comparison
equal deleted inserted replaced
49:16465f3fd919 50:d7655c4e6e06
5 -- @file-revision@ @file-hash@ 5 -- @file-revision@ @file-hash@
6 -- Created: 4/28/2016 5:58 AM 6 -- Created: 4/28/2016 5:58 AM
7 -------------------------------------------- 7 --------------------------------------------
8 8
9 local B = select(2,...).frame 9 local B = select(2,...).frame
10 local M = B:RegisterModule('BuffFrame') 10 local Aura = B:RegisterModule('BuffFrame')
11 11
12 M.PlayerBuffsActive = {} 12 Aura.PlayerBuffsActive = {}
13 function M:OnInitialize() 13 function Aura:OnInitialize()
14 local displays = M.displays 14 local displays = Aura.displays
15 15
16 -- suffix tables 16 -- suffix tables
17 M.drawn = B.Abstract(displays, 'drawn', M.drawn ) 17 Aura.drawn = B.Abstract(displays, 'drawn', Aura.drawn )
18 -- Lesser extent of guide frames that have been positioned 18 -- Lesser extent of guide frames that have been positioned
19 M.positioned = B.Abstract(displays, 'positioned', M.positioned) 19 Aura.positioned = B.Abstract(displays, 'positioned', Aura.positioned)
20 -- Backdrop style frame 20 -- Backdrop style frame
21 M.decors = B.Abstract(displays, 'decorator', M.decors) 21 Aura.decors = B.Abstract(displays, 'decorator', Aura.decors)
22 -- Static positioning frames 22 -- Static positioning frames
23 M.guides = B.Abstract(displays, 'guides', M.guides) 23 Aura.guides = B.Abstract(displays, 'guides', Aura.guides)
24 -- Anchor points for guides 24 -- Anchor points for guides
25 M.anchors = B.Abstract(displays, 'anchor', M.anchors) 25 Aura.anchors = B.Abstract(displays, 'anchor', Aura.anchors)
26 -- Stored functions for doing icon texture adjustments 26 -- Stored functions for doing icon texture adjustments
27 M.zoom = B.Abstract(displays, 'zoom', M.zoom ) 27 Aura.zoom = B.Abstract(displays, 'zoom', Aura.zoom )
28 28
29 29
30 for name, display in pairs(displays) do 30 for name, display in pairs(displays) do
31 display.conf = setmetatable({}, { 31 display.conf = setmetatable({}, {
32 __index = function(_, k) 32 __index = function(_, k)
33 --print('config check '.. name .. k) 33 --print('config check '.. name .. k)
34 return M.Conf[name .. k] or M.Conf['BuffButton' .. k] 34 return Aura.Conf[name .. k] or Aura.Conf['BuffButton' .. k]
35 end, 35 end,
36 __newindex = function(_, k , v) 36 __newindex = function(_, k , v)
37 M.Conf[name..k] = v 37 Aura.Conf[name..k] = v
38 end, 38 end,
39 }) 39 })
40 end 40 end
41 41
42 M:RegisterUnitEvent("UNIT_AURA", "player", "vehicle") 42 Aura:RegisterUnitEvent("UNIT_AURA", "player", "vehicle")
43 M:RegisterEvent("GROUP_ROSTER_UPDATE") 43 Aura:RegisterEvent("GROUP_ROSTER_UPDATE")
44 M:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") 44 Aura:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
45 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", M.PostBuffAnchors) 45 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", Aura.PostBuffAnchors)
46 hooksecurefunc("RaidBuffTray_Update", M.UpdateRaidBuffs) 46 hooksecurefunc("RaidBuffTray_Update", Aura.UpdateRaidBuffs)
47 end 47 end
48 48
49 function M:OnUpdate () 49 function Aura:OnUpdate ()
50 local displays = M.displays 50 local displays = Aura.displays
51 M.ShowConsolidated = (IsInGroup() and GetCVarBool("consolidateBuffs")) 51 Aura.ShowConsolidated = (IsInGroup() and GetCVarBool("consolidateBuffs"))
52 M.ShowMissingBuffs = (IsInGroup() and M.Conf.RaidShowMissing) 52 Aura.ShowMissingBuffs = (IsInGroup() and Aura.Conf.RaidShowMissing)
53 53
54 for name, auraType in pairs(displays) do 54 for name, auraType in pairs(displays) do
55 55
56 M.UpdateBuffs(auraType.buffName, true) 56 Aura.UpdateBuffs(auraType.buffName, true)
57 --print(name, auraType) 57 --print(name, auraType)
58 _G[name..'Anchor']:EnableMouse(B.Conf.ConfigMode) 58 _G[name..'Anchor']:EnableMouse(B.Conf.ConfigMode)
59 end 59 end
60 60
61 M.UpdateRaidBuffs() 61 Aura.UpdateRaidBuffs()
62 M.UpdateBuffsTodo() 62 Aura.UpdateBuffsTodo()
63 end 63 end