@@ -29,9 +29,10 @@ if (Private.Incompatible) then
29
29
return
30
30
end
31
31
32
- local Module = Bagnon :NewModule (Addon , Private )
32
+ local Bagnon = Bagnon or Bagnonium
33
+ local Module = Bagnon :NewModule (Addon , Private ) -- "WildAddon-1.1"
33
34
34
- local Cache = LibStub (" LibItemCache-2.0" , true )
35
+ -- local Cache = LibStub("LibItemCache-2.0", true)
35
36
local Container = LibStub (" C_Everywhere" ).Container
36
37
37
38
-- Lua API
@@ -42,8 +43,10 @@ local string_match = string.match
42
43
local tonumber = tonumber
43
44
44
45
-- 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
47
50
48
51
local retail = Private .IsRetail
49
52
local cache = Private .cache
@@ -79,12 +82,11 @@ for i = 0, (retail and Enum.ItemQualityMeta.NumValues or NUM_LE_ITEM_QUALITYS) -
79
82
end
80
83
81
84
Module :AddUpdater (function (self )
82
-
83
85
local db = BagnonItemLevel_DB
84
86
local message , color , _
85
87
86
88
if (self .hasItem ) then
87
-
89
+
88
90
-- https://wowpedia.fandom.com/wiki/Enum.InventoryType
89
91
local class , equip , level , quality = self .info .class , self .info .equip , self .info .level , self .info .quality
90
92
if (not equip and self .info .hyperlink ) then
@@ -100,25 +102,22 @@ Module:AddUpdater(function(self)
100
102
if (db .enableRarityColoring ) then
101
103
color = quality and colors [quality ]
102
104
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
110
109
end
111
110
message = level
112
111
end
113
112
114
- -- Only retail tooltips contain iteminfo for gear,
115
- -- but only retail tooltips need it.
113
+ -- Parse itemlevel in retail, and bag slots.
116
114
if (isgear and retail ) or (isbag ) then
117
115
118
116
if (retail ) then
119
117
120
118
local tooltipData = C_TooltipInfo .GetBagItem (self :GetBag (), self :GetID ())
121
119
if (tooltipData ) then
120
+
122
121
if (isgear ) then
123
122
for i = 2 ,3 do
124
123
local msg = tooltipData .lines [i ] and tooltipData .lines [i ].leftText
@@ -179,6 +178,7 @@ Module:AddUpdater(function(self)
179
178
180
179
end
181
180
end
181
+
182
182
end
183
183
184
184
if (message and message > 1 ) then
0 commit comments