Skip to content

Commit

Permalink
Don't show item levels for items way below your gear standard
Browse files Browse the repository at this point in the history
  • Loading branch information
ckaotik committed Oct 29, 2016
1 parent 5fb57e6 commit 94a7c24
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ckaosItemlevels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ addon:SetScript('OnEvent', function(self, event, ...)
if self[event] then self[event](self, event, ...) end
end)

-- TODO this is a cutoff value to avoid low level item level clutter.
addon.minItemLevel = select(2, GetAverageItemLevel()) - 100

-- TODO: use different color scale
local buttons, colors = {}, { -- 0.55,0.55,0.55 -- gray
{1 ,0, 0}, -- red -- worst item
Expand Down Expand Up @@ -57,6 +60,10 @@ local function HideButtonLevel(self)
end

local function UpdateButtonLevel(self, texture)
if addon.minItemLevel < 0 then
addon.minItemLevel = select(2, GetAverageItemLevel()) - 100
end

local button = (self.icon or self.Icon) and self or self:GetParent()
if not button then return end
if not texture or texture == '' or button.noItemLevel then
Expand Down Expand Up @@ -93,6 +100,7 @@ local function UpdateButtonLevel(self, texture)
if itemLevel and equipSlot ~= '' and equipSlot ~= 'INVTYPE_BAG' then
-- local r, g, b = GetItemQualityColor(quality)
itemLevel = LibItemUpgrade:GetUpgradedItemLevel(itemLink) or itemLevel
if itemLevel <= addon.minItemLevel then return end
button.itemLevel:SetText(itemLevel)
button.itemLevel:SetTextColor(GetItemLevelColor(itemLevel))
end
Expand Down

0 comments on commit 94a7c24

Please sign in to comment.