diff --git a/Core/Utils.lua b/Core/Utils.lua index ca78ade..b1efb8c 100644 --- a/Core/Utils.lua +++ b/Core/Utils.lua @@ -173,20 +173,18 @@ function Utils:IsQuestItemTooltip(bagID, slotID) tooltip:ClearLines() tooltip:SetBagItem(bagID, slotID) - -- Check all tooltip lines for quest-related text + -- Check tooltip lines for explicit quest-related phrases (case-insensitive) for i = 1, tooltip:NumLines() do local line = getglobal("GudaBagScanTooltipTextLeft" .. i) if line then local text = line:GetText() if text then - -- Check for quest starter patterns - if string.find(text, "Quest Starter") or - string.find(text, "This Item Begins a Quest") or - string.find(text, "Use: Starts a Quest") then - return true - -- Check for regular quest item patterns - elseif string.find(text, "Quest Item") or - string.find(text, "Manual") then + local tl = string.lower(text) + -- Only match explicit quest markers to avoid misclassifying consumables/recipes + if string.find(tl, "quest starter") or + string.find(tl, "this item begins a quest") or + string.find(tl, "starts a quest") or + string.find(tl, "quest item") then return true end end diff --git a/UI/ItemButton.lua b/UI/ItemButton.lua index 1be41d8..fdcce7c 100644 --- a/UI/ItemButton.lua +++ b/UI/ItemButton.lua @@ -963,28 +963,28 @@ function Guda_ItemButton_OnEnter(self) -- Debug: print hovered item's texture path to chat -- Uses GetItemInfo on the hovered item's ID - --if self.hasItem then - -- local link = nil - -- if self.itemData and self.itemData.link then - -- link = self.itemData.link - -- else - -- -- Fallback to live bag query - -- link = GetContainerItemLink(self.bagID, self.slotID) - -- end - -- if link and addon and addon.Modules and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID then - -- local itemID = addon.Modules.Utils:ExtractItemID(link) - -- if itemID and addon.Modules.Utils.GetItemInfoSafe then - -- local name, itemLink, itemRarity, itemLevel, itemCategory, itemType, itemStackCount, - -- itemSubType, itemTexture, itemEquipLoc, itemSellPrice = addon.Modules.Utils:GetItemInfoSafe(itemID) - -- if addon and addon.Print then - -- addon:Print("itemTexture: %s", tostring(itemTexture)) - -- addon:Print("itemCategory: %s", tostring(itemCategory)) - -- addon:Print("itemType: %s", tostring(itemType)) - -- addon:Print("itemType: %s", tostring(itemType)) - -- end - -- end - -- end - --end + if self.hasItem then + local link = nil + if self.itemData and self.itemData.link then + link = self.itemData.link + else + -- Fallback to live bag query + link = GetContainerItemLink(self.bagID, self.slotID) + end + if link and addon and addon.Modules and addon.Modules.Utils and addon.Modules.Utils.ExtractItemID then + local itemID = addon.Modules.Utils:ExtractItemID(link) + if itemID and addon.Modules.Utils.GetItemInfoSafe then + local name, itemLink, itemRarity, itemLevel, itemCategory, itemType, itemStackCount, + itemSubType, itemTexture, itemEquipLoc, itemSellPrice = addon.Modules.Utils:GetItemInfoSafe(itemID) + if addon and addon.Print then + addon:Print("itemTexture: %s", tostring(itemTexture)) + addon:Print("itemCategory: %s", tostring(itemCategory)) + addon:Print("itemType: %s", tostring(itemType)) + addon:Print("itemType: %s", tostring(itemType)) + end + end + end + end -- Handle merchant sell cursor (same approach as BagShui) if MerchantFrame:IsShown() and not self.isBank and not self.otherChar and self.hasItem then ShowContainerSellCursor(self.bagID, self.slotID) diff --git a/UI/QuestItemBar.lua b/UI/QuestItemBar.lua index 2e00014..5bd7824 100644 --- a/UI/QuestItemBar.lua +++ b/UI/QuestItemBar.lua @@ -36,8 +36,12 @@ local function IsItemUsable(bagID, slotID) local line = getglobal("Guda_QuestBarScanTooltipTextLeft" .. i) if line then local text = line:GetText() - if text and (string.find(text, "Use:") or string.find(text, "Starts a Quest")) then - return true + if text then + local tl = string.lower(text) + -- Match explicit usability phrases (case-insensitive). Avoid generic 'quest item' matches. + if string.find(tl, "use:") or string.find(tl, "right%-click") or string.find(tl, "right click") or string.find(tl, "click to") or string.find(tl, "starts a quest") then + return true + end end end end