X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/19b1609e82debe7790ea5ce6523c4753ea6b7104..0b3d41a83831771704d03158c092b88b3fae848d:/kehys/frame.lua?ds=sidebyside diff --git a/kehys/frame.lua b/kehys/frame.lua index a723f47..57578c7 100644 --- a/kehys/frame.lua +++ b/kehys/frame.lua @@ -6,6 +6,7 @@ local format = string.format; local CreateFrame = CreateFrame; local CTimerAfter = C_Timer.After; +local guids = addon.FrameGuids; local updaters = {}; local function showTooltip(frame) GameTooltip_SetDefaultAnchor(GameTooltip, frame); @@ -23,14 +24,15 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, assert(type(width) == "number", "Frame creation missing width!"); assert(type(height) == "number", "Frame creation missing height!"); assert(type(unit) == "string", "Frame creation missing unit!"); - assert(type(attributes) == "table", - "Frame creation missing attributes table!"); assert(type(update) == "function", "Frame creation missing update function!"); assert(type(event) == "function", "Frame creation missing event function!"); assert(type(onshow) == "function", "Frame creation missing onshow function!"); + if type(attributes) ~= "table" then + attributes = {}; + end local f = CreateFrame( "Button", @@ -48,6 +50,8 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f.displayed = unit; f.vehicle = unit == "player" and "vehicle" or format("%spet", unit); f.prev = {} -- values stored from previous update + f.alert = {}; -- alerting auras + f.heal = {}; -- high healing auras -- set up periodic updates updaters[f] = function() if f.updating then @@ -64,6 +68,10 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f:SetScript("OnHide", function() f:UnregisterAllEvents(); f.updating = false; + if f.guid then + guids[f.guid] = nil; + f.guid = nil; + end end); f:SetScript("OnEvent", event); f:SetScript("OnEnter", showTooltip);