Skip to content

Commit

Permalink
fixes category display for static items (#684)
Browse files Browse the repository at this point in the history
* Fixed a bug with viewing the item list on custom categories.
  • Loading branch information
zeptognome authored Sep 4, 2024
1 parent bbd91ff commit 0d72e63
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions frames/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,20 +297,20 @@ end
---@return integer
function itemFrame.GetItemContextMatchResult(item)
local itemLocation = ItemLocation:CreateFromBagAndSlot(item.bagID, item:GetID())
if not itemLocation then return ItemButtonUtil.ItemContextMatchResult.DoesNotApply end
if not C_Item.DoesItemExist(itemLocation) then return ItemButtonUtil.ItemContextMatchResult.DoesNotApply end
if not itemLocation:IsBagAndSlot() then return ItemButtonUtil.ItemContextMatchResult.DoesNotApply end
local result = ItemButtonUtil.GetItemContextMatchResultForItem( itemLocation ) --[[@as integer]]
if not const.BACKPACK_BAGS[item.bagID] then return ItemButtonUtil.ItemContextMatchResult.Match end
if result == ItemButtonUtil.ItemContextMatchResult.Match then return ItemButtonUtil.ItemContextMatchResult.Match end
if addon.atBank and addon.Bags.Bank.bankTab >= const.BANK_TAB.ACCOUNT_BANK_1 then
if not C_Bank.IsItemAllowedInBankType( Enum.BankType.Account, itemLocation ) then
return ItemButtonUtil.ItemContextMatchResult.Mismatch
else
return ItemButtonUtil.ItemContextMatchResult.Match
if itemLocation and itemLocation:HasAnyLocation() and itemLocation:IsBagAndSlot() and itemLocation:IsValid() then
local result = ItemButtonUtil.GetItemContextMatchResultForItem( itemLocation ) --[[@as integer]]
if not const.BACKPACK_BAGS[item.bagID] then return ItemButtonUtil.ItemContextMatchResult.Match end
if result == ItemButtonUtil.ItemContextMatchResult.Match then return ItemButtonUtil.ItemContextMatchResult.Match end
if addon.atBank and addon.Bags.Bank.bankTab >= const.BANK_TAB.ACCOUNT_BANK_1 then
if not C_Bank.IsItemAllowedInBankType( Enum.BankType.Account, itemLocation ) then
return ItemButtonUtil.ItemContextMatchResult.Mismatch
else
return ItemButtonUtil.ItemContextMatchResult.Match
end
end
return result or ItemButtonUtil.ItemContextMatchResult.Match
end
return result or ItemButtonUtil.ItemContextMatchResult.Match
return ItemButtonUtil.ItemContextMatchResult.DoesNotApply
end

---@param ctx Context
Expand Down

0 comments on commit 0d72e63

Please sign in to comment.