annotate Modules/BuffFrame.lua @ 74:cd6e78091b04

- clear points from anything that is xml
author Nenue
date Tue, 23 Aug 2016 19:50:10 -0400
parents 95ed343c3a42
children d9d16e67725c
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@73 75 local veneer = vn.GetVeneer(frame, 'VeneerBuffTemplate')
Nenue@60 76 local id = frame:GetID()
Nenue@59 77
Nenue@59 78
Nenue@71 79 veneer.progress:SetPoint('BOTTOMLEFT', veneer, 'BOTTOMLEFT', 0, -6)
Nenue@71 80 veneer.progress:SetPoint('TOPRIGHT', veneer, 'BOTTOMRIGHT', 0, -1)
Nenue@68 81 veneer.progress:SetHeight(BUFF_PROGRESS_SIZE + (BUFF_PROGRESS_INSET * 2))
Nenue@59 82
Nenue@59 83 veneer.progress.fg:SetColorTexture(0,1,0,1)
Nenue@68 84 veneer.progress.fg:SetPoint('BOTTOMLEFT', BUFF_PROGRESS_INSET,BUFF_PROGRESS_INSET)
Nenue@68 85 veneer.progress.fg:SetPoint('TOP', 0, -BUFF_PROGRESS_INSET)
Nenue@59 86
Nenue@73 87 veneer.duration:SetFontObject(VeneerNumberFont)
Nenue@74 88 veneer.duration:ClearAllPoints()
Nenue@74 89 veneer.duration:SetPoint('BOTTOM', veneer, 'BOTTOM', 0, 2)
Nenue@59 90
Nenue@69 91 veneer.count:SetFontObject(VeneerNumberFont)
Nenue@74 92 veneer.count:ClearAllPoints()
Nenue@74 93 veneer.count:SetPoint('TOPRIGHT', veneer, 'TOPRIGHT', -3, -3)
Nenue@68 94
Nenue@73 95 veneer.underlay:SetParent(UIParent)
Nenue@73 96 veneer.underlay:SetFrameStrata('BACKGROUND')
Nenue@74 97 veneer.border:SetColorTexture(0,0,0,0)
Nenue@68 98 veneer.border:SetPoint('TOPLEFT', veneer, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U)
Nenue@68 99 veneer.border:SetPoint('BOTTOMRIGHT', veneer, 'BOTTOMRIGHT', BORDER_SIZE_R, -BORDER_SIZE_D)
Nenue@68 100 veneer.border:Show()
Nenue@68 101
Nenue@69 102
Nenue@59 103 end
Nenue@59 104
Nenue@59 105
Nenue@69 106 return _G[name..'Veneer']
Nenue@59 107 end
Nenue@59 108
Nenue@68 109
Nenue@68 110 -- Associates skinning elements with said button
Nenue@68 111 local SkinFrame = function(name)
Nenue@68 112 local frame = _G[name ]
Nenue@68 113 if skinnedFrames[frame] then
Nenue@68 114 print('|cFFFF4400Attempting to skin a frame that already went through.|r')
Nenue@68 115 return
Nenue@68 116 end
Nenue@68 117 print('|cFFFFFF00Adopting', name)
Nenue@68 118
Nenue@68 119 local icon = _G[name .. 'Icon']
Nenue@68 120 local border = _G[name .. 'Border']
Nenue@68 121 local count = _G[name .. 'Count']
Nenue@68 122 local duration = _G[name .. 'Duration']
Nenue@69 123 local veneer = GetVeneer(frame)
Nenue@68 124
Nenue@68 125 skinnedFrames[frame] = frame
Nenue@68 126 frame:SetSize(BUFF_BUTTON_SIZE,BUFF_BUTTON_SIZE)
Nenue@68 127
Nenue@68 128 local offset = BUFF_BUTTON_ZOOM/2
Nenue@68 129 icon:SetTexCoord(offset, 1 - offset, offset, 1 - offset)
Nenue@68 130 if border then
Nenue@68 131 border:Hide()
Nenue@68 132 hooksecurefunc(border, 'SetVertexColor', function(frame, r, g, b, a)
Nenue@68 133 frame:Hide()
Nenue@68 134 print('|cFF0088FFborder:SetVertexColor|r', r,g,b,a)
Nenue@71 135 veneer.progress.fg:SetColorTexture(r,g,b,a)
Nenue@68 136 end)
Nenue@68 137
Nenue@68 138 local color = DebuffTypeColor["none"]
Nenue@68 139 if aurasCache[frame] and aurasCache[frame][5] then
Nenue@68 140 color = DebuffTypeColor[aurasCache[frame][5]]
Nenue@68 141 end
Nenue@68 142
Nenue@71 143 veneer.progress.fg:SetColorTexture(color.r,color.g,color.b)
Nenue@73 144 veneer.border:SetColorTexture(color.r,color.g,color.b)
Nenue@68 145 end
Nenue@68 146 if duration then
Nenue@68 147 duration:ClearAllPoints()
Nenue@69 148 --duration:SetPoint('TOP', frame, 'BOTTOM', 0, -8)
Nenue@69 149 --duration:SetFontObject(VeneerNumberFont)
Nenue@69 150 --duration:SetDrawLayer('OVERLAY')
Nenue@68 151
Nenue@69 152 hooksecurefunc(duration, 'Hide', function(self, text)
Nenue@69 153 veneer.duration:Hide()
Nenue@69 154 end)
Nenue@69 155 hooksecurefunc(duration, 'Show', function(self, text)
Nenue@69 156 veneer.duration:Show()
Nenue@69 157 end)
Nenue@69 158 end
Nenue@69 159 if count then
Nenue@69 160 count:ClearAllPoints()
Nenue@69 161 hooksecurefunc(count, 'SetText', function(self, text)
Nenue@74 162 print(self:GetName(), 'SetText', text)
Nenue@74 163 local n = veneer.count:GetNumPoints()
Nenue@74 164 for i = 1, n do
Nenue@74 165 print(i, veneer.count:GetPoint(n))
Nenue@74 166 end
Nenue@74 167 veneer.count.isUpdating = true
Nenue@69 168 self:Hide()
Nenue@74 169 veneer.count:Show()
Nenue@69 170 veneer.count:SetText(text)
Nenue@74 171 veneer.count.isUpdating = false
Nenue@69 172 end)
Nenue@74 173 hooksecurefunc(count, 'Hide', function(self)
Nenue@74 174 if veneer.count.isUpdating then
Nenue@74 175 print('|cFFFF4400blocked Hide hook|r')
Nenue@74 176 return
Nenue@74 177 end
Nenue@74 178
Nenue@74 179 print(self:GetName(), 'Hide')
Nenue@69 180 veneer.count:Hide()
Nenue@69 181 end)
Nenue@74 182 hooksecurefunc(count, 'Show', function(self)
Nenue@74 183 print(self:GetName(), 'Show')
Nenue@69 184 veneer.count:Show()
Nenue@69 185 end)
Nenue@68 186 end
Nenue@68 187
Nenue@68 188
Nenue@68 189 hooksecurefunc(frame, "Hide", function(self)
Nenue@68 190 local isVisible = self:IsVisible()
Nenue@68 191 if isVisible ~= visibility[self] then
Nenue@68 192 visibility[self] = isVisible
Nenue@68 193 end
Nenue@68 194 veneer:Hide()
Nenue@73 195 veneer.underlay:Hide()
Nenue@68 196 end)
Nenue@68 197
Nenue@68 198 hooksecurefunc(frame, 'Show', function(self)
Nenue@68 199 veneer:Show()
Nenue@68 200 local isVisible = self:IsVisible()
Nenue@68 201 if isVisible ~= visibility[self] then
Nenue@68 202 print('|cFFFFFF00SHOW|r', self:GetName())
Nenue@68 203 visibility[self] = isVisible
Nenue@68 204 end
Nenue@74 205 veneer.underlay:Show()
Nenue@68 206 end)
Nenue@68 207
Nenue@68 208 anchors[frame] = veneer
Nenue@68 209 end
Nenue@68 210
Nenue@68 211 local Aura_SetBorderColor = function(self, r,g,b,a) end
Nenue@68 212 local Aura_OnShow = function(self) end
Nenue@68 213 local Aura_OnHide = function(self) end
Nenue@68 214
Nenue@61 215 --- Set widgets to reflect the passed parameters
Nenue@59 216 local UpdateVeneer = function (frame, duration, expires)
Nenue@59 217 local veneer = GetVeneer(frame)
Nenue@68 218 -- is it a new button?
Nenue@68 219 if not skinnedFrames[frame] then
Nenue@68 220 SkinFrame(frame:GetName())
Nenue@68 221 end
Nenue@68 222
Nenue@68 223 if frame.filter == 'HARMFUL' then
Nenue@68 224
Nenue@68 225 veneer.border:Show()
Nenue@74 226 else
Nenue@74 227 veneer.border:Hide()
Nenue@68 228 end
Nenue@68 229
Nenue@59 230
Nenue@61 231 if expires and duration then
Nenue@61 232 if duration ~= 0 then
Nenue@61 233 local startTime = (expires - duration)
Nenue@61 234 local endTime = expires or 0
Nenue@61 235 print('|cFF0088FF'..frame:GetName()..'|r', duration, expires)
Nenue@61 236 veneer.progress:Show()
Nenue@61 237 veneer.elapsed = 0
Nenue@61 238 veneer.progress:SetScript('OnUpdate', function(self, elapsed)
Nenue@61 239 veneer.elapsed = veneer.elapsed + elapsed
Nenue@60 240
Nenue@67 241 local w = floor(veneer.progress:GetWidth()+.5) - (BUFF_PROGRESS_INSET*2)
Nenue@61 242 local t = GetTime()
Nenue@61 243 local progress = (t - startTime) / duration
Nenue@61 244
Nenue@67 245 local nw = (w - (w * progress))
Nenue@61 246 if veneer.elapsed >= 0.25 then
Nenue@61 247
Nenue@68 248 tprint(t, startTime, floor(progress*100), w * progress, nw, w)
Nenue@61 249 veneer.elapsed = 0.25 - veneer.elapsed
Nenue@61 250 end
Nenue@61 251 if (progress >= 1) or not frame:IsVisible() then
Nenue@61 252 veneer.startTime = nil
Nenue@61 253 self:Hide()
Nenue@61 254 self:SetScript('OnUpdate', nil)
Nenue@61 255 else
Nenue@61 256 self.fg:SetWidth(nw)
Nenue@61 257 end
Nenue@61 258 end)
Nenue@61 259
Nenue@61 260 veneer.cooldown:Show()
Nenue@61 261 veneer.cooldown:SetCooldown(startTime, duration)
Nenue@61 262 else
Nenue@61 263 print('|cFF00FF88'..frame:GetName()..'|r', 'duration zero')
Nenue@61 264 veneer.progress:SetScript('OnUpdate', nil)
Nenue@61 265 veneer.progress:Hide()
Nenue@61 266 veneer.cooldown:Hide()
Nenue@61 267 end
Nenue@61 268 else
Nenue@61 269 veneer.progress:Hide()
Nenue@61 270 veneer.cooldown:SetCooldown(0,0)
Nenue@61 271 veneer.cooldown:Hide()
Nenue@61 272 print('|cFF88FF00'..frame:GetName()..'|r', 'nil duration')
Nenue@59 273 end
Nenue@59 274 veneer:Show()
Nenue@59 275 end
Nenue@59 276
Nenue@59 277
Nenue@59 278 --- Provides the number of changed indices for use in deciding between partial and full veneer updates
Nenue@59 279 local CacheCheck = function(frame, ...)
Nenue@59 280 aurasCache[frame] = aurasCache[frame] or {}
Nenue@59 281 local hasChange = 0
Nenue@59 282 local numVals = select('#',...)
Nenue@59 283 for i = 1, numVals do
Nenue@59 284 local arg = select(i, ...)
Nenue@59 285 if aurasCache[frame][i] ~= arg then
Nenue@59 286 hasChange = hasChange + 1
Nenue@59 287 end
Nenue@59 288 aurasCache[frame][i] = arg
Nenue@59 289 end
Nenue@59 290 return hasChange
Nenue@59 291 end
Nenue@59 292
Nenue@59 293 local AuraButton_Update = function(name, index, filter)
Nenue@59 294 local bName = name..index
Nenue@59 295 local frame = _G[bName]
Nenue@59 296 if frame and frame:IsVisible() then
Nenue@59 297 tickCounter[frame] = (tickCounter[frame] or 0) + 1
Nenue@59 298 local cacheDiff = CacheCheck(frame, UnitAura(frame.unit, frame:GetID(), frame.filter))
Nenue@61 299 -- if the name or expirationTime changed
Nenue@61 300 if (cacheDiff >= 1) then
Nenue@68 301 print('|cFFFF4400', frame:GetName(), 'diff:', cacheDiff)
Nenue@61 302 if not skinnedFrames[frame] then
Nenue@61 303 tinsert(pendingFrames, frame)
Nenue@61 304 end
Nenue@59 305 expirationCache[name] = frame.expirationTime
Nenue@59 306 print(unpack(aurasCache[frame]))
Nenue@68 307
Nenue@59 308 UpdateVeneer(frame, aurasCache[frame][6], aurasCache[frame][7])
Nenue@59 309 end
Nenue@59 310
Nenue@59 311 end
Nenue@59 312 end
Nenue@59 313
Nenue@59 314 local BuffFrame_UpdateAllBuffAnchors = function()
Nenue@59 315 local todo = {}
Nenue@59 316 if #pendingFrames >= 1 then
Nenue@59 317
Nenue@59 318 print('|cFFBBFF00AllBuffAnchors|r', #pendingFrames)
Nenue@59 319 while pendingFrames[1] do
Nenue@59 320 local frame = tremove(pendingFrames)
Nenue@59 321 tinsert(todo, frame:GetName())
Nenue@59 322
Nenue@61 323 -- re-apply custom anchors
Nenue@59 324 end
Nenue@68 325 print(tconcat(todo, ', '))
Nenue@59 326 end
Nenue@59 327 --BuffButton1
Nenue@59 328 --DebuffButton1
Nenue@61 329 --todo: separate frame groups and iterate over them at appropriate times
Nenue@60 330 if BuffButton1 then
Nenue@68 331 TempEnchant1:SetPoint('TOPRIGHT', BuffButton1, 'TOPRIGHT', BuffButton1:GetWidth()+4, 0)
Nenue@60 332 end
Nenue@60 333
Nenue@70 334 local lastBuff, topBuff
Nenue@74 335 local numBuffs = 0
Nenue@70 336 for i = 1, BUFF_ACTUAL_DISPLAY do
Nenue@70 337 local buff = _G['BuffButton'..i]
Nenue@70 338 if buff then
Nenue@74 339 numBuffs = numBuffs + 1
Nenue@74 340 buff:ClearAllPoints()
Nenue@74 341 if mod(numBuffs,12) == 1 then
Nenue@74 342 if numBuffs == 1 then
Nenue@71 343 buff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
Nenue@74 344 plugin.currentTop = buff:GetTop()
Nenue@71 345 else
Nenue@71 346 buff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@71 347 end
Nenue@70 348 topBuff = buff
Nenue@70 349 else
Nenue@71 350 buff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT', -BUFF_BUTTON_SPACING_H, 0)
Nenue@70 351 end
Nenue@70 352 lastBuff = buff
Nenue@70 353 end
Nenue@70 354 end
Nenue@70 355
Nenue@74 356 numBuffs = 0
Nenue@70 357 for i = 1, DEBUFF_ACTUAL_DISPLAY do
Nenue@70 358 local debuff = _G['DebuffButton'..i]
Nenue@70 359 if debuff then
Nenue@74 360 numBuffs = numBuffs + 1
Nenue@74 361 if numBuffs == 1 then
Nenue@70 362 if topBuff then
Nenue@71 363 debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@70 364 else
Nenue@70 365 debuff:SetPoint('TOPRIGHT', UIParent, 'TOPRIGHT', -120, -6)
Nenue@70 366 end
Nenue@70 367 topBuff = debuff
Nenue@74 368 elseif mod(numBuffs, 12) == 1 then
Nenue@71 369 debuff:SetPoint('TOPRIGHT', topBuff, 'BOTTOMRIGHT', 0, -BUFF_BUTTON_SPACING_V)
Nenue@70 370 topBuff = debuff
Nenue@70 371 else
Nenue@71 372 debuff:SetPoint('TOPRIGHT', lastBuff, 'TOPLEFT', -BUFF_BUTTON_SPACING_H, 0)
Nenue@70 373 end
Nenue@70 374 lastBuff = debuff
Nenue@70 375 end
Nenue@70 376 end
Nenue@70 377
Nenue@74 378 if lastBuff then
Nenue@74 379 plugin.currentBottom = lastBuff:GetBottom()
Nenue@74 380 end
Nenue@59 381 end
Nenue@59 382
Nenue@59 383 local AuraButton_UpdateDuration = function(frame, timeLeft)
Nenue@69 384 local veneer = GetVeneer(frame)
Nenue@60 385 local hours = floor(timeLeft/3600)
Nenue@60 386 local minutes = floor(mod(timeLeft, 3600)/60)
Nenue@60 387 local seconds = floor(mod(timeLeft, 60))
Nenue@60 388 local timeString = '%ds'
Nenue@59 389 if timeLeft > 3600 then
Nenue@60 390 timeString = format('%d:%02d', hours, minutes)
Nenue@60 391 elseif timeLeft > 60 then
Nenue@60 392 timeString = format('%d:%02d', minutes, seconds)
Nenue@61 393 else
Nenue@60 394 timeString = format('%d', seconds)
Nenue@59 395 end
Nenue@59 396
Nenue@74 397 if timeLeft < 10 then
Nenue@74 398 if not veneer.duration.getHuge then
Nenue@74 399 veneer.duration.getHuge = true
Nenue@74 400 veneer.duration:SetFontObject(VeneerNumberFontLarge)
Nenue@74 401 veneer.duration:SetTextColor(1,0,0,1)
Nenue@74 402 end
Nenue@74 403 else
Nenue@74 404 if veneer.duration.getHuge then
Nenue@74 405 veneer.duration.getHuge = nil
Nenue@74 406 veneer.duration:SetFontObject(VeneerNumberFont)
Nenue@74 407 veneer.duration:SetTextColor(1,1,1,1)
Nenue@74 408 end
Nenue@74 409
Nenue@74 410 end
Nenue@74 411
Nenue@60 412
Nenue@69 413 veneer.duration:SetText(timeString)
Nenue@59 414 end
Nenue@59 415
Nenue@59 416
Nenue@59 417 -- Obtains the first instance of Tenchant use
Nenue@59 418
Nenue@59 419 local TemporaryEnchantFrame_Update = function(...)
Nenue@59 420 local numVals = select('#', ...)
Nenue@59 421 local numItems = numVals / 4
Nenue@59 422 if numItems >= 1 then
Nenue@59 423 for itemIndex = numItems, 1, -1 do
Nenue@59 424 local frame = _G['TempEnchant'..itemIndex]
Nenue@59 425 local hasEnchant, timeRemaining, enchantCharges = select((4 * (itemIndex -1)) + 1, ...)
Nenue@59 426
Nenue@59 427
Nenue@59 428 if hasEnchant then
Nenue@59 429 local endTime = floor(GetTime()*1000) + timeRemaining
Nenue@59 430
Nenue@59 431
Nenue@59 432 --print(endTime)
Nenue@59 433 if endTime ~= expirationCache[frame] then
Nenue@59 434 if expirationCache[frame] then
Nenue@59 435 print(endTime, expirationCache[frame], endTime - expirationCache[frame])
Nenue@59 436 end
Nenue@59 437 expirationCache[frame] = endTime
Nenue@59 438 print('push tempenchant timer update', timeRemaining / 1000, GetTime()+(timeRemaining/1000))
Nenue@59 439 UpdateVeneer(frame, timeRemaining/1000, GetTime()+(timeRemaining/1000))
Nenue@59 440 end
Nenue@59 441 else
Nenue@59 442 GetVeneer(frame):Hide()
Nenue@59 443 end
Nenue@59 444
Nenue@59 445 end
Nenue@59 446
Nenue@59 447 end
Nenue@59 448
Nenue@59 449 end
Nenue@59 450
Nenue@59 451 local BuffFrame_Update = function(...)
Nenue@61 452
Nenue@59 453 end
Nenue@59 454
Nenue@59 455
Nenue@59 456 hooksecurefunc("BuffFrame_Update", BuffFrame_Update)
Nenue@59 457 hooksecurefunc("AuraButton_UpdateDuration", AuraButton_UpdateDuration)
Nenue@59 458 hooksecurefunc("AuraButton_Update", AuraButton_Update)
Nenue@59 459 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", BuffFrame_UpdateAllBuffAnchors)
Nenue@59 460 hooksecurefunc("TemporaryEnchantFrame_Update", TemporaryEnchantFrame_Update)
Nenue@59 461
Nenue@59 462 -- The TempEnchant frames are hardcoded in the base FrameXML, so get them now
Nenue@59 463 for i = 1, 3 do
Nenue@59 464
Nenue@59 465 SkinFrame('TempEnchant'..i)
Nenue@68 466 _G['TempEnchant'..i..'Border']:SetVertexColor(0.5,0,1,1)
Nenue@59 467
Nenue@59 468 end
Nenue@59 469
Nenue@59 470 plugin.init = function ()
Nenue@61 471
Nenue@61 472
Nenue@61 473
Nenue@59 474 plugin.db = vn.db[PLUGIN_NAME]
Nenue@59 475 end