comparison Templates.lua @ 121:1f68c46bc4de

BuffFrame: - Added interface framework for selectively hiding certain buff's auxiliary values.
author Nenue
date Mon, 17 Jul 2017 11:51:31 -0400
parents 8c94bee4fdfc
children ea2c616a3b4f
comparison
equal deleted inserted replaced
120:5f1ba488c395 121:1f68c46bc4de
20 Handler.data = {} 20 Handler.data = {}
21 Veneer.HandlerBase = Handler 21 Veneer.HandlerBase = Handler
22 Veneer.ConfigLayerBase = ConfigLayer 22 Veneer.ConfigLayerBase = ConfigLayer
23 Veneer.AnimationBase = Animation 23 Veneer.AnimationBase = Animation
24 24
25 local ANCHOR_BUTTON_TYPES = {
26 'TOPLEFT', 'TOP', 'TOPRIGHT', 'RIGHT', 'LEFT', 'CENTER', 'BOTTOMLEFT', 'BOTTOM', 'BOTTOMRIGHT'
27 }
25 28
26 function ConfigLayer:OnLoad() 29 function ConfigLayer:OnLoad()
27 local handler = self:GetParent() 30 local handler = self:GetParent()
28 print(handler:GetName(), 'configLayers') 31 print(handler:GetName(), 'configLayers')
29 handler.ConfigLayers = handler.ConfigLayers or {} 32 handler.ConfigLayers = handler.ConfigLayers or {}
30 for i, region in ipairs(handler.ConfigLayers) do 33 for i, region in ipairs(handler.ConfigLayers) do
31 region:SetShown(Veneer.ConfigMode) 34 region:SetShown(Veneer.ConfigMode)
32 end 35 end
36 self.handler = handler
37 end
38
39 function ConfigLayer:OnShow()
40 self:Update()
41 end
42
43 function ConfigLayer:Update()
44 if not self.anchorButtons then
45 self.anchorButtons = {}
46 for _, anchorPoint in ipairs(ANCHOR_BUTTON_TYPES) do
47 local button = CreateFrame('Button', nil, self, 'VeneerAnchorButtonTemplate')
48 button.anchorPoint = anchorPoint
49 button:SetScript('OnMouseDown', function() end)
50 button:SetScript('OnMouseUp', function() end)
51 button:SetPoint(anchorPoint)
52 button:SetSize(16,16)
53
54 self.anchorButtons[anchorPoint] = button
55 end
56 end
57
58 for anchorPoint, button in pairs(self.anchorButtons) do
59 if anchorPoint == self.handler.anchorPoint then
60 button:GetNormalTexture():SetColorTexture(0,1,0,1)
61 else
62 button:GetNormalTexture():SetColorTexture(0.5,0.5,0.5,1)
63 end
64 end
65
66 self:RegisterForDrag('LeftButton')
67 end
68
69 function ConfigLayer:OnDragStart()
70
71 end
72 function ConfigLayer:OnDragStop()
33 73
34 end 74 end
35 75
36 function ConfigLayer:OnUpdate() 76 function ConfigLayer:OnUpdate()
37 local handler = self:GetParent() 77 local handler = self:GetParent()