From 46e6c7be3e5f049dda0aba55e61c7a3b1515f209 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 09:22:02 +0200 Subject: [PATCH 01/20] Fixed identation to be tabs and be proper. --- SellValue.lua | 361 +++++++++++++++++++++++++------------------------- 1 file changed, 181 insertions(+), 180 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index 22dabb9..0dda632 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -5,12 +5,12 @@ local function hooksecurefunc(arg1, arg2, arg3) arg1, arg2, arg3 = _G, arg1, arg2 end local orig = arg1[arg2] - arg1[arg2] = function(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20) - local x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20 = orig(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20) - - arg3(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20) - - return x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20 + arg1[arg2] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + local x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20 = orig(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + + arg3(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + + return x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20 end end @@ -22,216 +22,217 @@ function SellValue_OnLoad() this:RegisterEvent("MERCHANT_SHOW"); SellValue_Saved_OnTooltipAddMoney = SellValue_Tooltip:GetScript("OnTooltipAddMoney"); - + SellValue_Tooltip:SetScript("OnTooltipAddMoney", SellValue_OnTooltipAddMoney); -- Hook bag tooltip - hooksecurefunc (GameTooltip, "SetBagItem", - function(tip, bag, slot) - if SellValues and not MerchantFrame:IsVisible() then - local _, stackCount = GetContainerItemInfo(bag, slot); - local itemID = SellValue_GetItemID(bag, slot); - - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price - end - end + hooksecurefunc(GameTooltip, "SetBagItem", function(tip, bag, slot) + if SellValues and not MerchantFrame:IsVisible() then + local _, stackCount = GetContainerItemInfo(bag, slot); + local itemID = SellValue_GetItemID(bag, slot); + + local price = SellValues[itemID]; + + if price then + if price == 0 then + GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + else + SetTooltipMoney(GameTooltip, price * stackCount); + + end -- if price > 0 + + -- Adjust width and height to account for new lines + GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); + if GameTooltip:GetWidth() < 120 then + GameTooltip:SetWidth(120); + end + end -- if price + end + end ); - - + + -- Hook bank tooltip - hooksecurefunc (GameTooltip, "SetInventoryItem", - function(tip, unit, slot) - if SellValues and not MerchantFrame:IsVisible() and slot > 19 then - local stackCount = GetInventoryItemCount(unit, slot); - local itemID = SellValue_GetItemID(-1, slot); - - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price - end - end + hooksecurefunc(GameTooltip, "SetInventoryItem", function(tip, unit, slot) + if SellValues and not MerchantFrame:IsVisible() and slot > 19 then + local stackCount = GetInventoryItemCount(unit, slot); + local itemID = SellValue_GetItemID(-1, slot); + + local price = SellValues[itemID]; + + if price then + if price == 0 then + GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + else + SetTooltipMoney(GameTooltip, price * stackCount); + + end -- if price > 0 + + -- Adjust width and height to account for new lines + GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); + if GameTooltip:GetWidth() < 120 then + GameTooltip:SetWidth(120); + end + end -- if price + end + end ); - + -- Hook quest reward tooltip - hooksecurefunc (GameTooltip, "SetQuestItem", - function(tip, qtype, slot) - if SellValues and (qtype == "reward" or qtype == "choice") then - local link = GetQuestItemLink(qtype, slot); - local _,_,stackCount = GetQuestItemInfo(qtype, slot); - local itemID = SellValue_IDFromLink(link); - - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price - end - end + hooksecurefunc(GameTooltip, "SetQuestItem", function(tip, qtype, slot) + if SellValues and (qtype == "reward" or qtype == "choice") then + local link = GetQuestItemLink(qtype, slot); + local _, _, stackCount = GetQuestItemInfo(qtype, slot); + local itemID = SellValue_IDFromLink(link); + + local price = SellValues[itemID]; + + if price then + if price == 0 then + GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + else + SetTooltipMoney(GameTooltip, price * stackCount); + + end -- if price > 0 + + -- Adjust width and height to account for new lines + GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); + if GameTooltip:GetWidth() < 120 then + GameTooltip:SetWidth(120); + end + end -- if price + end + end ); - + -- Hook questlog reward tooltip - hooksecurefunc (GameTooltip, "SetQuestLogItem", - function(tip, qtype, slot) - if SellValues then - - local stackCount = nil; - - if qtype == "reward" then - _,_,stackCount = GetQuestLogRewardInfo(slot); - elseif qtype == "choice" then - _,_,stackCount = GetQuestLogChoiceInfo(slot); - else - return - end - - local link = GetQuestLogItemLink(qtype, slot); - local itemID = SellValue_IDFromLink(link); - - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price - end - end + hooksecurefunc(GameTooltip, "SetQuestLogItem", function(tip, qtype, slot) + if SellValues then + + local stackCount = nil; + + if qtype == "reward" then + _, _, stackCount = GetQuestLogRewardInfo(slot); + elseif qtype == "choice" then + _, _, stackCount = GetQuestLogChoiceInfo(slot); + else + return + end + + local link = GetQuestLogItemLink(qtype, slot); + local itemID = SellValue_IDFromLink(link); + + local price = SellValues[itemID]; + + if price then + if price == 0 then + GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + else + SetTooltipMoney(GameTooltip, price * stackCount); + + end -- if price > 0 + + -- Adjust width and height to account for new lines + GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); + if GameTooltip:GetWidth() < 120 then + GameTooltip:SetWidth(120); + end + end -- if price + end + end ); end - function SellValue_OnEvent() - if event == "MERCHANT_SHOW" then - return SellValue_MerchantScan(this); - end + if event == "MERCHANT_SHOW" then + return SellValue_MerchantScan(this); + end end SellValue_Saved_GameTooltip_OnEvent = GameTooltip_OnEvent; -GameTooltip_OnEvent = function () - if event ~= "CLEAR_TOOLTIP" then - return SellValue_Saved_GameTooltip_OnEvent(); - end +GameTooltip_OnEvent = function() + if event ~= "CLEAR_TOOLTIP" then + return SellValue_Saved_GameTooltip_OnEvent(); + end end function SellValue_OnTooltipAddMoney () - -- call the original function first - SellValue_Saved_OnTooltipAddMoney(); + -- call the original function first + SellValue_Saved_OnTooltipAddMoney(); - -- The money in repair mode is the cost to repair, not sell - if InRepairMode() then return; end; + -- The money in repair mode is the cost to repair, not sell + if InRepairMode() then + return ; + end ; - SellValue_LastItemMoney = arg1; + SellValue_LastItemMoney = arg1; end function SellValue_SaveFor(bag, slot, name, money) - if not (bag and slot and name and money) then return; end; - - local _, stackCount = GetContainerItemInfo(bag, slot); - if stackCount and stackCount > 0 then - local costOfOne = money / stackCount; - - if not SellValues then SellValues = {}; end - - SellValues[name] = costOfOne; - end + if not (bag and slot and name and money) then + return ; + end ; + + local _, stackCount = GetContainerItemInfo(bag, slot); + if stackCount and stackCount > 0 then + local costOfOne = money / stackCount; + + if not SellValues then + SellValues = {}; + end + + SellValues[name] = costOfOne; + end end function SellValue_MerchantScan(frame) - for bag=0,NUM_BAG_FRAMES do - for slot=1,GetContainerNumSlots(bag) do - - local itemName = SellValue_GetItemID(bag, slot); - if itemName ~= "" then - SellValue_LastItemMoney = 0; - SellValue_Tooltip:SetBagItem(bag, slot); - SellValue_SaveFor(bag, slot, itemName, SellValue_LastItemMoney); - end -- if item name - end -- for slot - end -- for bag - + for bag = 0, NUM_BAG_FRAMES do + for slot = 1, GetContainerNumSlots(bag) do + + local itemName = SellValue_GetItemID(bag, slot); + if itemName ~= "" then + SellValue_LastItemMoney = 0; + SellValue_Tooltip:SetBagItem(bag, slot); + SellValue_SaveFor(bag, slot, itemName, SellValue_LastItemMoney); + end -- if item name + end -- for slot + end -- for bag + end function SellValue_OnHide() - -- ClearMoney() expects this to point to the tooltip itself, and this here - -- points to us, a child of the tip - this = this:GetParent(); - return GameTooltip_ClearMoney(); + -- ClearMoney() expects this to point to the tooltip itself, and this here + -- points to us, a child of the tip + this = this:GetParent(); + return GameTooltip_ClearMoney(); end function SellValue_GetItemID(bag, slot) - local linktext = nil; - - if (bag == -1) then - linktext = GetInventoryItemLink("player", slot); - else - linktext = GetContainerItemLink(bag, slot); - end - - if linktext then - return SellValue_IDFromLink(linktext); - else - return ""; - end + local linktext = nil; + + if (bag == -1) then + linktext = GetInventoryItemLink("player", slot); + else + linktext = GetContainerItemLink(bag, slot); + end + + if linktext then + return SellValue_IDFromLink(linktext); + else + return ""; + end end function SellValue_IDFromLink(itemlink) - if itemlink then - local foundlink,_,name = string.find(itemlink, "(item:%d+)"); - if foundlink then - return name; - else - return itemlink; - end - end - return; + if itemlink then + local foundlink, _, name = string.find(itemlink, "(item:%d+)"); + if foundlink then + return name; + else + return itemlink; + end + end + return ; end From 039c84fd59ae56a64433116341076e0fd18c472b Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 09:25:21 +0200 Subject: [PATCH 02/20] Generalized the setting of money --- SellValue.lua | 87 ++++++++++++++------------------------------------- 1 file changed, 23 insertions(+), 64 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index 0dda632..85f6184 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -14,6 +14,25 @@ local function hooksecurefunc(arg1, arg2, arg3) end end +function SellValue_SetTooltip(itemID, stackCount) + local price = SellValues[itemID]; + + if price then + if price == 0 then + GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + else + SetTooltipMoney(GameTooltip, price * stackCount); + + end -- if price > 0 + + -- Adjust width and height to account for new lines + GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); + if GameTooltip:GetWidth() < 120 then + GameTooltip:SetWidth(120); + end + end -- if price +end + function SellValue_OnLoad() -- Get initial prices from database @@ -31,22 +50,7 @@ function SellValue_OnLoad() local _, stackCount = GetContainerItemInfo(bag, slot); local itemID = SellValue_GetItemID(bag, slot); - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price + SellValue_SetTooltip(itemID, stackCount); end end ); @@ -58,22 +62,7 @@ function SellValue_OnLoad() local stackCount = GetInventoryItemCount(unit, slot); local itemID = SellValue_GetItemID(-1, slot); - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price + SellValue_SetTooltip(itemID, stackCount); end end ); @@ -85,22 +74,7 @@ function SellValue_OnLoad() local _, _, stackCount = GetQuestItemInfo(qtype, slot); local itemID = SellValue_IDFromLink(link); - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price + SellValue_SetTooltip(itemID, stackCount) end end ); @@ -122,22 +96,7 @@ function SellValue_OnLoad() local link = GetQuestLogItemLink(qtype, slot); local itemID = SellValue_IDFromLink(link); - local price = SellValues[itemID]; - - if price then - if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); - else - SetTooltipMoney(GameTooltip, price * stackCount); - - end -- if price > 0 - - -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); - end - end -- if price + SellValue_SetTooltip(itemID, stackCount); end end ); From 96e0bc5ae1559b4fa5074471e0fa80db6bbe5ff6 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 09:27:17 +0200 Subject: [PATCH 03/20] Added sell value for loot window --- SellValue.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SellValue.lua b/SellValue.lua index 85f6184..ee924ec 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -44,6 +44,20 @@ function SellValue_OnLoad() SellValue_Tooltip:SetScript("OnTooltipAddMoney", SellValue_OnTooltipAddMoney); + -- Hook loot tooltip + hooksecurefunc(GameTooltip, "SetLootItem", function(tip, lootIndex) + if SellValues then + local _, _, stackCount = GetLootSlotInfo(lootIndex); + if stackCount ~= 0 then + local link = GetLootSlotLink(lootIndex); + local itemID = SellValue_IDFromLink(link) + + SellValue_SetTooltip(itemID, stackCount); + end + end + end + ); + -- Hook bag tooltip hooksecurefunc(GameTooltip, "SetBagItem", function(tip, bag, slot) if SellValues and not MerchantFrame:IsVisible() then From 0252320edcbe1daa9d1d3083ff5750b9b52d7c4b Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 09:42:31 +0200 Subject: [PATCH 04/20] Trying to add values for trade skills --- SellValue.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SellValue.lua b/SellValue.lua index ee924ec..c111a11 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -96,7 +96,6 @@ function SellValue_OnLoad() -- Hook questlog reward tooltip hooksecurefunc(GameTooltip, "SetQuestLogItem", function(tip, qtype, slot) if SellValues then - local stackCount = nil; if qtype == "reward" then @@ -114,6 +113,23 @@ function SellValue_OnLoad() end end ); + + -- Hook trade skill tooltip + hooksecurefunc(GameTooltip, "SetTradeSkillItem", function(tip, tradeItemIndex, reagentIndex) + if SellValue then + + local stackCount = GetTradeSkillNumMade(tradeItemIndex); + + local link = GetTradeSkillItemLink(tradeItemIndex); + local itemID = SellValue_IDFromLink(link); + DEFAULT_CHAT_FRAME:AddMessage(link); + DEFAULT_CHAT_FRAME:AddMessage(itemID); + DEFAULT_CHAT_FRAME:AddMessage(stackCount); + + SellValue_SetTooltip(itemID, stackCount); + end + end + ); end function SellValue_OnEvent() From 7f859256939081299df1554552fe925dc78123ac Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 10:02:39 +0200 Subject: [PATCH 05/20] Trying to add the price for the materials --- SellValue.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index c111a11..7ff5898 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -117,15 +117,21 @@ function SellValue_OnLoad() -- Hook trade skill tooltip hooksecurefunc(GameTooltip, "SetTradeSkillItem", function(tip, tradeItemIndex, reagentIndex) if SellValue then + DEFAULT_CHAT_FRAME:AddMessage(tradeItemIndex); + DEFAULT_CHAT_FRAME:AddMessage(reagentIndex); + local stackCount = nil; + local link = nil; - local stackCount = GetTradeSkillNumMade(tradeItemIndex); - - local link = GetTradeSkillItemLink(tradeItemIndex); - local itemID = SellValue_IDFromLink(link); - DEFAULT_CHAT_FRAME:AddMessage(link); - DEFAULT_CHAT_FRAME:AddMessage(itemID); - DEFAULT_CHAT_FRAME:AddMessage(stackCount); + if reagentIndex then + local reagentName, _, count = GetTradeSkillReagentInfo(tradeItemIndex, reagentIndex); + stackCount = count; + link = GetTradeSkillReagentItemLink(tradeItemIndex, reagentIndex); + else + stackCount = GetTradeSkillNumMade(tradeItemIndex); + link = GetTradeSkillItemLink(tradeItemIndex); + end + local itemID = SellValue_IDFromLink(link);; SellValue_SetTooltip(itemID, stackCount); end end From e97af35495d7f99d92a39c42f25f360e61058a46 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 10:15:32 +0200 Subject: [PATCH 06/20] Added value for trade skill windwo --- SellValue.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index 7ff5898..714fbba 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -117,14 +117,11 @@ function SellValue_OnLoad() -- Hook trade skill tooltip hooksecurefunc(GameTooltip, "SetTradeSkillItem", function(tip, tradeItemIndex, reagentIndex) if SellValue then - DEFAULT_CHAT_FRAME:AddMessage(tradeItemIndex); - DEFAULT_CHAT_FRAME:AddMessage(reagentIndex); local stackCount = nil; local link = nil; if reagentIndex then - local reagentName, _, count = GetTradeSkillReagentInfo(tradeItemIndex, reagentIndex); - stackCount = count; + _, _, stackCount = GetTradeSkillReagentInfo(tradeItemIndex, reagentIndex); link = GetTradeSkillReagentItemLink(tradeItemIndex, reagentIndex); else stackCount = GetTradeSkillNumMade(tradeItemIndex); From 20051e9ca5bbf410616a1b8fc207c152c83f0e4d Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 10:15:41 +0200 Subject: [PATCH 07/20] Added value for tradeskill window --- SellValue.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SellValue.lua b/SellValue.lua index 714fbba..bf08e34 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -128,7 +128,7 @@ function SellValue_OnLoad() link = GetTradeSkillItemLink(tradeItemIndex); end - local itemID = SellValue_IDFromLink(link);; + local itemID = SellValue_IDFromLink(link); SellValue_SetTooltip(itemID, stackCount); end end From 116798d8255040d4e18b2a42370b040cab194f05 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Thu, 26 Oct 2023 22:11:17 +0200 Subject: [PATCH 08/20] Added sell value to item links --- SellValue.lua | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index bf08e34..833741a 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -14,21 +14,24 @@ local function hooksecurefunc(arg1, arg2, arg3) end end -function SellValue_SetTooltip(itemID, stackCount) - local price = SellValues[itemID]; +function SellValue_SetTooltip(itemID, stackCount, tooltip) + if not tooltip then + tooltip = GameTooltip + end + local price = SellValues[itemID]; if price then if price == 0 then - GameTooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); + tooltip:AddLine(ITEM_UNSELLABLE, 1.0, 1.0, 1.0); else - SetTooltipMoney(GameTooltip, price * stackCount); + SetTooltipMoney(tooltip, price * stackCount); end -- if price > 0 -- Adjust width and height to account for new lines - GameTooltip:SetHeight(GameTooltip:GetHeight() + 14); - if GameTooltip:GetWidth() < 120 then - GameTooltip:SetWidth(120); + tooltip:SetHeight(tooltip:GetHeight() + 14); + if tooltip:GetWidth() < 120 then + tooltip:SetWidth(120); end end -- if price end @@ -44,6 +47,17 @@ function SellValue_OnLoad() SellValue_Tooltip:SetScript("OnTooltipAddMoney", SellValue_OnTooltipAddMoney); + -- Hook item links tooltip + local org_OnHyperlinkShow = ChatFrame_OnHyperlinkShow + function ChatFrame_OnHyperlinkShow(link, text, button) + -- First, call the original function + org_OnHyperlinkShow(link, text, button); + + -- Now, call your custom function + local itemID = SellValue_IDFromLink(link); + SellValue_SetTooltip(itemID, 1, ItemRefTooltip); + end + -- Hook loot tooltip hooksecurefunc(GameTooltip, "SetLootItem", function(tip, lootIndex) if SellValues then From 3a6b201679f41a4c784cbf8913ac50281725407d Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Thu, 26 Oct 2023 22:18:17 +0200 Subject: [PATCH 09/20] Only check for sell value before actually pulling from it --- SellValue.lua | 73 ++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index 833741a..e9bd87a 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -19,6 +19,9 @@ function SellValue_SetTooltip(itemID, stackCount, tooltip) tooltip = GameTooltip end + if not SellValues then + return + end local price = SellValues[itemID]; if price then if price == 0 then @@ -60,21 +63,19 @@ function SellValue_OnLoad() -- Hook loot tooltip hooksecurefunc(GameTooltip, "SetLootItem", function(tip, lootIndex) - if SellValues then - local _, _, stackCount = GetLootSlotInfo(lootIndex); - if stackCount ~= 0 then - local link = GetLootSlotLink(lootIndex); - local itemID = SellValue_IDFromLink(link) - - SellValue_SetTooltip(itemID, stackCount); - end + local _, _, stackCount = GetLootSlotInfo(lootIndex); + if stackCount > 0 then + local link = GetLootSlotLink(lootIndex); + local itemID = SellValue_IDFromLink(link) + + SellValue_SetTooltip(itemID, stackCount); end end ); -- Hook bag tooltip hooksecurefunc(GameTooltip, "SetBagItem", function(tip, bag, slot) - if SellValues and not MerchantFrame:IsVisible() then + if not MerchantFrame:IsVisible() then local _, stackCount = GetContainerItemInfo(bag, slot); local itemID = SellValue_GetItemID(bag, slot); @@ -86,7 +87,7 @@ function SellValue_OnLoad() -- Hook bank tooltip hooksecurefunc(GameTooltip, "SetInventoryItem", function(tip, unit, slot) - if SellValues and not MerchantFrame:IsVisible() and slot > 19 then + if not MerchantFrame:IsVisible() and slot > 19 then local stackCount = GetInventoryItemCount(unit, slot); local itemID = SellValue_GetItemID(-1, slot); @@ -97,7 +98,7 @@ function SellValue_OnLoad() -- Hook quest reward tooltip hooksecurefunc(GameTooltip, "SetQuestItem", function(tip, qtype, slot) - if SellValues and (qtype == "reward" or qtype == "choice") then + if qtype == "reward" or qtype == "choice" then local link = GetQuestItemLink(qtype, slot); local _, _, stackCount = GetQuestItemInfo(qtype, slot); local itemID = SellValue_IDFromLink(link); @@ -109,42 +110,38 @@ function SellValue_OnLoad() -- Hook questlog reward tooltip hooksecurefunc(GameTooltip, "SetQuestLogItem", function(tip, qtype, slot) - if SellValues then - local stackCount = nil; - - if qtype == "reward" then - _, _, stackCount = GetQuestLogRewardInfo(slot); - elseif qtype == "choice" then - _, _, stackCount = GetQuestLogChoiceInfo(slot); - else - return - end - - local link = GetQuestLogItemLink(qtype, slot); - local itemID = SellValue_IDFromLink(link); + local stackCount = nil; - SellValue_SetTooltip(itemID, stackCount); + if qtype == "reward" then + _, _, stackCount = GetQuestLogRewardInfo(slot); + elseif qtype == "choice" then + _, _, stackCount = GetQuestLogChoiceInfo(slot); + else + return end + + local link = GetQuestLogItemLink(qtype, slot); + local itemID = SellValue_IDFromLink(link); + + SellValue_SetTooltip(itemID, stackCount); end ); -- Hook trade skill tooltip hooksecurefunc(GameTooltip, "SetTradeSkillItem", function(tip, tradeItemIndex, reagentIndex) - if SellValue then - local stackCount = nil; - local link = nil; - - if reagentIndex then - _, _, stackCount = GetTradeSkillReagentInfo(tradeItemIndex, reagentIndex); - link = GetTradeSkillReagentItemLink(tradeItemIndex, reagentIndex); - else - stackCount = GetTradeSkillNumMade(tradeItemIndex); - link = GetTradeSkillItemLink(tradeItemIndex); - end + local stackCount = nil; + local link = nil; - local itemID = SellValue_IDFromLink(link); - SellValue_SetTooltip(itemID, stackCount); + if reagentIndex then + _, _, stackCount = GetTradeSkillReagentInfo(tradeItemIndex, reagentIndex); + link = GetTradeSkillReagentItemLink(tradeItemIndex, reagentIndex); + else + stackCount = GetTradeSkillNumMade(tradeItemIndex); + link = GetTradeSkillItemLink(tradeItemIndex); end + + local itemID = SellValue_IDFromLink(link); + SellValue_SetTooltip(itemID, stackCount); end ); end From b32cc6f71f401092507a6bf27841b267ae6ce1b8 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Fri, 27 Oct 2023 07:45:22 +0200 Subject: [PATCH 10/20] Added support for hyperlinks --- SellValue.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SellValue.lua b/SellValue.lua index e9bd87a..4eac94b 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -96,6 +96,13 @@ function SellValue_OnLoad() end ); + -- Hook hyper links, used for BankItems addon + hooksecurefunc(GameTooltip, "SetHyperlink", function(tip, link) + local itemID = SellValue_IDFromLink(link); + SellValue_SetTooltip(itemID, 1); + end + ); + -- Hook quest reward tooltip hooksecurefunc(GameTooltip, "SetQuestItem", function(tip, qtype, slot) if qtype == "reward" or qtype == "choice" then From a819159d6af7734d4d9ed3c615e5c6ed306ba1e4 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Sat, 16 Dec 2023 22:33:38 +0100 Subject: [PATCH 11/20] Update SellValue.lua Fixed error that occurs in combination with EQL3. The error specifically happens when you open the quest log, then mouse over a creature (or maybe other object creating a info window) and then mousing over the quest log item again. The quest log item does not produce a box with item information, which causes the links to fail. The underlying bug is highly likely hidden somewhere inside EQL3, but I do not know how to find it there. --- SellValue.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SellValue.lua b/SellValue.lua index 4eac94b..728f5f0 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -6,6 +6,13 @@ local function hooksecurefunc(arg1, arg2, arg3) end local orig = arg1[arg2] arg1[arg2] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + -- Hack to avoid error being thrown when using in combination with EQL3 (Extended Quest Log) + if arg2 == "SetQuestLogItem" then + t1, t2, stackCount = GetQuestLogChoiceInfo(a3); + if t1 == nil and t2 == nil then + return + end + end local x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20 = orig(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) arg3(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) From 2447fee85de8431b27036e2d877a3d4156d61913 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Wed, 20 Dec 2023 10:50:16 +0100 Subject: [PATCH 12/20] Update SellValue.lua --- SellValue.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SellValue.lua b/SellValue.lua index 728f5f0..fd37efa 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -7,7 +7,7 @@ local function hooksecurefunc(arg1, arg2, arg3) local orig = arg1[arg2] arg1[arg2] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) -- Hack to avoid error being thrown when using in combination with EQL3 (Extended Quest Log) - if arg2 == "SetQuestLogItem" then + if arg2 == "SetQuestLogItem" and a2 == "choice" then t1, t2, stackCount = GetQuestLogChoiceInfo(a3); if t1 == nil and t2 == nil then return From 54ad62533b64bee06c2b1feab62588b4f09e7fb2 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Wed, 20 Dec 2023 11:13:15 +0100 Subject: [PATCH 13/20] Update SellValue.lua Improved hack so that single reward quests still work. --- SellValue.lua | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index fd37efa..dd43910 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -7,11 +7,8 @@ local function hooksecurefunc(arg1, arg2, arg3) local orig = arg1[arg2] arg1[arg2] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) -- Hack to avoid error being thrown when using in combination with EQL3 (Extended Quest Log) - if arg2 == "SetQuestLogItem" and a2 == "choice" then - t1, t2, stackCount = GetQuestLogChoiceInfo(a3); - if t1 == nil and t2 == nil then - return - end + if not SellValue_SetQuestLogItemIsValid(arg2, a1, a2, a3) then + return end local x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20 = orig(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) @@ -253,3 +250,21 @@ function SellValue_IDFromLink(itemlink) end return ; end + +function SellValue_SetQuestLogItemIsValid(funcName, tip, qtype, slot) + if funcName ~= "SetQuestLogItem" then + return false + end + + local name = nil; + if qtype == "reward" then + name = GetQuestLogRewardInfo(slot); + end + + if qtype == "choice" then + name = GetQuestLogChoiceInfo(slot); + end + + return name ~= nil +end + From 83d52956fe1d6975a658f4ee2207e2eb479152a8 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Wed, 20 Dec 2023 12:43:55 +0100 Subject: [PATCH 14/20] Removed hack for EQL3 --- SellValue.lua | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index dd43910..4eac94b 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -6,10 +6,6 @@ local function hooksecurefunc(arg1, arg2, arg3) end local orig = arg1[arg2] arg1[arg2] = function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) - -- Hack to avoid error being thrown when using in combination with EQL3 (Extended Quest Log) - if not SellValue_SetQuestLogItemIsValid(arg2, a1, a2, a3) then - return - end local x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20 = orig(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) arg3(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) @@ -250,21 +246,3 @@ function SellValue_IDFromLink(itemlink) end return ; end - -function SellValue_SetQuestLogItemIsValid(funcName, tip, qtype, slot) - if funcName ~= "SetQuestLogItem" then - return false - end - - local name = nil; - if qtype == "reward" then - name = GetQuestLogRewardInfo(slot); - end - - if qtype == "choice" then - name = GetQuestLogChoiceInfo(slot); - end - - return name ~= nil -end - From a9544b695155daaa057d7e44880a38d5eac61402 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Sun, 8 Sep 2024 12:12:27 +0200 Subject: [PATCH 15/20] - Updated readme - Added git ignore --- .gitignore | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 12 +++ 2 files changed, 233 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1784bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,221 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +################# +## JetBrains IDEA +################# + +.idea/ diff --git a/README.md b/README.md index 08705bb..d480ac4 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,15 @@ Includes a database to initialize default prices from vanilla core. If your server has custom items or prices, those will be updated when you visit a vendor like the original plugin ![SellValue](https://user-images.githubusercontent.com/13628128/58877571-b9846e80-86d9-11e9-905d-5da424049b07.png) + +## Features + +Shows the value of items on the tooltip on + +- Items linked in chat +- Items in the loot window +- Items in bags +- Items in bank +- Items in Quest reward +- Items in Quest log +- Items in Proficiency window \ No newline at end of file From 841001ea4b16237efc9687d6debd011073a9a44e Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Sun, 8 Sep 2024 12:22:15 +0200 Subject: [PATCH 16/20] Testing loot roll values --- SellValue.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SellValue.lua b/SellValue.lua index 4eac94b..7ec1fe0 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -73,6 +73,18 @@ function SellValue_OnLoad() end ); + hooksecurefunc(GameTooltip, "SetLootRollItem", function(tip, id) + DEFAULT_CHAT_FRAME:AddMessage("DEBUG SellValue: Testing SetLootRollItem"); + local _, _, stackCount = GetLootRollItemInfo(id); + if stackCount > 0 then + local link = GetLootRollItemLink(id); + local itemID = SellValue_IDFromLink(link) + + SellValue_SetTooltip(itemID, stackCount); + end + end + ); + -- Hook bag tooltip hooksecurefunc(GameTooltip, "SetBagItem", function(tip, bag, slot) if not MerchantFrame:IsVisible() then From e5efbc88fb26aa847046d99df4bbc22f1a3d7f0b Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Mon, 16 Sep 2024 21:08:34 +0200 Subject: [PATCH 17/20] Update SellValue.lua Removed the logging --- SellValue.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/SellValue.lua b/SellValue.lua index 7ec1fe0..c4dacca 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -74,7 +74,6 @@ function SellValue_OnLoad() ); hooksecurefunc(GameTooltip, "SetLootRollItem", function(tip, id) - DEFAULT_CHAT_FRAME:AddMessage("DEBUG SellValue: Testing SetLootRollItem"); local _, _, stackCount = GetLootRollItemInfo(id); if stackCount > 0 then local link = GetLootRollItemLink(id); From 3a58a4bb85fa9180f3a6efbdf168e2c6f568d844 Mon Sep 17 00:00:00 2001 From: DBFBlackbull Date: Mon, 16 Sep 2024 21:09:08 +0200 Subject: [PATCH 18/20] Update README.md Updated readme with roll sell price --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d480ac4..88c1216 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ Shows the value of items on the tooltip on - Items linked in chat - Items in the loot window +- Items in the roll window - Items in bags - Items in bank - Items in Quest reward - Items in Quest log -- Items in Proficiency window \ No newline at end of file +- Items in Proficiency window From 76badfd256b4c2479d2fe3811f47ab4cbdca204c Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Sun, 20 Oct 2024 09:43:09 +0200 Subject: [PATCH 19/20] Testing mail tooltip value --- SellValue.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/SellValue.lua b/SellValue.lua index c4dacca..2ff2cdb 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -73,6 +73,7 @@ function SellValue_OnLoad() end ); + -- Hook group loot roll tooltip hooksecurefunc(GameTooltip, "SetLootRollItem", function(tip, id) local _, _, stackCount = GetLootRollItemInfo(id); if stackCount > 0 then @@ -114,6 +115,26 @@ function SellValue_OnLoad() end ); + -- Hook mail inbox tooltip + hooksecurefunc(GameTooltip, "SetInboxItem", function(tip, index, attachmentIndex) + local link = GetInboxItemLink(index, attachmentIndex); + local _, _, stackCount = GetInboxItem(index, attachmentIndex) + local itemID = SellValue_IDFromLink(link); + + SellValue_SetTooltip(itemID, stackCount); + end + ); + + -- Hook mail send tooltip + hooksecurefunc(GameTooltip, "SetSendMailItem", function(tip, index) + local link = GetSendMailItemLink(index); + local _, _, stackCount = GetSendMailItem(index) + local itemID = SellValue_IDFromLink(link); + + SellValue_SetTooltip(itemID, stackCount); + end + ); + -- Hook quest reward tooltip hooksecurefunc(GameTooltip, "SetQuestItem", function(tip, qtype, slot) if qtype == "reward" or qtype == "choice" then From 00ca98f3bdf790a5a1472fe12905f58182cb4f99 Mon Sep 17 00:00:00 2001 From: Peter Bjerg Lidegaard Date: Sun, 20 Oct 2024 10:10:47 +0200 Subject: [PATCH 20/20] - send mail was not needed - inbox mail cannot be done because the link function was only implemented in Cata --- SellValue.lua | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/SellValue.lua b/SellValue.lua index 2ff2cdb..5a45b55 100644 --- a/SellValue.lua +++ b/SellValue.lua @@ -115,26 +115,6 @@ function SellValue_OnLoad() end ); - -- Hook mail inbox tooltip - hooksecurefunc(GameTooltip, "SetInboxItem", function(tip, index, attachmentIndex) - local link = GetInboxItemLink(index, attachmentIndex); - local _, _, stackCount = GetInboxItem(index, attachmentIndex) - local itemID = SellValue_IDFromLink(link); - - SellValue_SetTooltip(itemID, stackCount); - end - ); - - -- Hook mail send tooltip - hooksecurefunc(GameTooltip, "SetSendMailItem", function(tip, index) - local link = GetSendMailItemLink(index); - local _, _, stackCount = GetSendMailItem(index) - local itemID = SellValue_IDFromLink(link); - - SellValue_SetTooltip(itemID, stackCount); - end - ); - -- Hook quest reward tooltip hooksecurefunc(GameTooltip, "SetQuestItem", function(tip, qtype, slot) if qtype == "reward" or qtype == "choice" then