WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   RealUI (https://www.wowinterface.com/forums/forumdisplay.php?f=163)
-   -   Item level (https://www.wowinterface.com/forums/showthread.php?t=56546)

Imax1967 08-15-18 04:20 PM

Item level
 
1 Attachment(s)
How come the item level doesnt match up to the item that you mouse over while holding shift?

candrid 08-15-18 08:09 PM

Quote:

Originally Posted by Imax1967 (Post 329586)
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.

Ammako 08-15-18 10:50 PM

It's a bug with GetDetailedItemLevelInfo()

Quote:

<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

runamonk 08-16-18 06:53 AM

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


All times are GMT -6. The time now is 11:16 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI