diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index 03ae0b2..aae8b2e 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -561,19 +561,41 @@ function GetThreatStatus(currentThreat, maxThreat) end function GetQuestItemStarterInfo(link) - for _, info in pairs(QIS.QuestItemStarterIDs) do - if match(link, "item:(%d+):") == info then - return true - end - end -end + local isQuestItem, isQuestStarter, invalidQuestItem = false, false, false -function GetInvalidQuestItemInfo(link) - for _, info in pairs(QIS.InvalidQuestItemIDs) do - if match(link, "item:(%d+):") == info then - return true + if link then + local itemType = select(6, GetItemInfo(link)) + + if itemType and itemType == "Quest" then + isQuestItem = true + end + + for _, info in pairs(QIS.QuestItemIDs) do + if match(link, "item:(%d+):") == info then + isQuestItem = true + end + end + + for _, info in pairs(QIS.QuestItemKeyIDs) do + if match(link, "item:(%d+):") == info then + isQuestItem = true + end + end + + for _, info in pairs(QIS.QuestItemStarterIDs) do + if (match(link, "item:(%d+):") == info) then + isQuestStarter = true + end + end + + for _, info in pairs(QIS.InvalidQuestItemIDs) do + if match(link, "item:(%d+):") == info then + invalidQuestItem = true + end end end + + return isQuestItem, isQuestStarter, invalidQuestItem end local LAST_ITEM_ID = 24283 diff --git a/!Compatibility/libs/QuestItemStarterDB.lua b/!Compatibility/libs/QuestItemStarterDB.lua index 81893b0..05c35a5 100644 --- a/!Compatibility/libs/QuestItemStarterDB.lua +++ b/!Compatibility/libs/QuestItemStarterDB.lua @@ -215,8 +215,44 @@ lib.QuestItemStarterIDs = { "23184", -- Flame of Darnassus } +-- Items that are quest items and they are not tagged as quest items. +lib.QuestItemIDs = { + "3082", -- Dargol's Skull +} + +-- Keys that are quest items and they are not tagged as quest items. +lib.QuestItemKeyIDs = { + "2629", -- Intrepid Strongbox Key + "2719", -- Small Brass Key + "3467", -- Dull Iron Key + "3499", -- Burnished Gold Key + "3704", -- Rusted Iron Key + "3930", -- Maury's Key + "4103", -- Shackle Key + "4483", -- Burning Key + "4484", -- Cresting Key + "4485", -- Thundering Key + "5089", -- Console Key + "5475", -- Wooden Key + "5050", -- Ignition Key + "5851", -- Cozzle's Key + "7923", -- Defias Tower Key + "8072", -- Silixiz's Tower Key + "9299", -- Thermaplugg's Safe Combination + "10757", -- Ward of the Defiler + "11079", -- Gor'tesh's Lopped Off Head + "12301", -- Bamboo Cage Key + "20022", -- Azure Key +} + -- For some reason these are tagged as quest items. They are not. lib.InvalidQuestItemIDs = { + "18169", -- Flame Mantle of the Dawn + "18170", -- Frost Mantle of the Dawn + "18171", -- Arcane Mantle of the Dawn + "18172", -- Nature Mantle of the Dawn + "18173", -- Shadow Mantle of the Dawn + "18182", -- Chromatic Mantle of the Dawn "20076", -- Zandalar Signet of Mojo "20078", -- Zandalar Signet of Serenity "20077", -- Zandalar Signet of Might diff --git a/ElvUI/Modules/Bags/Bags.lua b/ElvUI/Modules/Bags/Bags.lua index a23e6c6..3d03782 100644 --- a/ElvUI/Modules/Bags/Bags.lua +++ b/ElvUI/Modules/Bags/Bags.lua @@ -270,9 +270,10 @@ function B:UpdateSlot(bagID, slotID) slot:SetBackdropBorderColor(unpack(B.ProfessionColors[bagType])) slot.ignoreBorderColors = true elseif clink then - local iLink, iLvl, iType, itemEquipLoc - slot.name, iLink, slot.rarity, iLvl, _, iType, _, _, itemEquipLoc = GetItemInfo(match(clink, "item:(%d+)")) + local iLvl, iType, itemEquipLoc, _ + slot.name, _, slot.rarity, iLvl, _, iType, _, _, itemEquipLoc = GetItemInfo(match(clink, "item:(%d+)")) + local isQuestItem, isQuestStarter, invalidQuestItem = GetQuestItemStarterInfo(clink) local r, g, b if slot.rarity then @@ -298,13 +299,12 @@ function B:UpdateSlot(bagID, slotID) end -- color slot according to item quality - if (iType and iType == "Quest") and not GetInvalidQuestItemInfo(iLink) then - if GetQuestItemStarterInfo(iLink) then - slot.QuestIcon:Show() - slot:SetBackdropBorderColor(unpack(B.QuestColors.questStarter)) - else - slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem)) - end + if isQuestStarter then + slot.QuestIcon:Show() + slot:SetBackdropBorderColor(unpack(B.QuestColors.questStarter)) + slot.ignoreBorderColors = true + elseif (isQuestItem and not invalidQuestItem) or isQuestStarter then + slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem)) slot.ignoreBorderColors = true elseif slot.rarity and slot.rarity > 1 then slot:SetBackdropBorderColor(r, g, b) @@ -670,15 +670,6 @@ function B:Layout(isBank) f.keyFrame.slots[i].cooldown:SetModelScale(buttonSize / (37 / 0.75)) E:RegisterCooldown(f.keyFrame.slots[i].cooldown) - if not f.keyFrame.slots[i].QuestIcon then - local QuestIcon = f.keyFrame.slots[i]:CreateTexture(nil, "OVERLAY") - QuestIcon:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\bagQuestIcon") - QuestIcon:SetTexCoord(0, 1, 0, 1) - E:SetInside(QuestIcon) - QuestIcon:Hide() - f.keyFrame.slots[i].QuestIcon = QuestIcon - end - f.keyFrame.slots[i].iconTexture = _G[f.keyFrame.slots[i]:GetName().."IconTexture"] E:SetInside(f.keyFrame.slots[i].iconTexture, f.keyFrame.slots[i]) f.keyFrame.slots[i].iconTexture:SetTexCoord(unpack(E.TexCoords)) @@ -724,21 +715,16 @@ function B:UpdateKeySlot(slotID) if clink then local _, r, g, b - local iLink, iType - slot.name, iLink, slot.rarity, _, _, iType = GetItemInfo(match(clink, "item:(%d+)")) + slot.name, _, slot.rarity = GetItemInfo(match(clink, "item:(%d+)")) + local isQuestItem, isQuestStarter, invalidQuestItem = GetQuestItemStarterInfo(clink) if slot.rarity then r, g, b = GetItemQualityColor(slot.rarity) end - if iType and iType == "Quest" then - if GetQuestItemStarterInfo(iLink) then - slot.QuestIcon:Show() - slot:SetBackdropBorderColor(unpack(B.QuestColors.questStarter)) - else - slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem)) - end + if (isQuestItem and not invalidQuestItem) or isQuestStarter then + slot:SetBackdropBorderColor(unpack(B.QuestColors.questItem)) slot.ignoreBorderColors = true elseif slot.rarity and slot.rarity > 1 then slot:SetBackdropBorderColor(r, g, b) @@ -1519,7 +1505,7 @@ end function B:CreateSellFrame() B.SellFrame = CreateFrame("Frame", "ElvUIVendorGraysFrame", E.UIParent) - E:Size(B.SellFrame, 200,40) + E:Size(B.SellFrame, 200, 40) E:Point(B.SellFrame, "CENTER", E.UIParent) E:CreateBackdrop(B.SellFrame, "Transparent") B.SellFrame:SetAlpha(E.db.bags.vendorGrays.progressBar and 1 or 0)