Skip to content

Commit

Permalink
Fixed a bug with the bank sometimes throwing an error.
Browse files Browse the repository at this point in the history
Fixed item levels (again).
  • Loading branch information
Cidan committed Dec 3, 2023
1 parent 6eb5f5b commit 435f305
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions annotations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ local EventFrame = {}
---@field isNewItem boolean
---@field currentItemCount number
---@field category string
---@field currentItemLevel number

--[[
---@class ItemMixin
Expand Down
1 change: 1 addition & 0 deletions data/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ function items:AttachItemInfo(data)
isNewItem = C_NewItems.IsNewItem(bagid, slotid),
currentItemCount = C_Item.GetStackCount(itemLocation),
category = "",
currentItemLevel = C_Item.GetCurrentItemLevel(itemLocation) --[[@as number]],
}
end

Expand Down
7 changes: 4 additions & 3 deletions frames/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ function itemProto:SetItem(data)
data.itemInfo.classID == Enum.ItemClass.Armor or
data.itemInfo.classID == Enum.ItemClass.Weapon or
data.itemInfo.classID == Enum.ItemClass.Gem then
self.ilvlText:SetText(tostring(data.itemInfo.effectiveIlvl) or "")
self.ilvlText:SetText(tostring(data.itemInfo.currentItemLevel) or "")
if ilvlOpts.color then
local r, g, b = color:GetItemLevelColor(data.itemInfo.effectiveIlvl)
local r, g, b = color:GetItemLevelColor(data.itemInfo.currentItemLevel)
self.ilvlText:SetTextColor(r, g, b, 1)
else
self.ilvlText:SetTextColor(1, 1, 1, 1)
Expand Down Expand Up @@ -223,7 +223,8 @@ function itemProto:GetCategory()
-- when the tradeskill filter is enabled. This makes it so trade goods are
-- labeled as "Tailoring" and not "Tradeskill - Tailoring", which is redundent.
if database:GetCategoryFilter(self.kind, "Type") and not
(self.data.itemInfo.classID == Enum.ItemClass.Tradegoods and database:GetCategoryFilter(self.kind, "TradeSkill")) then
(self.data.itemInfo.classID == Enum.ItemClass.Tradegoods and database:GetCategoryFilter(self.kind, "TradeSkill")) and
self.data.itemInfo.itemType then
category = category .. self.data.itemInfo.itemType --[[@as string]]
end

Expand Down

0 comments on commit 435f305

Please sign in to comment.