annotate Templates.lua @ 91:fe8806a7b6fc v7.1-r91

7.1 TOC
author Nenue
date Tue, 25 Oct 2016 12:27:47 -0400
parents 6e2cb847c3c6
children caded2668701
rev   line source
Nenue@90 1 -- Veneer
Nenue@90 2 -- Templates.lua
Nenue@90 3 -- Created: 10/24/2016 9:16 AM
Nenue@90 4 -- %file-revision%
Nenue@90 5 --
Nenue@90 6 -- Mover Widget base
Nenue@90 7 local print = DEVIAN_WORKSPACE and function(...) _G.print('VnTemplate', ...) end or nop
Nenue@90 8
Nenue@90 9 VeneerConfigLayerMixin = {}
Nenue@90 10 VeneerAnimationMixin = {}
Nenue@90 11 VeneerHandlerMixin = { anchorPoint = 'CENTER' }
Nenue@90 12
Nenue@90 13 function VeneerConfigLayerMixin:OnLoad()
Nenue@90 14 local handler = self:GetParent()
Nenue@90 15 print(handler:GetName(), 'configLayers')
Nenue@90 16 handler.ConfigLayers = handler.ConfigLayers or {}
Nenue@90 17 for i, region in ipairs(handler.ConfigLayers) do
Nenue@90 18 region:SetShown(Veneer.ConfigMode)
Nenue@90 19 end
Nenue@90 20 end
Nenue@90 21
Nenue@90 22
Nenue@90 23 function VeneerConfigLayerMixin:OnUpdate()
Nenue@90 24 local handler = self:GetParent()
Nenue@90 25 handler.ConfigLayers = handler.ConfigLayers or {}
Nenue@90 26
Nenue@90 27 self.ConfigName:SetText(handler:GetName())
Nenue@90 28 self.ConfigID:SetText(handler:GetID())
Nenue@90 29 end
Nenue@90 30
Nenue@90 31
Nenue@90 32 function VeneerHandlerMixin:OnShow()
Nenue@90 33 self:Reanchor()
Nenue@90 34 Veneer:StaticReanchor(self)
Nenue@90 35 end
Nenue@90 36 function VeneerHandlerMixin:OnHide()
Nenue@90 37 Veneer:DynamicReanchor()
Nenue@90 38 end
Nenue@90 39 function VeneerHandlerMixin:Reanchor (anchorAll)
Nenue@90 40 if not anchorAll then
Nenue@90 41 Veneer:InternalReanchor(self)
Nenue@90 42 end
Nenue@90 43 end
Nenue@90 44
Nenue@90 45 function VeneerAnimationMixin:OnPlay()
Nenue@90 46 PlaySoundKitID(229)
Nenue@90 47 self.animating = true
Nenue@90 48 print('|cFF00FF00Anim:OnPlay|r @', unpack(self.sourcePoint))
Nenue@90 49 end
Nenue@90 50 function VeneerAnimationMixin:OnStop()
Nenue@90 51 PlaySoundKitID(229)
Nenue@90 52 self.animating = nil
Nenue@90 53 print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
Nenue@90 54 end
Nenue@90 55 function VeneerAnimationMixin:OnFinished()
Nenue@90 56 PlaySoundKitID(229)
Nenue@90 57 self.animating = nil
Nenue@90 58 print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
Nenue@90 59 end