From 9305b46a85b871268d2b52b853a121a206ffe60b Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Fri, 23 Jan 2026 23:41:28 +0400 Subject: [PATCH] remove debugs --- Core/Utils.lua | 18 ++---------------- Sorting/SortEngine.lua | 31 ------------------------------- UI/ItemButton.lua | 22 ---------------------- 3 files changed, 2 insertions(+), 69 deletions(-) diff --git a/Core/Utils.lua b/Core/Utils.lua index 4ac7f59..0fc3b52 100644 --- a/Core/Utils.lua +++ b/Core/Utils.lua @@ -735,28 +735,20 @@ end -- Check if item has "Permanently..." text (enchanting scrolls/vellums) -- These should NOT be considered quest items even if they have Quest category local function IsPermanentEnchantItem(tooltip, tooltipName) - if not tooltip then - addon:Debug("IsPermanentEnchantItem: tooltip is nil") - return false - end + if not tooltip then return false end local numLines = tooltip:NumLines() or 0 - addon:Debug("IsPermanentEnchantItem: scanning %d lines", numLines) for i = 1, numLines do local line = getglobal(tooltipName .. "TextLeft" .. i) if line then local text = line:GetText() if text then local tl = string.lower(text) - addon:Debug("IsPermanentEnchantItem line %d: %s", i, tl) - -- Just check for "permanently" anywhere (green text doesn't have "Use:" prefix) if string.find(tl, "permanently") then - addon:Debug("IsPermanentEnchantItem: FOUND permanently!") return true end end end end - addon:Debug("IsPermanentEnchantItem: NOT found") return false end @@ -802,23 +794,17 @@ function Utils:IsQuestItem(bagID, slotID, itemData, isOtherChar, isBank) -- Priority 1: If explicitly categorized as Quest, check if it's actually an enchant item first if isQuestCategory then - addon:Debug("IsQuestItem: Quest category detected, checking for permanent enchant...") -- Check tooltip for "Permanently" (enchanting scrolls should not be quest items) if not isOtherChar and bagID and slotID then local tooltip = GetScanTooltip() tooltip:ClearLines() tooltip:SetBagItem(bagID, slotID) - local isPermanent = IsPermanentEnchantItem(tooltip, "GudaBagScanTooltip") - addon:Debug("IsQuestItem: IsPermanentEnchantItem returned %s", tostring(isPermanent)) - if isPermanent then + if IsPermanentEnchantItem(tooltip, "GudaBagScanTooltip") then return false, false -- Not a quest item, it's an enchant scroll end -- Also scan for quest starter text local _, starterDetected = ScanTooltipForQuest(tooltip, "GudaBagScanTooltip") return true, starterDetected - else - addon:Debug("IsQuestItem: Skipping permanent enchant check (otherChar=%s, bagID=%s, slotID=%s)", - tostring(isOtherChar), tostring(bagID), tostring(slotID)) end return true, false end diff --git a/Sorting/SortEngine.lua b/Sorting/SortEngine.lua index c662bd0..c93325a 100644 --- a/Sorting/SortEngine.lua +++ b/Sorting/SortEngine.lua @@ -136,16 +136,9 @@ local function GetItemProperties(bagID, slotID, itemLink) local cacheKey = baseLink or itemLink if propertyCache[cacheKey] then - if addon.DEBUG then - addon:Print("GetItemProperties CACHE HIT for %s", cacheKey or "unknown") - end return propertyCache[cacheKey] end - if addon.DEBUG then - addon:Print("GetItemProperties CACHE MISS - scanning bagID=%s slotID=%s", tostring(bagID), tostring(slotID)) - end - local props = { isQuest = false, isQuestStarter = false, @@ -201,9 +194,6 @@ local function GetItemProperties(bagID, slotID, itemLink) -- Check for "permanently" anywhere in the line (green text doesn't have "Use:" prefix) if string.find(tl, "permanently") then props.isPermanentEnchant = true - if addon.DEBUG then - addon:Print("Detected permanent enchant: %s", tl) - end end -- Restore tag check (higher priority tags override lower ones) @@ -229,10 +219,6 @@ local function GetItemProperties(bagID, slotID, itemLink) end end - if addon.DEBUG and props.isPermanentEnchant then - addon:Print("GetItemProperties RETURNING isPermanentEnchant=true for %s", cacheKey or "unknown") - end - propertyCache[cacheKey] = props return props end @@ -696,21 +682,10 @@ local function AddSortKeys(items) local itemProps = GetItemProperties(item.bagID, item.slot, item.data.link) local isPermanentEnchant = itemProps and itemProps.isPermanentEnchant or false - -- Debug: trace isPermanentEnchant value - if addon.DEBUG and (itemCategory == "Quest" or itemType == "Quest") then - addon:Print("GetItemProperties for %s: props=%s, isPermanentEnchant=%s", - item.itemName or "unknown", - itemProps and "exists" or "NIL", - itemProps and tostring(itemProps.isPermanentEnchant) or "N/A") - end - -- Permanent enchant items always sort BEFORE quest items (category 6) -- regardless of their itemCategory or itemType if isPermanentEnchant then item.sortedClass = 6 -- Same as Tools, comes before Quest (7) - if addon.DEBUG then - addon:Print("PERMANENT ENCHANT: %s -> sortedClass=6", item.itemName or "unknown") - end -- Heuristic: Detect items that should be in the Quest category (priority 7) -- but aren't categorized as such by the game (e.g. some "Manual" items) elseif item.sortedClass ~= (CATEGORY_ORDER["Quest"] or 7) then @@ -728,12 +703,6 @@ local function AddSortKeys(items) end end item.equipSlotOrder = 999 - - -- Debug: Show final sortedClass for quest-related items - if addon.DEBUG and (itemCategory == "Quest" or itemType == "Quest" or isPermanentEnchant) then - addon:Print("SORT CLASS: %s -> sortedClass=%d, isPermanentEnchant=%s", - item.itemName or "unknown", item.sortedClass, tostring(isPermanentEnchant)) - end end -- Subclass ordering diff --git a/UI/ItemButton.lua b/UI/ItemButton.lua index 899c5ad..e149176 100644 --- a/UI/ItemButton.lua +++ b/UI/ItemButton.lua @@ -1337,28 +1337,6 @@ function Guda_ItemButton_OnEnter(self) GameTooltip:Show() - -- Debug: Print item info including equipSlot when debug mode is enabled - if addon.DEBUG and self.hasItem and self.bagID and self.slotID then - local link = GetContainerItemLink(self.bagID, self.slotID) - if link then - local itemID = addon.Modules.Utils:ExtractItemID(link) - if itemID then - local name, _, itemQuality, iLevel, itemCategory, itemType, itemStackCount, itemSubType, itemTexture, itemEquipLoc, itemSellPrice = GetItemInfo(itemID) - addon:Print("=== Item Debug Info ===") - addon:Print("name: %s", tostring(name)) - addon:Print("itemQuality: %s", tostring(itemQuality)) - addon:Print("iLevel: %s", tostring(iLevel)) - addon:Print("itemCategory: %s", tostring(itemCategory)) - addon:Print("itemType: %s", tostring(itemType)) - addon:Print("itemStackCount: %s", tostring(itemStackCount)) - addon:Print("itemSubType: %s", tostring(itemSubType)) - addon:Print("itemTexture: %s", tostring(itemTexture)) - addon:Print("itemEquipLoc: %s", tostring(itemEquipLoc)) - addon:Print("itemSellPrice: %s", tostring(itemSellPrice)) - 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)