Thread Tools Display Modes
08-15-18, 04:20 PM   #1
Imax1967
A Fallenroot Satyr
Join Date: Oct 2014
Posts: 27
Item level

How come the item level doesnt match up to the item that you mouse over while holding shift?
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_081518_180212.jpg
Views:	352
Size:	489.4 KB
ID:	9088  
  Reply With Quote
08-15-18, 08:09 PM   #2
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 61
Originally Posted by Imax1967 View Post
How come the item level doesnt match up to the item that you mouse over while holding shift?
Sometimes addon's can interfere with the display. It might be something in the Suite you are using.
  Reply With Quote
08-15-18, 10:50 PM   #3
Ammako
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 256
It's a bug with GetDetailedItemLevelInfo()

<Ammako> TheDanW: I think there is an issue with GetDetailedItemLevelInfo("itemLink") involving items that scale accoding to character level, that prevents it from actually returning the correct ilvl as seen in the tooltip. It takes the character level and returns an item level as if that item had been obtained at your current level, even though the item may have been obtained at a lower level, and has a lower item level.
<Ammako> For ex: GetDetailedItemLevelInfo("|cff0070dd|Hitem:155417::::::::114:263:512:11:1:4813:113:::|h[Keeper's Crescent]|h|r") returns 253 as the effectiveILvl, but the actual item is iLvl 244 because it was received at Lv. 113. Likewise, GetDetailedItemLevelInfo("|cff1eff00|Hitem:161183::::::::114:263:512:11:1:4793:114:::|h[Honorable Tiger's Cloak]|h|r") returns the correct item level as effectiveILvl (245), because it was received at Lv. 114 and I
<Ammako> was still Lv. 114 when the item link was generated.
<Ammako> GetDetailedItemLevelInfo("itemLink") goes off link level right now for scaling-enabled items, which is not reliable. Would changing the function to use upgradeValue1 instead fix it?
<TheDanW> not sure exactly why its breaking, we've had it on our list to unify GetDetailedItemLevelInfo with what you'd see in the tooltip, hopefully 8.1, no promises though
  Reply With Quote
08-16-18, 06:53 AM   #4
runamonk
A Theradrim Guardian
 
runamonk's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 61
What Ammako said. I've found the same issue in a couple of the addons I wrote. I ended up having to write a routine that parses the tooltip for the item and pulls the item level from there. I think this is what most people are doing, at least until the correct item level is returned by GetDetailedItemLevelInfo().

Lua Code:
  1. local function GetItemLevel(bagID, slotID, slot)
  2.     local link = GetContainerItemLink(bagID, slotID)
  3.     if link then
  4.         local tip, leftside = CreateFrame('GameTooltip', 'mnkBackpackScanTooltip'), {}
  5.         for i = 1, 5 do
  6.             local L, R = tip:CreateFontString(), tip:CreateFontString()
  7.             L:SetFontObject(GameFontNormal)
  8.             R:SetFontObject(GameFontNormal)
  9.             tip:AddFontStrings(L, R)
  10.             leftside[i] = L
  11.         end
  12.         tip:ClearLines()
  13.         tip.leftside = leftside
  14.         tip:SetOwner(UIParent, 'ANCHOR_NONE')
  15.         --print(link, ' ', slot.itemLevel)
  16.         -- Weird issue with the tooltip not refilling/painting with the details of a bank item. This
  17.         -- resolves that issue and it makes no sense why.
  18.         if bagID < 0 then
  19.             tip:ClearLines()
  20.             tip:SetHyperlink(link)
  21.         end
  22.         tip:ClearLines()
  23.         tip:SetBagItem(bagID, slotID)
  24.         tip:Show()
  25.         for l = 1, #tip.leftside do
  26.             local t = tip.leftside[l]:GetText()
  27.             if t and t:find('Item Level') then
  28.                 local _, i = string.find(t, 'Item Level%s%d')
  29.                 -- check for boosted levels ie Chromeie scenarios.
  30.                 local _, x = string.find(t, " (", 1, true)
  31.                 --print(t, ' ', x)
  32.                 if x then
  33.                     return string.sub(t, i, x-2) or nil
  34.                 end
  35.                 return string.sub(t, i) or nil
  36.             end
  37.         end
  38.         return nil
  39.     else
  40.         return nil
  41.     end
  42. end
  Reply With Quote

WoWInterface » Featured Projects » RealUI » Item level

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off