Skip to content

Commit 48e9f8b

Browse files
committed
2.0.101-Release
1 parent 6e83427 commit 48e9f8b

File tree

8 files changed

+36
-101
lines changed

8 files changed

+36
-101
lines changed

Bagnon_ItemLevel/Bagnon_ItemLevel.toc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Interface: 110107
1+
## Interface: 110107, 50500, 11507
22
## IconTexture: Interface\Addons\BagBrother\Art\Bagnon-Plugin.tga
33

44
## Plain Title: Bagnon ItemLevel
@@ -12,8 +12,8 @@
1212
## X-Wago-ID: J96Eg8Gg
1313
## X-License: Custom
1414

15-
## OptionalDeps: TaintLess
16-
## RequiredDeps: Bagnon
15+
## OptionalDeps: TaintLess, Bagnon, Bagnonium
16+
## RequiredDeps: BagBrother
1717
## SavedVariables: BagnonItemLevel_DB
1818

1919
embeds.xml

Bagnon_ItemLevel/Bagnon_ItemLevel_Cata.toc

Lines changed: 0 additions & 20 deletions
This file was deleted.

Bagnon_ItemLevel/Bagnon_ItemLevel_TBC.toc

Lines changed: 0 additions & 20 deletions
This file was deleted.

Bagnon_ItemLevel/Bagnon_ItemLevel_Vanilla.toc

Lines changed: 0 additions & 20 deletions
This file was deleted.

Bagnon_ItemLevel/Bagnon_ItemLevel_Wrath.toc

Lines changed: 0 additions & 20 deletions
This file was deleted.

Bagnon_ItemLevel/dispatcher.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,16 @@ end
8686

8787
-- Hook the updater
8888
if (not BAGNON_ITEMINFO_DISPATCHER) then
89-
local item = Bagnon.ItemSlot or Bagnon.Item
90-
local method = item.UpdateSecondary and "UpdateSecondary" or item.UpdatePrimary and "UpdatePrimary" or item.Update and "Update"
91-
hooksecurefunc(item, method, Private.Dispatcher)
89+
if (Bagnon) then
90+
local item = Bagnon.Item
91+
local method = item.UpdateSecondary and "UpdateSecondary" or item.UpdatePrimary and "UpdatePrimary" or item.Update and "Update"
92+
hooksecurefunc(item, method, Private.Dispatcher)
93+
end
94+
if (Bagnonium) then
95+
local item = Bagnonium.Item
96+
local method = item.UpdateSecondary and "UpdateSecondary" or item.UpdatePrimary and "UpdatePrimary" or item.Update and "Update"
97+
hooksecurefunc(item, method, Private.Dispatcher)
98+
end
9299
end
93100

94101
-- (Re)assign globals

Bagnon_ItemLevel/main.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ if (Private.Incompatible) then
2929
return
3030
end
3131

32-
local Module = Bagnon:NewModule(Addon, Private)
32+
local Bagnon = Bagnon or Bagnonium
33+
local Module = Bagnon:NewModule(Addon, Private) -- "WildAddon-1.1"
3334

34-
local Cache = LibStub("LibItemCache-2.0", true)
35+
--local Cache = LibStub("LibItemCache-2.0", true)
3536
local Container = LibStub("C_Everywhere").Container
3637

3738
-- Lua API
@@ -42,8 +43,10 @@ local string_match = string.match
4243
local tonumber = tonumber
4344

4445
-- WoW API
45-
local C_TooltipInfo, TooltipUtil = C_TooltipInfo, TooltipUtil
46-
local CreateFrame, GetItemInfoInstant, GetItemQualityColor = CreateFrame, GetItemInfoInstant, GetItemQualityColor
46+
local C_Item, C_TooltipInfo, TooltipUtil = C_Item, C_TooltipInfo, TooltipUtil
47+
local CreateFrame, GetItemQualityColor = CreateFrame, GetItemQualityColor
48+
local GetItemInfo = C_Item.GetItemInfo or GetItemInfo
49+
local GetItemInfoInstant = C_Item.GetItemInfoInstant or GetItemInfoInstant
4750

4851
local retail = Private.IsRetail
4952
local cache = Private.cache
@@ -79,12 +82,11 @@ for i = 0, (retail and Enum.ItemQualityMeta.NumValues or NUM_LE_ITEM_QUALITYS) -
7982
end
8083

8184
Module:AddUpdater(function(self)
82-
8385
local db = BagnonItemLevel_DB
8486
local message, color, _
8587

8688
if (self.hasItem) then
87-
89+
8890
-- https://wowpedia.fandom.com/wiki/Enum.InventoryType
8991
local class, equip, level, quality = self.info.class, self.info.equip, self.info.level, self.info.quality
9092
if (not equip and self.info.hyperlink) then
@@ -100,25 +102,22 @@ Module:AddUpdater(function(self)
100102
if (db.enableRarityColoring) then
101103
color = quality and colors[quality]
102104
end
103-
-- Update the bagnon cache
104-
if (not level and not self.info.link) then
105-
self.info.link = Container.GetContainerItemLink(self:GetBag(), self:GetID())
106-
if (Cache) then
107-
self.info = Cache:RestoreItemData(self.info)
108-
end
109-
level = self.info.level
105+
if (not level) then
106+
--local itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID, bindType, expansionID, setID, isCraftingReagent = GetItemInfo(itemInfo)
107+
_, _, _, level = GetItemInfo(self.info.hyperlink)
108+
self.info.level = level
110109
end
111110
message = level
112111
end
113112

114-
-- Only retail tooltips contain iteminfo for gear,
115-
-- but only retail tooltips need it.
113+
-- Parse itemlevel in retail, and bag slots.
116114
if (isgear and retail) or (isbag) then
117115

118116
if (retail) then
119117

120118
local tooltipData = C_TooltipInfo.GetBagItem(self:GetBag(), self:GetID())
121119
if (tooltipData) then
120+
122121
if (isgear) then
123122
for i = 2,3 do
124123
local msg = tooltipData.lines[i] and tooltipData.lines[i].leftText
@@ -179,6 +178,7 @@ Module:AddUpdater(function(self)
179178

180179
end
181180
end
181+
182182
end
183183

184184
if (message and message > 1) then

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.0.101-Release] 2025-08-15
8+
### Added
9+
- Added compatibility with Classic MoP Client Patch 5.5.0.
10+
- Added compatibility with Bagnonium!
11+
12+
### Removed
13+
- Removed dependency on the deprecated LibItemCache-2.0.
14+
715
## [2.0.100-Release] 2025-06-18
816
- Updated for Retail client patch 11.1.7.
917
- Updated for Classic Era client patch 1.15.7.

0 commit comments

Comments
 (0)