Only add when we know it
This commit is contained in:
parent
9ad678a541
commit
c2df6ac982
1 changed files with 6 additions and 5 deletions
11
MyAddon.lua
11
MyAddon.lua
|
@ -55,9 +55,6 @@ function GetUnitFromGuid(guid)
|
|||
end
|
||||
|
||||
function events:INSPECT_READY(guid)
|
||||
local itemLevel = C_PaperDollInfo.GetInspectItemLevel(GetUnitFromGuid(guid))
|
||||
print(itemLevel)
|
||||
|
||||
if not inspectInitialized then
|
||||
print("initializing")
|
||||
InspectFontStrings["itemLevel"] = InspectFrame:CreateFontString(nil, "OVERLAY")
|
||||
|
@ -68,8 +65,12 @@ function events:INSPECT_READY(guid)
|
|||
inspectInitialized = true
|
||||
end
|
||||
|
||||
InspectFontStrings["itemLevel"]:SetText(itemLevel)
|
||||
print(InspectFontStrings["itemLevel"]:GetText())
|
||||
|
||||
unit = GetUnitFromGuid(guid)
|
||||
if unit then
|
||||
local itemLevel = C_PaperDollInfo.GetInspectItemLevel(unit)
|
||||
InspectFontStrings["itemLevel"]:SetText(itemLevel)
|
||||
end
|
||||
end
|
||||
|
||||
function events:GOSSIP_SHOW()
|
||||
|
|
Loading…
Reference in a new issue