Mercurial > wow > buffalo2
diff BuffFrame/BuffButton.lua @ 50:d7655c4e6e06 v1.0-release
disambiguate local module names
author | Nenue |
---|---|
date | Fri, 29 Apr 2016 10:52:43 -0400 |
parents | 9837069e366a |
children | 07ef62fe201f |
line wrap: on
line diff
--- a/BuffFrame/BuffButton.lua Fri Apr 29 10:50:27 2016 -0400 +++ b/BuffFrame/BuffButton.lua Fri Apr 29 10:52:43 2016 -0400 @@ -14,12 +14,12 @@ local BuffFrame, ConsolidatedBuffs = _G.BuffFrame, _G.ConsolidatedBuffs local UnitAura, UnitName, RegisterStateDriver = _G.UnitAura, _G.UnitName, _G.RegisterStateDriver -local M = B:RegisterModule(MODULE) -local displays = M.displays +local Aura = B:RegisterModule(MODULE) +local displays = Aura.displays local print, gprint, aprint, fprint = B.print('Buff'), B.print('SetGuides'), B.print('SetAnchors'), B.fprint -M.GetBuffZoom = function(buffName) - local zoom = tonumber(M.displays[buffName].conf['Zoom']) / 100 / 2 +Aura.GetBuffZoom = function(buffName) + local zoom = tonumber(Aura.displays[buffName].conf['Zoom']) / 100 / 2 local zoomL, zoomU, zoomR, zoomD = zoom, zoom, 1-zoom, 1-zoom print(buffName, zoom) return function(self, ...) @@ -33,7 +33,7 @@ -M.UpdateButtonAlpha = function(self) +Aura.UpdateButtonAlpha = function(self) if not self.parent.timeLeft or not self:IsVisible() then self:SetScript('OnUpdate', nil) return @@ -48,12 +48,12 @@ --- Called infrequently to align stencil frames local refreshCount = 0 -M.UpdateGuideFrames = function(buffName) +Aura.UpdateGuideFrames = function(buffName) refreshCount = refreshCount + 1 local print = fprint() print(buffName) - local displays, anchors = M.displays, M.anchors - local guides, decors = M.guides, M.decors + local displays, anchors = Aura.displays, Aura.anchors + local guides, decors = Aura.guides, Aura.decors local anchor = anchors[buffName] local c, g, d = displays[buffName].conf, guides[buffName], decors[buffName] @@ -67,7 +67,7 @@ local buffMax = min(c['Max'], displays[buffName].maxIcons) local anchorFrom, anchorTo = c.Point[1], c.Point[2] - anchor.Zoom = M.GetBuffZoom(buffName) + anchor.Zoom = Aura.GetBuffZoom(buffName) @@ -195,13 +195,13 @@ print(anchor:GetName(), anchor:GetSize()) end -M.UpdateButtonPositions = function(buffName, auraType) +Aura.UpdateButtonPositions = function(buffName, auraType) local print = fprint() local c = auraType.conf local numBuffs = 0 local actualIcons = auraType.actualIcons() local maxIcons = auraType.maxIcons - local guides, decors, anchors, drawn = M.guides, M.decors, M.anchors, M.drawn + local guides, decors, anchors, drawn = Aura.guides, Aura.decors, Aura.anchors, Aura.drawn local anchor = anchors[buffName] local buffMax = c['Max'] @@ -296,7 +296,7 @@ buffDuration:SetText('WHAT') if buff.timeLeft and c.WarningFade then - deco:SetScript('OnUpdate', M.UpdateButtonAlpha) + deco:SetScript('OnUpdate', Aura.UpdateButtonAlpha) else deco:SetScript('OnUpdate', nil) deco:SetAlpha(1.0) @@ -369,16 +369,16 @@ end if anchor.attached then - M.UpdateAnchorChild(anchor, anchor.attached, anchor.attachmentConf) + Aura.UpdateAnchorChild(anchor, anchor.attached, anchor.attachmentConf) end end -M.PostBuffAnchors = function() +Aura.PostBuffAnchors = function() local print = fprint() - local anchors = M.anchors - if M.ShowConsolidatedBuffs then - M.UpdateRaidBuffs() + local anchors = Aura.anchors + if Aura.ShowConsolidatedBuffs then + Aura.UpdateRaidBuffs() end for buttonName, auraType in pairs(displays) do print('sending', buttonName, auraType) @@ -389,15 +389,15 @@ --if positioned[buttonName] == 0 then print('possibly reloaded UI, check positions') - M.UpdateGuideFrames(buttonName) + Aura.UpdateGuideFrames(buttonName) --end - M.UpdateButtonPositions(buttonName, auraType) + Aura.UpdateButtonPositions(buttonName, auraType) end end -M.UpdateBuffs = function(buttonName, forced) - local displays, drawn = M.displays, M.drawn +Aura.UpdateBuffs = function(buttonName, forced) + local displays, drawn = Aura.displays, Aura.drawn local print = B.fprint(buttonName) local c = displays[buttonName].conf if drawn[buttonName] then @@ -406,9 +406,9 @@ drawn[buttonName] = {} end - M.UpdateAnchorFrames(buttonName) - M.UpdateGuideFrames(buttonName) - M.UpdateButtonPositions(buttonName, displays[buttonName]) + Aura.UpdateAnchorFrames(buttonName) + Aura.UpdateGuideFrames(buttonName) + Aura.UpdateButtonPositions(buttonName, displays[buttonName]) end --- should only be called from user input