From 8b2468453740cca0b0bbf76a523e1715bb2bd069 Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Tue, 23 Dec 2025 22:40:51 +0400 Subject: [PATCH] version: 1.4.0 fixes --- UI/BagFrame.lua | 22 +++++++++++++++++++++- UI/BankFrame.lua | 22 +++++++++++++++++++++- UI/ItemButton.lua | 44 ++++++++++++++++++++++---------------------- 3 files changed, 64 insertions(+), 24 deletions(-) diff --git a/UI/BagFrame.lua b/UI/BagFrame.lua index 1b29895..b06c8fa 100644 --- a/UI/BagFrame.lua +++ b/UI/BagFrame.lua @@ -372,9 +372,21 @@ function BagFrame:GetSectionHeader(index) if not header then header = CreateFrame("Frame", name, getglobal("Guda_BagFrame_ItemContainer")) header:SetHeight(20) + header:EnableMouse(true) local text = header:CreateFontString(nil, "OVERLAY", "GameFontNormal") text:SetPoint("LEFT", header, "LEFT", 0, 0) header.text = text + + header:SetScript("OnEnter", function() + if this.fullName and this.isShortened then + GameTooltip:SetOwner(this, "ANCHOR_TOP") + GameTooltip:SetText(this.fullName) + GameTooltip:Show() + end + end) + header:SetScript("OnLeave", function() + GameTooltip:Hide() + end) end header.inUse = true return header @@ -556,7 +568,15 @@ function BagFrame:DisplayItemsByCategory(bagData, isOtherChar, charName) headerIdx = headerIdx + 1 header:SetPoint("TOPLEFT", itemContainer, "TOPLEFT", startX + currentX, startY - currentY) header:SetWidth(blockWidth) - header.text:SetText(catName) + + local displayName = catName + header.fullName = catName + header.isShortened = false + if string.len(displayName) > 10 and numItems < 2 then + displayName = string.sub(displayName, 1, 7) .. "..." + header.isShortened = true + end + header.text:SetText(displayName) header:Show() local itemY = currentY + 20 diff --git a/UI/BankFrame.lua b/UI/BankFrame.lua index b7e6fd8..2a1d963 100644 --- a/UI/BankFrame.lua +++ b/UI/BankFrame.lua @@ -224,9 +224,21 @@ function BankFrame:GetSectionHeader(index) if not header then header = CreateFrame("Frame", name, getglobal("Guda_BankFrame_ItemContainer")) header:SetHeight(20) + header:EnableMouse(true) local text = header:CreateFontString(nil, "OVERLAY", "GameFontNormal") text:SetPoint("LEFT", header, "LEFT", 0, 0) header.text = text + + header:SetScript("OnEnter", function() + if this.fullName and this.isShortened then + GameTooltip:SetOwner(this, "ANCHOR_TOP") + GameTooltip:SetText(this.fullName) + GameTooltip:Show() + end + end) + header:SetScript("OnLeave", function() + GameTooltip:Hide() + end) end header.inUse = true return header @@ -408,7 +420,15 @@ function BankFrame:DisplayItemsByCategory(bankData, isOtherChar, charName) headerIdx = headerIdx + 1 header:SetPoint("TOPLEFT", itemContainer, "TOPLEFT", startX + currentX, startY - currentY) header:SetWidth(blockWidth) - header.text:SetText(catName) + + local displayName = catName + header.fullName = catName + header.isShortened = false + if string.len(displayName) > 10 and numItems < 2 then + displayName = string.sub(displayName, 1, 7) .. "..." + header.isShortened = true + end + header.text:SetText(displayName) header:Show() local itemY = currentY + 20 diff --git a/UI/ItemButton.lua b/UI/ItemButton.lua index fcbd304..dd659c8 100644 --- a/UI/ItemButton.lua +++ b/UI/ItemButton.lua @@ -957,28 +957,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)