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

support global lists when checking if an item is equipped or obsolete #385

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions AtlasLootClassic/Addons/Favourites.lua
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,12 @@ function Favourites:IsItemEquippedOrObsolete(itemId, listId)
return obsoleteType
end
end
for listId, listData in pairs(self.globalDb.lists) do
local obsoleteType = self:IsItemEquippedOrObsolete(itemId, listId)
if obsoleteType then
return obsoleteType
end
end
return false
end
if ListBiSCache[listId] then
Expand Down
6 changes: 4 additions & 2 deletions AtlasLootClassic/Addons/Favourites_GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ local function SlotButton_SetSlotItem(self, itemID)
self.modelFrame:TryOn("item:"..itemID)
end
end
local obsoleteType = Favourites:IsItemEquippedOrObsolete(itemID)
local db = Favourites:GetDb()
local listId = db.activeList[1]
local obsoleteType = Favourites:IsItemEquippedOrObsolete(itemID, listId)
if obsoleteType then
if obsoleteType == "obsolete" then
self.ownedItem:SetVertexColor(0.6, 0.6, 0.6) -- Darken items that are obsolete but not owned a bit
Expand Down Expand Up @@ -900,4 +902,4 @@ function GUI:SelectSlot(slotID)
GUI.selectedSlot = nil
end
ShowItemList(slotID)
end
end