Mercurial > wow > buffalo2
diff Templates.lua @ 125:3f4794dca91b
template load order and Script handlers linkage
author | Nenue |
---|---|
date | Sun, 15 Oct 2017 16:47:22 -0400 |
parents | ea2c616a3b4f |
children | 414e37af1b1b |
line wrap: on
line diff
--- a/Templates.lua Tue Sep 05 02:57:08 2017 -0400 +++ b/Templates.lua Sun Oct 15 16:47:22 2017 -0400 @@ -4,8 +4,8 @@ -- %file-revision% -- -- Mover Widget base -local ADDON, Veneer = ... -local print = DEVIAN_WORKSPACE and function(...) _G.print('Veneer', ...) end or nop +local ADDON, addon = ... +local print = DEVIAN_WORKSPACE and function(...) _G.print('VnTpl', ...) end or nop local PlaySoundKitID = DEVIAN_WORKSPACE and PlaySoundKitID or nop local ipairs, pairs = ipairs, pairs local pack, unpack = pack, unpack @@ -18,9 +18,9 @@ Handler.anchorPoint = 'CENTER' Handler.anchorPriority = 4 Handler.data = {} -Veneer.HandlerBase = Handler -Veneer.ConfigLayerBase = ConfigLayer -Veneer.AnimationBase = Animation +addon.HandlerBase = Handler +addon.ConfigLayerBase = ConfigLayer +addon.AnimationBase = Animation local ANCHOR_BUTTON_TYPES = { 'TOPLEFT', 'TOP', 'TOPRIGHT', 'RIGHT', 'LEFT', 'CENTER', 'BOTTOMLEFT', 'BOTTOM', 'BOTTOMRIGHT' @@ -28,10 +28,10 @@ function ConfigLayer:OnLoad() local handler = self:GetParent() - print(handler:GetName(), 'configLayers') + print(handler:GetName(), '-> ConfigLayer loaded', addon.ConfigMode) handler.ConfigLayers = handler.ConfigLayers or {} for i, region in ipairs(handler.ConfigLayers) do - region:SetShown(Veneer.ConfigMode) + region:SetShown(addon.ConfigMode) end self.handler = handler end @@ -144,10 +144,19 @@ print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint)) end + +function Handler:OnLoad() + print(self:GetName(), 'loaded') + self.debug = DEVIAN_WORKSPACE and function(...) _G.print(self:GetName(), ...) end or nop + self.debug('OnLoad() template') +end + -- Replace if module requires anything besides fixing frame anchors + + function Handler:OnShow() self:Reanchor() - _G.Veneer:StaticReanchor(self) + _G.Veneer:DynamicReanchor() end function Handler:OnHide() _G.Veneer:DynamicReanchor()