X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/971304090ee92e27a82533041bd6b222b702552c..521041f750bcf5d25bbf7fcab475e47665cb748b:/kehys/frame.lua diff --git a/kehys/frame.lua b/kehys/frame.lua index 2409d26..535899c 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); @@ -42,15 +43,17 @@ function addon.NewRaidFrame(parent, width, height, unit, attributes, f:Hide(); -- hide frame to have an initial frame:OnShow call f:SetWidth(width); f:SetHeight(height); + f.barwidth = width - 2; -- 1px padding on both sides f:SetAttribute("unit", unit); f.unit = unit; f.displayed = unit; f.vehicle = unit == "player" and "vehicle" or format("%spet", unit); f.prev = {} -- values stored from previous update + f.alert = {}; -- alerting auras -- set up periodic updates updaters[f] = function() if f.updating then - CTimerAfter(0.25, updaters[f]); + CTimerAfter(0.1, updaters[f]); return update(f) end end @@ -63,6 +66,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);