view Templates.lua @ 95:43303398d1b9

- Pre-load veneer frames for buffs, set their triggers when the appropriate frames have spawned. - Add border frames into the PETBATTLES frame lock table so they are hidden properly. Normal triggers don't work here.
author Nenue
date Sun, 01 Jan 2017 19:56:35 -0500
parents caded2668701
children dadddb8a551f
line wrap: on
line source
-- Veneer
-- Templates.lua
-- Created: 10/24/2016 9:16 AM
-- %file-revision%
--
-- Mover Widget base
local print = DEVIAN_WORKSPACE and function(...) _G.print('VnTemplate', ...) end or nop

VeneerConfigLayerMixin = {}
VeneerAnimationMixin = {}
VeneerHandlerMixin = { anchorPoint = 'CENTER' }

function VeneerConfigLayerMixin:OnLoad()
  local handler = self:GetParent()
  print(handler:GetName(), 'configLayers')
  handler.ConfigLayers = handler.ConfigLayers or {}
  for i, region in ipairs(handler.ConfigLayers) do
    region:SetShown(Veneer.ConfigMode)
  end
end

function VeneerConfigLayerMixin:OnUpdate()
  local handler = self:GetParent()
  handler.ConfigLayers = handler.ConfigLayers or {}

  self.ConfigName:SetText(handler:GetName())
  self.ConfigID:SetText(handler:GetID())
end

function VeneerAnimationMixin:OnPlay()
  PlaySoundKitID(229)
  self.animating = true
  print('|cFF00FF00Anim:OnPlay|r @', unpack(self.sourcePoint))
end
function VeneerAnimationMixin:OnStop()
  PlaySoundKitID(229)
  self.animating = nil
  print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
end
function VeneerAnimationMixin:OnFinished()
  PlaySoundKitID(229)
  self.animating = nil
  print('|cFF00FF00Anim:OnFinish|r @', unpack(self.destPoint))
end

function VeneerHandlerMixin:OnShow()
  self:Reanchor()
  Veneer:StaticReanchor(self)
end
function VeneerHandlerMixin:OnHide()
  Veneer:DynamicReanchor()
end
function VeneerHandlerMixin:Reanchor (anchorAll)
  if not anchorAll then
    Veneer:InternalReanchor(self)
  end
end