annotate Modules/BuffFrame.lua @ 71:6f8661094643

- obtains veneer objects through a common function and track them as a unified table.
author Nenue
date Tue, 23 Aug 2016 06:35:08 -0400
parents 1b0d7bcd252e
children 95ed343c3a42
rev   line source
Nenue@59 1 -- Veneer
Nenue@59 2 -- BuffFrame.lua
Nenue@59 3 -- Created: 7/27/2016 8:08 PM
Nenue@59 4 -- %file-revision%
Nenue@62 5 --[[
Nenue@62 6 Adds progress bars and cooldown swirls to buffbutton frames
Nenue@60 7
Nenue@62 8 Known Limitations:
Nenue@62 9 - Individual BuffButton frames are created upon use, making it difficult to do any sort of securestate priming
Nenue@62 10 - TempEnchant info returns relative values only, and they don't synchronize with aura events
Nenue@62 11 - BuffButtons can only be hidden/shown by blizzcode, so functions doing that have to be accounted for
Nenue@62 12 --]]
Nenue@62 13
Nenue@64 14 local BUFF_BUTTON_SIZE = 48
Nenue@71 15 local BUFF_BUTTON_SPACING_H = 4
Nenue@71 16 local BUFF_BUTTON_SPACING_V = 14
Nenue@64 17 local BUFF_PROGRESS_SIZE = 4
Nenue@64 18 local BUFF_PROGRESS_INSET = 1
Nenue@68 19 local BUFF_BUTTON_ZOOM = .15
Nenue@71 20 local BORDER_SIZE_L = 0
Nenue@71 21 local BORDER_SIZE_R = 0
Nenue@70 22 local BORDER_SIZE_U = 4
Nenue@71 23 local BORDER_SIZE_D = 0
Nenue@64 24
Nenue@62 25
Nenue@62 26 local plugin = CreateFrame('Frame', 'VeneerBuffFrame', UIParent)
Nenue@59 27 local vn, print = LibStub("LibKraken").register(VeneerController, plugin)
Nenue@68 28 local tprint = DEVIAN_WORKSPACE and function(...) _G.print('Timer', ...) end or function() end
Nenue@59 29
Nenue@68 30 local _G, UIParent = _G, UIParent
Nenue@68 31 local tinsert, tremove, unpack, select, tconcat = table.insert, table.remove, unpack, select, table.concat
Nenue@68 32 local floor, tonumber, format = math.floor, tonumber, string.format
Nenue@68 33 local UnitAura, GetTime, CreateFrame = UnitAura, GetTime, CreateFrame
Nenue@68 34 local hooksecurefunc = hooksecurefunc
Nenue@59 35
Nenue@59 36 local buttons = {}
Nenue@59 37 local buffTypes = {
Nenue@59 38 {
Nenue@59 39 name = 'buff',
Nenue@59 40 pattern = 'BuffButton(%d)',
Nenue@59 41 filters = 'HELPFUL',
Nenue@59 42 },
Nenue@59 43 {
Nenue@59 44 name = 'debuff',
Nenue@59 45 pattern = 'DebuffButton(%d)',
Nenue@59 46 filters = 'HARMFUL',
Nenue@59 47 },
Nenue@59 48 {
Nenue@59 49 name = 'tempenchant',
Nenue@59 50 pattern = 'TempEnchant(%d)',
Nenue@59 51 filters = 'TEMPENCHANT'
Nenue@59 52 }
Nenue@59 53 }
Nenue@59 54
Nenue@59 55 local textureMapping = {
Nenue@59 56 [1] = 16, --Main hand
Nenue@59 57 [2] = 17, --Off-hand
Nenue@59 58 [3] = 18, --Ranged
Nenue@59 59 }
Nenue@59 60
Nenue@59 61 local tickCounter = {}
Nenue@59 62 local aurasCache = {}
Nenue@59 63 local skinnedFrames = {}
Nenue@59 64 local pendingFrames = {}
Nenue@59 65 local anchors = {}
Nenue@59 66 local expirationCache = {}
Nenue@68 67 local visibility = {}
Nenue@59 68
Nenue@59 69
Nenue@59 70
Nenue@59 71 local GetVeneer = function(frame)
Nenue@59 72 local name = frame:GetName()
Nenue@69 73 if not (_G[name..'Veneer']) then
Nenue@68 74 print('|cFF88FF00Creating', name,'Veneer')
Nenue@71 75 local veneer = vn.GetVeneer(frame)
Nenue@60 76 local id = frame:GetID()
Nenue@59 77
Nenue@59 78 local position = tonumber(name:match("%d"))
Nenue@59 79 if position == 1 then
Nenue@59 80 veneer:Show()
Nenue@59 81 end
Nenue@59 82
Nenue@59 83 veneer.progress = CreateFrame('Frame', name .. 'VeneerProgress', veneer)
Nenue@59 84 veneer.progress:Hide()
Nenue@71 85 veneer.progress:SetPoint('BOTTOMLEFT', veneer, 'BOTTOMLEFT', 0, -6)
Nenue@71 86 veneer.progress:SetPoint('TOPRIGHT', veneer, 'BOTTOMRIGHT', 0, -1)
Nenue@68 87 veneer.progress:SetHeight(BUFF_PROGRESS_SIZE + (BUFF_PROGRESS_INSET * 2))
Nenue@59 88
Nenue@59 89 veneer.progress.bg = veneer.progress:CreateTexture(nil, 'BACKGROUND')
Nenue@61 90 veneer.progress.bg:SetColorTexture(0,0,0,1)
Nenue@59 91 veneer.progress.bg:SetAllPoints(veneer.progress)
Nenue@59 92
Nenue@59 93 veneer.progress.fg = veneer.progress:CreateTexture(nil, 'ARTWORK')
Nenue@59 94 veneer.progress.fg:SetColorTexture(0,1,0,1)
Nenue@68 95 veneer.progress.fg:SetPoint('BOTTOMLEFT', BUFF_PROGRESS_INSET,BUFF_PROGRESS_INSET)
Nenue@68 96 veneer.progress.fg:SetPoint('TOP', 0, -BUFF_PROGRESS_INSET)
Nenue@59 97
Nenue@59 98 veneer.progress.status = veneer.progress:CreateFontString()
Nenue@59 99 veneer.progress.status:SetFontObject(VeneerNumberFont)
Nenue@59 100 veneer.progress.status:SetPoint('TOP')
Nenue@59 101
Nenue@61 102
Nenue@61 103 veneer.cooldown = CreateFrame('Cooldown', name ..'VeneerCooldown', veneer, 'CooldownFrameTemplate')
Nenue@61 104 veneer.cooldown:SetAllPoints(frame)
Nenue@61 105 veneer.cooldown:SetReverse(true)
Nenue@61 106
Nenue@69 107 local overlay = CreateFrame('Frame', name .. 'VeneerOverlay', UIParent)
Nenue@68 108
Nenue@69 109 overlay:Show()
Nenue@69 110 overlay:SetFrameStrata('MEDIUM')
Nenue@69 111 local n = frame:GetNumPoints()
Nenue@69 112 for i = 1, n do
Nenue@69 113 overlay:SetPoint(frame:GetPoint(n))
Nenue@69 114 end
Nenue@68 115
Nenue@68 116
Nenue@69 117 local underlay = CreateFrame('Frame', name..'VeneerUnderlay', UIParent)
Nenue@68 118 underlay:Show()
Nenue@68 119 underlay:SetFrameStrata('BACKGROUND')
Nenue@68 120 local n = frame:GetNumPoints()
Nenue@68 121 for i = 1, n do
Nenue@68 122 underlay:SetPoint(frame:GetPoint(n))
Nenue@68 123 end
Nenue@68 124
Nenue@69 125 veneer.duration = overlay:CreateFontString(name..'VeneerDuration', 'OVERLAY')
Nenue@69 126 veneer.duration:SetFontObject(VeneerNumberFont)
Nenue@69 127 veneer.duration:SetPoint('TOP', frame, 'BOTTOM', 0, -8)
Nenue@69 128
Nenue@69 129 veneer.count = overlay:CreateFontString(name..'VeneerCount', 'OVERLAY')
Nenue@69 130 veneer.count:SetFontObject(VeneerNumberFont)
Nenue@69 131 veneer.count:SetPoint('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', -3, 3)
Nenue@68 132
Nenue@68 133
Nenue@68 134
Nenue@68 135 veneer.border = underlay:CreateTexture(name..'VeneerBorder', 'BACKGROUND')
Nenue@68 136 veneer.border:SetPoint('TOPLEFT', veneer, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U)
Nenue@68 137 veneer.border:SetPoint('BOTTOMRIGHT', veneer, 'BOTTOMRIGHT', BORDER_SIZE_R, -BORDER_SIZE_D)
Nenue@68 138 veneer.border:Show()
Nenue@68 139
Nenue@69 140
Nenue@69 141 veneer.overlay = overlay
Nenue@69 142 veneer.underlay = underlay
Nenue@59 143 end
Nenue@59 144
Nenue@59 145
Nenue@69 146 return _G[name..'Veneer']
Nenue@59 147 end
Nenue@59 148
Nenue@68 149
Nenue@68 150 -- Associates skinning elements with said button
Nenue@68 151 local SkinFrame = function(name)
Nenue@68 152 local frame = _G[name ]
Nenue@68 153 if skinnedFrames[frame] then
Nenue@68 154 print('|cFFFF4400Attempting to skin a frame that already went through.|r')
Nenue@68 155 return
Nenue@68 156 end
Nenue@68 157 print('|cFFFFFF00Adopting', name)
Nenue@68 158
Nenue@68 159 local icon = _G[name .. 'Icon']
Nenue@68 160 local border = _G[name .. 'Border']
Nenue@68 161 local count = _G[name .. 'Count']
Nenue@68 162 local duration = _G[name .. 'Duration']
Nenue@68 163 local slot = frame:GetID() or 0
Nenue@69 164 local veneer = GetVeneer(frame)
Nenue@69 165 local underlay = veneer.underlay
Nenue@69 166 local overlay = veneer.overlay
Nenue@68 167
Nenue@68 168 skinnedFrames[frame] = frame
Nenue@68 169 frame:SetSize(BUFF_BUTTON_SIZE,BUFF_BUTTON_SIZE)
Nenue@68 170
Nenue@68 171 local offset = BUFF_BUTTON_ZOOM/2
Nenue@68 172 icon:SetTexCoord(offset, 1 - offset, offset, 1 - offset)
Nenue@68 173 if border then
Nenue@68 174 border:Hide()
Nenue@68 175 hooksecurefunc(border, 'SetVertexColor', function(frame, r, g, b, a)
Nenue@68 176 frame:Hide()
Nenue@68 177 print('|cFF0088FFborder:SetVertexColor|r', r,g,b,a)
Nenue@71 178 veneer.progress.fg:SetColorTexture(r,g,b,a)
Nenue@68 179 end)
Nenue@68 180
Nenue@68 181 local color = DebuffTypeColor["none"]
Nenue@68 182 if aurasCache[frame] and aurasCache[frame][5] then
Nenue@68 183 color = DebuffTypeColor[aurasCache[frame][5]]
Nenue@68 184 end
Nenue@68 185
Nenue@71 186 veneer.progress.fg:SetColorTexture(color.r,color.g,color.b)
Nenue@68 187 end
Nenue@68 188 if duration then
Nenue@68 189 duration:ClearAllPoints()
Nenue@69 190 --duration:SetPoint('TOP', frame, 'BOTTOM', 0, -8)
Nenue@69 191 --duration:SetFontObject(VeneerNumberFont)
Nenue@69 192 --duration:SetDrawLayer('OVERLAY')
Nenue@68 193
Nenue@69 194 hooksecurefunc(duration, 'Hide', function(self, text)
Nenue@69 195 veneer.duration:Hide()
Nenue@69 196 end)
Nenue@69 197 hooksecurefunc(duration, 'Show', function(self, text)
Nenue@69 198 veneer.duration:Show()
Nenue@69 199 end)
Nenue@69 200 end
Nenue@69 201 if count then
Nenue@69 202 count:ClearAllPoints()
Nenue@69 203 hooksecurefunc(count, 'SetText', function(self, text)
Nenue@69 204 self:Hide()
Nenue@69 205 veneer.count:SetText(text)
Nenue@69 206 end)
Nenue@69 207 hooksecurefunc(count, 'Hide', function(self, text)
Nenue@69 208 veneer.count:Hide()
Nenue@69 209 end)
Nenue@69 210 hooksecurefunc(count, 'Show', function(self, text)
Nenue@69 211 veneer.count:Show()
Nenue@69 212 end)
Nenue@68 213 end
Nenue@68 214
Nenue@68 215
Nenue@68 216 hooksecurefunc(frame, "Hide", function(self)
Nenue@68 217 local isVisible = self:IsVisible()
Nenue@68 218 if isVisible ~= visibility[self] then
Nenue@68 219 visibility[self] = isVisible
Nenue@68 220 end
Nenue@68 221 veneer:Hide()
Nenue@70 222 veneer.count:Hide()
Nenue@68 223 underlay:Hide()
Nenue@68 224 end)
Nenue@68 225
Nenue@68 226 hooksecurefunc(frame, 'Show', function(self)
Nenue@68 227 veneer:Show()
Nenue@70 228 veneer.count:Show()
Nenue@68 229 veneer.border:Show()
Nenue@68 230 underlay:Show()
Nenue@68 231 local isVisible = self:IsVisible()
Nenue@68 232 if isVisible ~= visibility[self] then
Nenue@68 233 print('|cFFFFFF00SHOW|r', self:GetName())
Nenue@68 234 visibility[self] = isVisible
Nenue@68 235 end
Nenue@68 236 end)
Nenue@68 237
Nenue@68 238 anchors[frame] = veneer
Nenue@68 239 end
Nenue@68 240
Nenue@68 241 local Aura_SetBorderColor = function(self, r,g,b,a) end
Nenue@68 242 local Aura_OnShow = function(self) end
Nenue@68 243 local Aura_OnHide = function(self) end
Nenue@68 244
Nenue@61 245 --- Set widgets to reflect the passed parameters
Nenue@59 246 local UpdateVeneer = function (frame, duration, expires)
Nenue@59 247 local veneer = GetVeneer(frame)
Nenue@68 248 -- is it a new button?
Nenue@68 249 if not skinnedFrames[frame] then
Nenue@68 250 SkinFrame(frame:GetName())
Nenue@68 251 end
Nenue@68 252
Nenue@68 253 if frame.filter == 'HARMFUL' then
Nenue@68 254
Nenue@68 255 veneer.border:Show()
Nenue@68 256 end
Nenue@68 257
Nenue@59 258
Nenue@61 259 if expires and duration then
Nenue@61 260 if duration ~= 0 then
Nenue@61 261 local startTime = (expires - duration)
Nenue@61 262 local endTime = expires or 0
Nenue@61 263 print('|cFF0088FF'..frame:GetName()..'|r', duration, expires)
Nenue@61 264 veneer.progress:Show()
Nenue@61 265 veneer.elapsed = 0
Nenue@61 266 veneer.progress:SetScript('OnUpdate', function(self, elapsed)
Nenue@61 267 veneer.elapsed = veneer.elapsed + elapsed
Nenue@60 268
Nenue@67 269 local w = floor(veneer.progress:GetWidth()+.5) - (BUFF_PROGRESS_INSET*2)
Nenue@61 270 local t = GetTime()
Nenue@61 271 local progress = (t - startTime) / duration
Nenue@61 272
Nenue@67 273 local nw = (w - (w * progress))
Nenue@61 274 if veneer.elapsed >= 0.25 then
Nenue@61 275
Nenue@68 276 tprint(t, startTime, floor(progress*100), w * progress, nw, w)
Nenue@61 277 veneer.elapsed = 0.25 - veneer.elapsed
Nenue@61 278 end
Nenue@61 279 if (progress >= 1) or not frame:IsVisible() then
Nenue@61 280 veneer.startTime = nil
Nenue@61 281 self:Hide()
Nenue@61 282 self:SetScript('OnUpdate', nil)
Nenue@61 283 else
Nenue@61 284 self.fg:SetWidth(nw)
Nenue@61 285 end
Nenue@61 286 end)
Nenue@61 287
Nenue@61 288 veneer.cooldown:Show()
Nenue@61 289 veneer.cooldown:SetCooldown(startTime, duration)
Nenue@61 290 else
Nenue@61 291 print('|cFF00FF88'..frame:GetName()..'|r', 'duration zero')
Nenue@61 292 veneer.progress:SetScript('OnUpdate', nil)
Nenue@61 293 veneer.progress:Hide()
Nenue@61 294 veneer.cooldown:Hide()
Nenue@61 295 end
Nenue@61 296 else
Nenue@61 297 veneer.progress:Hide()
Nenue@61 298 veneer.cooldown:SetCooldown(0,0)
Nenue@61 299 veneer.cooldown:Hide()
Nenue@61 300 print('|cFF88FF00'..frame:GetName()..'|r', 'nil duration')
Nenue@59 301 end
Nenue@59 302 veneer:Show()
Nenue@59 303 end
Nenue@59 304
Nenue@59 305
Nenue@59 306 --- Provides the number of changed indices for use in deciding between partial and full veneer updates
Nenue@59 307 local CacheCheck = function(frame, ...)
Nenue@59 308 aurasCache[frame] = aurasCache[frame] or {}
Nenue@59 309 local hasChange = 0
Nenue@59 310 local numVals = select('#',...)
Nenue@59 311 for i = 1, numVals do
Nenue@59 312 local arg = select(i, ...)
Nenue@59 313 if aurasCache[frame][i] ~= arg then
Nenue@59 314 hasChange = hasChange + 1
Nenue@59 315 end
Nenue@59 316 aurasCache[frame][i] = arg
Nenue@59 317 end
Nenue@59 318 return hasChange
Nenue@59 319 end
Nenue@59 320
Nenue@59 321 local AuraButton_Update = function(name, index, filter)
Nenue@59 322 local bName = name..index
Nenue@59 323 local frame = _G[bName]
Nenue@59 324 if frame and frame:IsVisible() then
Nenue@59 325 tickCounter[frame] = (tickCounter[frame] or 0) + 1
Nenue@68 326
Nenue@68 327
Nenue@68 328
Nenue@59 329 local cacheDiff = CacheCheck(frame, UnitAura(frame.unit, frame:GetID(), frame.filter))
Nenue@68 330
Nenue@61 331 -- if the name or expirationTime changed
Nenue@61 332 if (cacheDiff >= 1) then
Nenue@68 333 print('|cFFFF4400', frame:GetName(), 'diff:', cacheDiff)
Nenue@61 334 if not skinnedFrames[frame] then
Nenue@61 335 tinsert(pendingFrames, frame)
Nenue@61 336 end
Nenue@59 337 expirationCache[name] = frame.expirationTime
Nenue@59 338 print(unpack(aurasCache[frame]))
Nenue@68 339
Nenue@68 340
Nenue@68 341
Nenue@59 342 UpdateVeneer(frame, aurasCache[frame][6], aurasCache[frame][7])
Nenue@59 343 end
Nenue@59 344
Nenue@59 345 end
Nenue@59 346 end
Nenue@59 347
Nenue@59 348 local BuffFrame_UpdateAllBuffAnchors = function()
Nenue@59 349 local todo = {}
Nenue@59 350 if #pendingFrames >= 1 then
Nenue@59 351
Nenue@59 352 print('|cFFBBFF00AllBuffAnchors|r', #pendingFrames)
Nenue@59 353 while pendingFrames[1] do
Nenue@59 354 local frame = tremove(pendingFrames)
Nenue@59 355 tinsert(todo, frame:GetName())
Nenue@59 356
Nenue@61 357 -- re-apply custom anchors
Nenue@59 358 end
Nenue@68 359 print(tconcat(todo, ', '))
Nenue@59 360 end
Nenue@59 361 --BuffButton1
Nenue@59 362 --DebuffButton1
Nenue@61 363 --todo: separate frame groups and iterate over them at appropriate times
Nenue@60 364 if BuffButton1 then
Nenue@68 365 TempEnchant1:SetPoint('TOPRIGHT', BuffButton1, 'TOPRIGHT', BuffButton1:GetWidth()+4, 0)
Nenue@60 366 end
Nenue@60 367
Nenue@70 368 local lastBuff, topBuff
Nenue@70 369 for i = 1, BUFF_ACTUAL_DISPLAY do
Nenue@70 370 local buff = _G['BuffButton'..i]
Nenue@70 371 if buff then
Nenue@71 372 if mod(i,12) == 1 then
Nenue@71 373 if i == 1 then
Nenue@71 374 buff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
Nenue@71 375 else
Nenue@71 376 buff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@71 377 end
Nenue@70 378 topBuff = buff
Nenue@70 379 else
Nenue@71 380 buff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT', -BUFF_BUTTON_SPACING_H, 0)
Nenue@70 381 end
Nenue@70 382 lastBuff = buff
Nenue@70 383 end
Nenue@70 384 end
Nenue@70 385
Nenue@70 386 for i = 1, DEBUFF_ACTUAL_DISPLAY do
Nenue@70 387 local debuff = _G['DebuffButton'..i]
Nenue@70 388 if debuff then
Nenue@70 389 if i == 1 then
Nenue@70 390 if topBuff then
Nenue@71 391 debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@70 392 else
Nenue@70 393 debuff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
Nenue@70 394 end
Nenue@70 395 topBuff = debuff
Nenue@70 396 elseif mod(i, 12) == 1 then
Nenue@71 397 debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@70 398 topBuff = debuff
Nenue@70 399 else
Nenue@71 400 debuff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT', -BUFF_BUTTON_SPACING_H, 0)
Nenue@70 401 end
Nenue@70 402 lastBuff = debuff
Nenue@70 403 end
Nenue@70 404 end
Nenue@70 405
Nenue@59 406 end
Nenue@59 407
Nenue@59 408 local AuraButton_UpdateDuration = function(frame, timeLeft)
Nenue@69 409 local veneer = GetVeneer(frame)
Nenue@60 410 local hours = floor(timeLeft/3600)
Nenue@60 411 local minutes = floor(mod(timeLeft, 3600)/60)
Nenue@60 412 local seconds = floor(mod(timeLeft, 60))
Nenue@60 413 local timeString = '%ds'
Nenue@59 414 if timeLeft > 3600 then
Nenue@60 415 timeString = format('%d:%02d', hours, minutes)
Nenue@60 416 elseif timeLeft > 60 then
Nenue@60 417 timeString = format('%d:%02d', minutes, seconds)
Nenue@61 418 else
Nenue@60 419 timeString = format('%d', seconds)
Nenue@59 420 end
Nenue@59 421
Nenue@60 422
Nenue@69 423 veneer.duration:SetText(timeString)
Nenue@69 424 veneer.duration:SetVertexColor(1,1,1)
Nenue@59 425 end
Nenue@59 426
Nenue@59 427
Nenue@59 428 -- Obtains the first instance of Tenchant use
Nenue@59 429
Nenue@59 430 local TemporaryEnchantFrame_Update = function(...)
Nenue@59 431 local numVals = select('#', ...)
Nenue@59 432 local numItems = numVals / 4
Nenue@59 433 if numItems >= 1 then
Nenue@59 434 for itemIndex = numItems, 1, -1 do
Nenue@59 435 local frame = _G['TempEnchant'..itemIndex]
Nenue@59 436 local hasEnchant, timeRemaining, enchantCharges = select((4 * (itemIndex -1)) + 1, ...)
Nenue@59 437
Nenue@59 438
Nenue@59 439 if hasEnchant then
Nenue@59 440 local endTime = floor(GetTime()*1000) + timeRemaining
Nenue@59 441
Nenue@59 442
Nenue@59 443 --print(endTime)
Nenue@59 444 if endTime ~= expirationCache[frame] then
Nenue@59 445 if expirationCache[frame] then
Nenue@59 446 print(endTime, expirationCache[frame], endTime - expirationCache[frame])
Nenue@59 447 end
Nenue@59 448 expirationCache[frame] = endTime
Nenue@59 449 print('push tempenchant timer update', timeRemaining / 1000, GetTime()+(timeRemaining/1000))
Nenue@59 450 UpdateVeneer(frame, timeRemaining/1000, GetTime()+(timeRemaining/1000))
Nenue@59 451 end
Nenue@59 452 else
Nenue@59 453 GetVeneer(frame):Hide()
Nenue@59 454 end
Nenue@59 455
Nenue@59 456 end
Nenue@59 457
Nenue@59 458 end
Nenue@59 459
Nenue@59 460 end
Nenue@59 461
Nenue@59 462 local BuffFrame_Update = function(...)
Nenue@61 463
Nenue@59 464 end
Nenue@59 465
Nenue@59 466
Nenue@59 467 hooksecurefunc("BuffFrame_Update", BuffFrame_Update)
Nenue@59 468 hooksecurefunc("AuraButton_UpdateDuration", AuraButton_UpdateDuration)
Nenue@59 469 hooksecurefunc("AuraButton_Update", AuraButton_Update)
Nenue@59 470 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", BuffFrame_UpdateAllBuffAnchors)
Nenue@59 471 hooksecurefunc("TemporaryEnchantFrame_Update", TemporaryEnchantFrame_Update)
Nenue@59 472
Nenue@59 473 -- The TempEnchant frames are hardcoded in the base FrameXML, so get them now
Nenue@59 474 for i = 1, 3 do
Nenue@59 475
Nenue@59 476 SkinFrame('TempEnchant'..i)
Nenue@68 477 _G['TempEnchant'..i..'Border']:SetVertexColor(0.5,0,1,1)
Nenue@59 478
Nenue@59 479 end
Nenue@59 480
Nenue@59 481 plugin.init = function ()
Nenue@61 482
Nenue@61 483
Nenue@61 484
Nenue@59 485 plugin.db = vn.db[PLUGIN_NAME]
Nenue@59 486 end