fix: usable weapons were marked as QuestItem
This commit is contained in:
@@ -212,6 +212,21 @@ function Utils:IsQuestItemTooltip(bagID, slotID)
|
|||||||
string.find(tl, "starts a quest") or
|
string.find(tl, "starts a quest") or
|
||||||
string.find(tl, "quest item") or
|
string.find(tl, "quest item") or
|
||||||
string.find(tl, "manual") then
|
string.find(tl, "manual") then
|
||||||
|
|
||||||
|
-- Double check category to avoid misidentifying equipment with "Use:"
|
||||||
|
local link = GetContainerItemLink(bagID, slotID)
|
||||||
|
if link and self.ExtractItemID and self.GetItemInfoSafe then
|
||||||
|
local itemID = self:ExtractItemID(link)
|
||||||
|
if itemID then
|
||||||
|
local _, _, _, _, itemCategory, itemType = self:GetItemInfoSafe(itemID)
|
||||||
|
-- If it's Weapon or Armor, and NOT categorized as Quest, then it's not a Quest Item
|
||||||
|
if (itemCategory == "Weapon" or itemCategory == "Armor" or itemType == "Weapon" or itemType == "Armor") and
|
||||||
|
(itemCategory ~= "Quest" and itemType ~= "Quest") then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## Title: Guda
|
## Title: Guda
|
||||||
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
## Notes: All-in-one bag and bank addon for World of Warcraft 1.12.1 (Turtle WoW)
|
||||||
## Author: Vati
|
## Author: Vati
|
||||||
## Version: 1.6.0
|
## Version: 1.6.1
|
||||||
## SavedVariables: Guda_DB
|
## SavedVariables: Guda_DB
|
||||||
## SavedVariablesPerCharacter: Guda_CharDB
|
## SavedVariablesPerCharacter: Guda_CharDB
|
||||||
|
|
||||||
|
|||||||
+12
-1
@@ -56,10 +56,21 @@ function Guda_CategorizeItem(itemData, bagID, slotID, categories, specialItems,
|
|||||||
-- Priority 3: Quest Items
|
-- Priority 3: Quest Items
|
||||||
-- Check multiple sources: tooltip scan, itemClass, itemType, and QuestItemsDB
|
-- Check multiple sources: tooltip scan, itemClass, itemType, and QuestItemsDB
|
||||||
local isQuestItem = false
|
local isQuestItem = false
|
||||||
if itemData.class == "Quest" or itemData.type == "Quest" then
|
local itemCategory = itemData.class or itemData.category or ""
|
||||||
|
local itemType = itemData.type or ""
|
||||||
|
|
||||||
|
-- If it's a Weapon or Armor, it shouldn't be a QuestItem unless it's specifically categorized as Quest
|
||||||
|
local isEquipment = (itemCategory == "Weapon" or itemCategory == "Armor" or itemType == "Weapon" or itemType == "Armor")
|
||||||
|
local isQuestCategory = (itemCategory == "Quest" or itemType == "Quest")
|
||||||
|
|
||||||
|
if isQuestCategory then
|
||||||
isQuestItem = true
|
isQuestItem = true
|
||||||
elseif not isOtherChar then
|
elseif not isOtherChar then
|
||||||
isQuestItem = addon.Modules.Utils:IsQuestItemTooltip(bagID, slotID)
|
isQuestItem = addon.Modules.Utils:IsQuestItemTooltip(bagID, slotID)
|
||||||
|
-- If tooltip said it is quest, but it is equipment and not quest category, reject it
|
||||||
|
if isQuestItem and isEquipment and not isQuestCategory then
|
||||||
|
isQuestItem = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Also check the QuestItemsDB for known faction-specific quest items
|
-- Also check the QuestItemsDB for known faction-specific quest items
|
||||||
if not isQuestItem and itemData.link then
|
if not isQuestItem and itemData.link then
|
||||||
|
|||||||
+37
-28
@@ -52,35 +52,44 @@ local function IsQuestItem(bagID, slotID, isBank)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Also check item category/type via GetItemInfo for "Quest"
|
-- Also check item category/type via GetItemInfo for "Quest"
|
||||||
-- Turtle WoW GetItemInfo returns: name, link, rarity, level, itemCategory, itemType, stack, subType, texture, equipLoc, sellPrice
|
-- Turtle WoW GetItemInfo returns: name, link, rarity, level, itemCategory, itemType, stack, subType, texture, equipLoc, sellPrice
|
||||||
if not isQuestItem then
|
local link = GetContainerItemLink(bagID, slotID)
|
||||||
local link = GetContainerItemLink(bagID, slotID)
|
local itemID
|
||||||
if link and addon and addon.Modules and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID and addon.Modules.Utils.GetItemInfoSafe then
|
local itemCategory, itemType
|
||||||
local itemID = addon.Modules.Utils:ExtractItemID(link)
|
|
||||||
if itemID then
|
if link and addon and addon.Modules and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID and addon.Modules.Utils.GetItemInfoSafe then
|
||||||
local itemName, _, _, _, itemCategory, itemType = addon.Modules.Utils:GetItemInfoSafe(itemID)
|
itemID = addon.Modules.Utils:ExtractItemID(link)
|
||||||
if itemCategory == "Quest" or itemType == "Quest" then
|
if itemID then
|
||||||
isQuestItem = true
|
_, _, _, _, itemCategory, itemType = addon.Modules.Utils:GetItemInfoSafe(itemID)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Check the QuestItemsDB for known faction-specific quest items
|
-- If it's a Weapon or Armor, it shouldn't be a QuestItem unless it's specifically categorized as Quest
|
||||||
if not isQuestItem then
|
-- This avoids "Use:" equipment showing up in the quest bar
|
||||||
local link = GetContainerItemLink(bagID, slotID)
|
if itemCategory == "Weapon" or itemCategory == "Armor" or itemType == "Weapon" or itemType == "Armor" then
|
||||||
if link and addon and addon.Modules and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID then
|
if itemCategory ~= "Quest" and itemType ~= "Quest" then
|
||||||
local itemID = addon.Modules.Utils:ExtractItemID(link)
|
isQuestItem = false
|
||||||
if itemID and addon.IsQuestItemByID then
|
isQuestStarter = false
|
||||||
local playerFaction = UnitFactionGroup("player")
|
end
|
||||||
local isDBQuestItem = addon:IsQuestItemByID(itemID, playerFaction)
|
end
|
||||||
if isDBQuestItem then
|
|
||||||
isQuestItem = true
|
if not isQuestItem then
|
||||||
end
|
if itemCategory == "Quest" or itemType == "Quest" then
|
||||||
end
|
isQuestItem = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Check the QuestItemsDB for known faction-specific quest items
|
||||||
|
if not isQuestItem then
|
||||||
|
if itemID and addon.IsQuestItemByID then
|
||||||
|
local playerFaction = UnitFactionGroup("player")
|
||||||
|
local isDBQuestItem = addon:IsQuestItemByID(itemID, playerFaction)
|
||||||
|
if isDBQuestItem then
|
||||||
|
isQuestItem = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return isQuestItem, isQuestStarter
|
return isQuestItem, isQuestStarter
|
||||||
end
|
end
|
||||||
|
|||||||
+27
-18
@@ -62,30 +62,39 @@ function QuestItemBar:CheckQuestItemUsable(bagID, slotID)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Fallback check for quest category if not detected from tooltip
|
-- Fallback check for quest category if not detected from tooltip
|
||||||
|
local link = GetContainerItemLink(bagID, slotID)
|
||||||
|
local itemID
|
||||||
|
local itemCategory, itemType
|
||||||
|
|
||||||
|
if link and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID and addon.Modules.Utils.GetItemInfoSafe then
|
||||||
|
itemID = addon.Modules.Utils:ExtractItemID(link)
|
||||||
|
if itemID then
|
||||||
|
_, _, _, _, itemCategory, itemType = addon.Modules.Utils:GetItemInfoSafe(itemID)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- If it's a Weapon or Armor, it shouldn't be a QuestItem unless it's specifically categorized as Quest
|
||||||
|
-- This avoids "Use:" equipment showing up in the quest bar
|
||||||
|
if itemCategory == "Weapon" or itemCategory == "Armor" or itemType == "Weapon" or itemType == "Armor" then
|
||||||
|
if itemCategory ~= "Quest" and itemType ~= "Quest" then
|
||||||
|
isQuestItem = false
|
||||||
|
isQuestStarter = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not isQuestItem then
|
if not isQuestItem then
|
||||||
local link = GetContainerItemLink(bagID, slotID)
|
if itemCategory == "Quest" or itemType == "Quest" then
|
||||||
if link and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID and addon.Modules.Utils.GetItemInfoSafe then
|
isQuestItem = true
|
||||||
local itemID = addon.Modules.Utils:ExtractItemID(link)
|
|
||||||
if itemID then
|
|
||||||
local _, _, _, _, itemCategory, itemType = addon.Modules.Utils:GetItemInfoSafe(itemID)
|
|
||||||
if itemCategory == "Quest" or itemType == "Quest" then
|
|
||||||
isQuestItem = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check the QuestItemsDB for known faction-specific quest items
|
-- Check the QuestItemsDB for known faction-specific quest items
|
||||||
if not isQuestItem then
|
if not isQuestItem then
|
||||||
local link = GetContainerItemLink(bagID, slotID)
|
if itemID and addon.IsQuestItemByID then
|
||||||
if link and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID then
|
local playerFaction = UnitFactionGroup("player")
|
||||||
local itemID = addon.Modules.Utils:ExtractItemID(link)
|
local isDBQuestItem = addon:IsQuestItemByID(itemID, playerFaction)
|
||||||
if itemID and addon.IsQuestItemByID then
|
if isDBQuestItem then
|
||||||
local playerFaction = UnitFactionGroup("player")
|
isQuestItem = true
|
||||||
local isDBQuestItem = addon:IsQuestItemByID(itemID, playerFaction)
|
|
||||||
if isDBQuestItem then
|
|
||||||
isQuestItem = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user