fix: quest item bar
This commit is contained in:
+27
-1
@@ -291,7 +291,12 @@ local function DetectQuestUsable(lines)
|
||||
-- Check for yellow "Use:" text
|
||||
if line.r and line.g and line.b then
|
||||
local isYellow = (line.r > 0.9 and line.g > 0.75 and line.b < 0.2)
|
||||
if isYellow and string.find(line.leftLower, "use:") then
|
||||
if isYellow and line.leftLower and string.find(line.leftLower, "use:") then
|
||||
return true
|
||||
end
|
||||
-- Also check for green "Use:" text (some quest items have green use text)
|
||||
local isGreen = (line.r < 0.3 and line.g > 0.9 and line.b < 0.3)
|
||||
if isGreen and line.leftLower and string.find(line.leftLower, "use:") then
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -299,6 +304,27 @@ local function DetectQuestUsable(lines)
|
||||
return false
|
||||
end
|
||||
|
||||
-- Debug function to dump tooltip lines for an item
|
||||
-- Usage: /script Guda.Modules.ItemDetection:DebugTooltip(bagID, slotID)
|
||||
function ItemDetection:DebugTooltip(bagID, slotID)
|
||||
local itemLink = GetContainerItemLink(bagID, slotID)
|
||||
if not itemLink then
|
||||
addon:Print("No item at " .. bagID .. ":" .. slotID)
|
||||
return
|
||||
end
|
||||
|
||||
addon:Print("=== Tooltip Debug for " .. bagID .. ":" .. slotID .. " ===")
|
||||
local lines = ScanTooltipLines(bagID, slotID, itemLink)
|
||||
addon:Print("Total lines: " .. table.getn(lines))
|
||||
|
||||
for i, line in ipairs(lines) do
|
||||
local text = line.left or "(no text)"
|
||||
local r, g, b = line.r or 0, line.g or 0, line.b or 0
|
||||
addon:Print(string.format("[%d] r=%.2f g=%.2f b=%.2f: %s", i, r, g, b, text))
|
||||
end
|
||||
addon:Print("=== End Tooltip Debug ===")
|
||||
end
|
||||
|
||||
-- Durability pattern for filtering out broken item red text
|
||||
local durabilityPattern = DURABILITY_TEMPLATE and string.gsub(DURABILITY_TEMPLATE, "%%d", "%%d+") or nil
|
||||
|
||||
|
||||
@@ -668,4 +668,60 @@ function QuestItemBar:Initialize()
|
||||
addon:Debug("QuestItemBar initialized")
|
||||
end
|
||||
|
||||
-- Debug function to diagnose QuestItemBar issues
|
||||
-- Usage: /script Guda.Modules.QuestItemBar:Debug()
|
||||
function QuestItemBar:Debug()
|
||||
addon:Print("=== QuestItemBar Debug ===")
|
||||
|
||||
-- Check setting
|
||||
local showQuestBar = addon.Modules.DB:GetSetting("showQuestBar")
|
||||
addon:Print("showQuestBar setting: " .. tostring(showQuestBar))
|
||||
|
||||
-- Check frame
|
||||
local frame = Guda_QuestItemBar
|
||||
addon:Print("Frame exists: " .. tostring(frame ~= nil))
|
||||
if frame then
|
||||
addon:Print("Frame shown: " .. tostring(frame:IsShown()))
|
||||
end
|
||||
|
||||
-- Scan all bags for potential quest items
|
||||
addon:Print("--- Scanning bags ---")
|
||||
local foundCount = 0
|
||||
for bagID = 0, 4 do
|
||||
local numSlots = GetContainerNumSlots(bagID)
|
||||
for slotID = 1, numSlots do
|
||||
local texture, count = GetContainerItemInfo(bagID, slotID)
|
||||
if texture then
|
||||
local itemLink = GetContainerItemLink(bagID, slotID)
|
||||
local itemData = addon.Modules.BagScanner:ScanSlot(bagID, slotID)
|
||||
|
||||
if itemData then
|
||||
local props = addon.Modules.ItemDetection:GetItemProperties(itemData, bagID, slotID)
|
||||
|
||||
-- Show items that are quest-related OR have Quest class
|
||||
if props.isQuestItem or props.isQuestUsable or (itemData.class and itemData.class == "Quest") then
|
||||
foundCount = foundCount + 1
|
||||
addon:Print(string.format("[%d:%d] %s", bagID, slotID, itemData.name or "Unknown"))
|
||||
addon:Print(string.format(" class=%s, isQuest=%s, isUsable=%s, isStarter=%s",
|
||||
tostring(itemData.class),
|
||||
tostring(props.isQuestItem),
|
||||
tostring(props.isQuestUsable),
|
||||
tostring(props.isQuestStarter)))
|
||||
|
||||
-- Check if it would show in bar
|
||||
local wouldShow = props.isQuestItem and props.isQuestUsable and not props.isQuestStarter
|
||||
addon:Print(" Would show in bar: " .. tostring(wouldShow))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if foundCount == 0 then
|
||||
addon:Print("No quest-related items found in bags")
|
||||
end
|
||||
|
||||
addon:Print("=== End Debug ===")
|
||||
end
|
||||
|
||||
QuestItemBar.isLoaded = true
|
||||
|
||||
Reference in New Issue
Block a user