Skip to content

Commit

Permalink
2.0.77-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldpaw committed Jul 25, 2023
1 parent 018266f commit dd6f3dc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
51 changes: 32 additions & 19 deletions Bagnon_ItemLevel/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ end

local Module = Bagnon:NewModule(Addon, Private)

local Cache = LibStub("LibItemCache-2.0")
local Container = LibStub("C_Everywhere").Container

-- Speed!
local _G = _G
local ipairs = ipairs
Expand Down Expand Up @@ -87,8 +90,16 @@ Module:AddUpdater(function(self)
local ispet = battlepetclass and class == battlepetclass

-- We only want quality coloring on item- and pet levels, not bag slots.
if (isgear or ispet) and (BagnonItemLevel_DB.enableRarityColoring) then
color = quality and colors[quality]
if (isgear or ispet) then
if (BagnonItemLevel_DB.enableRarityColoring) then
color = quality and colors[quality]
end
-- Update the bagnon cache
if (not level and not self.info.link) then
self.info.link = Container.GetContainerItemLink(self:GetBag(), self:GetID())
self.info = Cache:RestoreItemData(self.info)
level = self.info.level
end
message = level
end

Expand All @@ -99,27 +110,29 @@ Module:AddUpdater(function(self)
if (retail) then

local tooltipData = C_TooltipInfo.GetBagItem(self:GetBag(), self:GetID())
if (tooltipData) then

-- Assign data to 'type' and 'guid' fields.
TooltipUtil.SurfaceArgs(tooltipData)

-- Assign data to 'leftText' fields.
for _, line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
end
-- Assign data to 'type' and 'guid' fields.
TooltipUtil.SurfaceArgs(tooltipData)

if (isgear) then
for i = 2,3 do
local msg = tooltipData.lines[i] and tooltipData.lines[i].leftText
if (not msg) then break end
-- Assign data to 'leftText' fields.
for _, line in ipairs(tooltipData.lines) do
TooltipUtil.SurfaceArgs(line)
end

local itemlevel = string_match(msg, s_item_level)
if (itemlevel) then
itemlevel = tonumber(itemlevel)
if (itemlevel > 0) then
message = itemlevel
if (isgear) then
for i = 2,3 do
local msg = tooltipData.lines[i] and tooltipData.lines[i].leftText
if (not msg) then break end

local itemlevel = string_match(msg, s_item_level)
if (itemlevel) then
itemlevel = tonumber(itemlevel)
if (itemlevel > 0) then
message = itemlevel
end
break
end
break
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.77-Release] 2023-07-25
### Fixed
- Fixed issues occurring with item caches resulting in missing item levels with Bagnon 10.1.3 and higher.

## [2.0.76-Release] 2023-07-22
### Changed
- Updated addon listing icon and text format.
Expand Down

0 comments on commit dd6f3dc

Please sign in to comment.