Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes category display for static items #684

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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