annotate Templates.lua @ 96:bb38bc0e787f

- fix weapon slot anchors for paperdoll
author Nenue
date Tue, 03 Jan 2017 14:06:41 -0500
parents caded2668701
children dadddb8a551f
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 function VeneerConfigLayerMixin:OnUpdate()
Nenue@90 23 local handler = self:GetParent()
Nenue@90 24 handler.ConfigLayers = handler.ConfigLayers or {}
Nenue@90 25
Nenue@90 26 self.ConfigName:SetText(handler:GetName())
Nenue@90 27 self.ConfigID:SetText(handler:GetID())
Nenue@90 28 end
Nenue@90 29
Nenue@90 30 function VeneerAnimationMixin:OnPlay()
Nenue@90 31 PlaySoundKitID(229)
Nenue@90 32 self.animating = true
Nenue@90 33 print('|cFF00FF00Anim:OnPlay|r @', unpack(self.sourcePoint))
Nenue@90 34 end
Nenue@90 35 function VeneerAnimationMixin:OnStop()
Nenue@90 36 PlaySoundKitID(229)
Nenue@90 37 self.animating = nil
Nenue@90 38 print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
Nenue@90 39 end
Nenue@90 40 function VeneerAnimationMixin:OnFinished()
Nenue@90 41 PlaySoundKitID(229)
Nenue@90 42 self.animating = nil
Nenue@90 43 print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
Nenue@93 44 end
Nenue@93 45
Nenue@93 46 function VeneerHandlerMixin:OnShow()
Nenue@93 47 self:Reanchor()
Nenue@93 48 Veneer:StaticReanchor(self)
Nenue@93 49 end
Nenue@93 50 function VeneerHandlerMixin:OnHide()
Nenue@93 51 Veneer:DynamicReanchor()
Nenue@93 52 end
Nenue@93 53 function VeneerHandlerMixin:Reanchor (anchorAll)
Nenue@93 54 if not anchorAll then
Nenue@93 55 Veneer:InternalReanchor(self)
Nenue@93 56 end
Nenue@90 57 end