diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 05490c92c..074b861ee 100755 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -45,6 +45,9 @@ AUCTIONATOR_LOCALES.enUS = function() L["CONFIG_PET_TOOLTIP"] = "Show pet tooltips" L["PET_TOOLTIP_TOOLTIP_HEADER"] = "Pet Tooltips" L["PET_TOOLTIP_TOOLTIP_TEXT"] = "Shows Auctionator information for caged pets." + L["CONFIG_SELL_PRICE_TOOLTIP"] = "Show default sell price." + L["SELL_PRICE_TOOLTIP_TOOLTIP_HEADER"] = "Sell Price Tooltip Information" + L["SELL_PRICE_TOOLTIP_TOOLTIP_TEXT"] = "Show the default sell price information in tooltip on mouseover." L["CONFIG_VENDOR_TOOLTIP"] = "Show vendor tooltips." L["VENDOR_TOOLTIP_TOOLTIP_HEADER"] = "Vendor Tooltip Information" L["VENDOR_TOOLTIP_TOOLTIP_TEXT"] = "Show vendor information in tooltip on mouseover." diff --git a/Source/Config/Main.lua b/Source/Config/Main.lua index e1723f259..34e1027eb 100755 --- a/Source/Config/Main.lua +++ b/Source/Config/Main.lua @@ -2,6 +2,7 @@ Auctionator.Config.Options = { DEBUG = "debug", NO_PRICE_DATABASE = "no_price_database", MAILBOX_TOOLTIPS = "mailbox_tooltips", + SELL_PRICE_TOOLTIPS = "sell_price_tooltips", VENDOR_TOOLTIPS = "vendor_tooltips", AUCTION_TOOLTIPS = "auction_tooltips", AUCTION_AGE_TOOLTIPS = "auction_age_tooltips", @@ -81,6 +82,7 @@ Auctionator.Config.Defaults = { [Auctionator.Config.Options.DEBUG] = false, [Auctionator.Config.Options.NO_PRICE_DATABASE] = false, [Auctionator.Config.Options.MAILBOX_TOOLTIPS] = true, + [Auctionator.Config.Options.SELL_PRICE_TOOLTIPS] = false, [Auctionator.Config.Options.VENDOR_TOOLTIPS] = true, [Auctionator.Config.Options.AUCTION_TOOLTIPS] = true, [Auctionator.Config.Options.AUCTION_AGE_TOOLTIPS] = false, diff --git a/Source/Tooltips/Hooks.lua b/Source/Tooltips/Hooks.lua index a6f3814e5..8e8917fdf 100755 --- a/Source/Tooltips/Hooks.lua +++ b/Source/Tooltips/Hooks.lua @@ -184,6 +184,15 @@ TooltipHandlers["SetInboxItem"] = function(tip, index, attachIndex) end end +-- This removed the price from the tooltip if the option is disabled +local originalGameTooltipOnTooltipSetItem = GameTooltip_OnTooltipAddMoney; +GameTooltip_OnTooltipAddMoney = function(...) + local sellPriceEnabled = Auctionator.Config.Get(Auctionator.Config.Options.SELL_PRICE_TOOLTIPS) + if sellPriceEnabled then + originalGameTooltipOnTooltipSetItem(...) + end +end + -- This occurs when mousing over an item in the Inbox frame hooksecurefunc("InboxFrameItem_OnEnter", function(self) diff --git a/Source_Mainline/Config/Frames/Tooltips.xml b/Source_Mainline/Config/Frames/Tooltips.xml index dc58b627e..1c2f5d131 100755 --- a/Source_Mainline/Config/Frames/Tooltips.xml +++ b/Source_Mainline/Config/Frames/Tooltips.xml @@ -40,6 +40,17 @@ + + + + + + + + + + + @@ -47,7 +58,7 @@ - + diff --git a/Source_Mainline/Config/Mixins/Tooltips.lua b/Source_Mainline/Config/Mixins/Tooltips.lua index 57e39276c..eedfc93b3 100755 --- a/Source_Mainline/Config/Mixins/Tooltips.lua +++ b/Source_Mainline/Config/Mixins/Tooltips.lua @@ -12,6 +12,7 @@ end function AuctionatorConfigTooltipsFrameMixin:ShowSettings() self.MailboxTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.MAILBOX_TOOLTIPS)) self.PetTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.PET_TOOLTIPS)) + self.SellPriceTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.SELL_PRICE_TOOLTIPS)) self.VendorTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.VENDOR_TOOLTIPS)) self.AuctionTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.AUCTION_TOOLTIPS)) self.EnchantTooltips:SetChecked(Auctionator.Config.Get(Auctionator.Config.Options.ENCHANT_TOOLTIPS)) @@ -24,6 +25,7 @@ function AuctionatorConfigTooltipsFrameMixin:Save() Auctionator.Config.Set(Auctionator.Config.Options.MAILBOX_TOOLTIPS, self.MailboxTooltips:GetChecked()) Auctionator.Config.Set(Auctionator.Config.Options.PET_TOOLTIPS, self.PetTooltips:GetChecked()) + Auctionator.Config.Set(Auctionator.Config.Options.SELL_PRICE_TOOLTIPS, self.SellPriceTooltips:GetChecked()) Auctionator.Config.Set(Auctionator.Config.Options.VENDOR_TOOLTIPS, self.VendorTooltips:GetChecked()) Auctionator.Config.Set(Auctionator.Config.Options.AUCTION_TOOLTIPS, self.AuctionTooltips:GetChecked()) Auctionator.Config.Set(Auctionator.Config.Options.ENCHANT_TOOLTIPS, self.EnchantTooltips:GetChecked())