AdiBags

AdiBags

8M Downloads

Displaying CORRECT ItemLevel 8.0.1 - Solution

Argentru opened this issue ยท 3 comments

commented

Many people noticed that almost all addons, that try to display item levels, show them incorrectly since 7.1 or so (because of scaling tech). Functions, devoted to extracting item level, return incorrect values sometimes. Even newly introduced function GetDetailedItemLevelInfo :) Especially this wrong behavior becomes inappropriate while leveling your character.

Fix for AdiBags\modules\ItemLevel.lua :

Comment this line:
--local level = ItemUpgradeInfo:GetUpgradedItemLevel(link) or 0 -- Ugly workaround

Add this instead:
local item = Item:CreateFromBagAndSlot(button.bag, button.slot)
if ( item ) then
level = item:GetCurrentItemLevel()
end

Also I would recommend you replace the coloring code, since hardcoded item level ranges are irrelevant, and future item level ranges are unpredictable.

Comment this line:
--text:SetTextColor(colorSchemes[settings.colorScheme](level, quality, reqLevel, (loc ~= "")))

Add this instead:
if quality then
local r,g,b=GetItemQualityColor(quality);
text:SetTextColor(r+0.5,g+0.5, b+0.5);
end
Here, 0.5 is a whitening value, so your itemlevels will not draw too black on black dark icons.

commented

I think text:SetTextColor(r+0.5,g+0.5, b+0.5) should actually look like this:
text:SetTextColor((r + 1) / 2, (g + 1) / 2, (b + 1) / 2)

commented

Implemented in 2d532c8.

commented

Worked for me! Big thanks to @Argentru and @lotsoftoons

@Adirelle please review for a possible bug fix!