Skip to content

Commit 0f04acf

Browse files
committed
Resolve some issues when opening the UI in combat, and fix ms spikes no longer showing in the "since reset" history range
1 parent d274f67 commit 0f04acf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

AddonProfiler.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ function NAP:GetElelementDataForAddon(addonName, info, bucketsWithinHistory, ove
956956
if not bucketsWithinHistory then
957957
local currentMetrics = snapshotOverrides.endMetrics;
958958
local baselineMetrics = snapshotOverrides.startMetrics;
959-
for field, ms in pairs(msOptionFieldMap) do
959+
for ms, field in pairs(msOptionFieldMap) do
960960
data[field] = (currentMetrics[ms] or 0) - (baselineMetrics[ms] or 0);
961961
end
962962
else
@@ -1326,13 +1326,14 @@ function NAP:InitUI()
13261326
end
13271327

13281328
function display:OnShow()
1329-
UpdateAddOnMemoryUsage()
1330-
self:DoUpdate(true)
1331-
1329+
self.ProfilingDisabledWarning:SetShown(not C_AddOnProfiler.IsEnabled())
13321330
if continuousUpdate then
13331331
self:SetScript("OnUpdate", self.OnUpdate)
13341332
end
1335-
self.ProfilingDisabledWarning:SetShown(not C_AddOnProfiler.IsEnabled())
1333+
RunNextFrame(function()
1334+
UpdateAddOnMemoryUsage()
1335+
end)
1336+
self:DoUpdate(true)
13361337
end
13371338

13381339
function display:OnHide()
@@ -2227,6 +2228,7 @@ function NAP:InitUI()
22272228
display.ProfilingDisabledWarning = CreateFrame("Frame", nil, display)
22282229
do
22292230
local warning = display.ProfilingDisabledWarning
2231+
warning:Hide()
22302232
warning:SetFrameLevel(500)
22312233
warning:SetAllPoints(display.ScrollBox)
22322234
local warningText = warning:CreateFontString(nil, "OVERLAY", "GameFontNormal")

0 commit comments

Comments
 (0)