comparison Modules/BuffFrame.lua @ 79:0784b87f9722

- adjust top anchors for OrderHallCommandBar
author Nenue
date Sun, 11 Sep 2016 18:46:30 -0400
parents 08951972041a
children bb6b532c5d2f
comparison
equal deleted inserted replaced
78:08951972041a 79:0784b87f9722
16 local BUFF_BUTTON_SPACING_H = 4 16 local BUFF_BUTTON_SPACING_H = 4
17 local BUFF_BUTTON_SPACING_V = 14 17 local BUFF_BUTTON_SPACING_V = 14
18 local BUFF_PROGRESS_SIZE = 4 18 local BUFF_PROGRESS_SIZE = 4
19 local BUFF_PROGRESS_INSET = 1 19 local BUFF_PROGRESS_INSET = 1
20 local BUFF_BUTTON_ZOOM = .15 20 local BUFF_BUTTON_ZOOM = .15
21 local BORDER_SIZE_L = 0 21 local BORDER_SIZE_L = 1
22 local BORDER_SIZE_R = 0 22 local BORDER_SIZE_R = 1
23 local BORDER_SIZE_U = 4 23 local BORDER_SIZE_U = 1
24 local BORDER_SIZE_D = 0 24 local BORDER_SIZE_D = 1
25 local BUFF_FRAMES_X = -230 25 local BUFF_FRAMES_X = -230
26 local BUFF_FRAMES_Y = -4 26 local BUFF_FRAMES_Y = -4
27 27
28 28
29 local plugin = CreateFrame('Frame', 'VeneerBuffFrame', UIParent) 29 local plugin = CreateFrame('Frame', 'VeneerBuffFrame', UIParent)
75 print('|cFF88FF00Creating', name,'Veneer') 75 print('|cFF88FF00Creating', name,'Veneer')
76 local veneer = vn.GetVeneer(frame, 'VeneerBuffTemplate') 76 local veneer = vn.GetVeneer(frame, 'VeneerBuffTemplate')
77 local id = frame:GetID() 77 local id = frame:GetID()
78 78
79 79
80 veneer.progress:SetPoint('BOTTOMLEFT', veneer, 'BOTTOMLEFT', 0, -6) 80 veneer.progress:SetPoint('BOTTOMLEFT', veneer, 'BOTTOMLEFT', -1, -7)
81 veneer.progress:SetPoint('TOPRIGHT', veneer, 'BOTTOMRIGHT', 0, -1) 81 veneer.progress:SetPoint('TOPRIGHT', veneer, 'BOTTOMRIGHT', 1, -2)
82 veneer.progress:SetHeight(BUFF_PROGRESS_SIZE + (BUFF_PROGRESS_INSET * 2)) 82 veneer.progress:SetHeight(BUFF_PROGRESS_SIZE + (BUFF_PROGRESS_INSET * 2))
83 83
84 veneer.progress.bg:SetColorTexture(0,0,0,1) 84 veneer.progress.bg:SetColorTexture(0,0,0,1)
85 85
86 veneer.progress.fg:SetColorTexture(1,1,1,1) 86 veneer.progress.fg:SetColorTexture(1,1,1,1)
96 veneer.count:ClearAllPoints() 96 veneer.count:ClearAllPoints()
97 veneer.count:SetPoint('TOPRIGHT', veneer, 'TOPRIGHT', -3, -3) 97 veneer.count:SetPoint('TOPRIGHT', veneer, 'TOPRIGHT', -3, -3)
98 98
99 veneer.underlay:SetParent(UIParent) 99 veneer.underlay:SetParent(UIParent)
100 veneer.underlay:SetFrameStrata('BACKGROUND') 100 veneer.underlay:SetFrameStrata('BACKGROUND')
101 veneer.border:SetColorTexture(0,0,0,0) 101 veneer.border:SetColorTexture(0,0,0,1)
102 veneer.border:SetPoint('TOPLEFT', veneer, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U) 102 veneer.border:SetPoint('TOPLEFT', veneer, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U)
103 veneer.border:SetPoint('BOTTOMRIGHT', veneer, 'BOTTOMRIGHT', BORDER_SIZE_R, -BORDER_SIZE_D) 103 veneer.border:SetPoint('BOTTOMRIGHT', veneer, 'BOTTOMRIGHT', BORDER_SIZE_R, -BORDER_SIZE_D)
104 veneer.border:Show() 104 veneer.border:Show()
105 105
106 106
137 border:Hide() 137 border:Hide()
138 hooksecurefunc(border, 'SetVertexColor', function(frame, r, g, b, a) 138 hooksecurefunc(border, 'SetVertexColor', function(frame, r, g, b, a)
139 frame:Hide() 139 frame:Hide()
140 print('|cFF0088FFborder:SetVertexColor|r', r,g,b,a) 140 print('|cFF0088FFborder:SetVertexColor|r', r,g,b,a)
141 veneer.progress.fg:SetColorTexture(r,g,b,a) 141 veneer.progress.fg:SetColorTexture(r,g,b,a)
142 end) 142 veneer.border:Show()
143 end)
144
145
143 146
144 local color = DebuffTypeColor["none"] 147 local color = DebuffTypeColor["none"]
145 if aurasCache[frame] and aurasCache[frame][5] then 148 if aurasCache[frame] and aurasCache[frame][5] then
146 color = DebuffTypeColor[aurasCache[frame][5]] 149 color = DebuffTypeColor[aurasCache[frame][5]]
147 end 150 end
148 151
149 veneer.progress.fg:SetColorTexture(color.r,color.g,color.b) 152 veneer.progress.fg:SetColorTexture(color.r,color.g,color.b)
150 veneer.border:SetColorTexture(0,0,0,1) 153 veneer.border:SetColorTexture(0,0,0,1)
154 veneer.border:Show()
155 else
156 veneer.border:SetColorTexture(0,0,0,1)
157 veneer.border:Show()
151 end 158 end
152 if duration then 159 if duration then
153 duration:ClearAllPoints() 160 duration:ClearAllPoints()
154 --duration:SetPoint('TOP', frame, 'BOTTOM', 0, -8) 161 --duration:SetPoint('TOP', frame, 'BOTTOM', 0, -8)
155 --duration:SetFontObject(VeneerNumberFont) 162 --duration:SetFontObject(VeneerNumberFont)
218 local UpdateVeneer = function (frame, duration, expires) 225 local UpdateVeneer = function (frame, duration, expires)
219 local veneer = GetVeneer(frame) 226 local veneer = GetVeneer(frame)
220 -- is it a new button? 227 -- is it a new button?
221 if not skinnedFrames[frame] then 228 if not skinnedFrames[frame] then
222 SkinFrame(frame:GetName()) 229 SkinFrame(frame:GetName())
223 end
224
225 if frame.filter == 'HARMFUL' then
226
227 veneer.border:Show()
228 else
229 veneer.border:Hide()
230 end 230 end
231 231
232 232
233 if expires and duration then 233 if expires and duration then
234 if duration ~= 0 then 234 if duration ~= 0 then