Skip to content

Commit

Permalink
update inspect item level again when gem data is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Apr 29, 2024
1 parent 446a4dd commit d998d44
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions ElvUI/Core/Modules/Misc/InfoItemLevel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ local rad = rad
local gsub = gsub
local wipe = wipe
local next = next
local time = time
local pairs = pairs
local unpack = unpack

local UnitGUID = UnitGUID
local UnitExists = UnitExists
local CreateFrame = CreateFrame

local InspectItems = {
Expand Down Expand Up @@ -63,8 +65,24 @@ function M:GetInspectPoints(id)
end
end

function M:UpdateInspectInfo(_, arg1)
M:UpdatePageInfo(_G.InspectFrame, 'Inspect', arg1)
do
local inspect = { time = time() }
function M:UpdateInspectAgain()
local now = time() + 1
if (inspect.time < now) and UnitExists(inspect.unit) then
inspect.time = now

E:Delay(0.10, M.UpdatePageInfo, M, _G.InspectFrame, 'Inspect', inspect.guid)
end
end

function M:UpdateInspectInfo(_, arg1)
local frame = _G.InspectFrame
inspect.unit = frame.unit
inspect.guid = arg1

M:UpdatePageInfo(frame, 'Inspect', arg1)
end
end

function M:UpdateCharacterInfo(event)
Expand Down Expand Up @@ -131,8 +149,10 @@ function M:ToggleItemLevelInfo(setupCharacterPage)

if E.db.general.itemLevel.displayInspectInfo then
M:RegisterEvent('INSPECT_READY', 'UpdateInspectInfo')
M:RegisterEvent('GET_ITEM_INFO_RECEIVED', 'UpdateInspectAgain')
else
M:UnregisterEvent('INSPECT_READY')
M:UnregisterEvent('GET_ITEM_INFO_RECEIVED')
M:ClearPageInfo(_G.InspectFrame, 'Inspect')
end
end
Expand Down

0 comments on commit d998d44

Please sign in to comment.