Nenue@90: -- Veneer Nenue@90: -- Templates.lua Nenue@90: -- Created: 10/24/2016 9:16 AM Nenue@90: -- %file-revision% Nenue@90: -- Nenue@90: -- Mover Widget base Nenue@90: local print = DEVIAN_WORKSPACE and function(...) _G.print('VnTemplate', ...) end or nop Nenue@90: Nenue@90: VeneerConfigLayerMixin = {} Nenue@90: VeneerAnimationMixin = {} Nenue@90: VeneerHandlerMixin = { anchorPoint = 'CENTER' } Nenue@90: Nenue@90: function VeneerConfigLayerMixin:OnLoad() Nenue@90: local handler = self:GetParent() Nenue@90: print(handler:GetName(), 'configLayers') Nenue@90: handler.ConfigLayers = handler.ConfigLayers or {} Nenue@90: for i, region in ipairs(handler.ConfigLayers) do Nenue@90: region:SetShown(Veneer.ConfigMode) Nenue@90: end Nenue@90: end Nenue@90: Nenue@90: Nenue@90: function VeneerConfigLayerMixin:OnUpdate() Nenue@90: local handler = self:GetParent() Nenue@90: handler.ConfigLayers = handler.ConfigLayers or {} Nenue@90: Nenue@90: self.ConfigName:SetText(handler:GetName()) Nenue@90: self.ConfigID:SetText(handler:GetID()) Nenue@90: end Nenue@90: Nenue@90: Nenue@90: function VeneerHandlerMixin:OnShow() Nenue@90: self:Reanchor() Nenue@90: Veneer:StaticReanchor(self) Nenue@90: end Nenue@90: function VeneerHandlerMixin:OnHide() Nenue@90: Veneer:DynamicReanchor() Nenue@90: end Nenue@90: function VeneerHandlerMixin:Reanchor (anchorAll) Nenue@90: if not anchorAll then Nenue@90: Veneer:InternalReanchor(self) Nenue@90: end Nenue@90: end Nenue@90: Nenue@90: function VeneerAnimationMixin:OnPlay() Nenue@90: PlaySoundKitID(229) Nenue@90: self.animating = true Nenue@90: print('|cFF00FF00Anim:OnPlay|r @', unpack(self.sourcePoint)) Nenue@90: end Nenue@90: function VeneerAnimationMixin:OnStop() Nenue@90: PlaySoundKitID(229) Nenue@90: self.animating = nil Nenue@90: print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint)) Nenue@90: end Nenue@90: function VeneerAnimationMixin:OnFinished() Nenue@90: PlaySoundKitID(229) Nenue@90: self.animating = nil Nenue@90: print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint)) Nenue@90: end