feat: hide tooltip extension checkbox in settings

This commit is contained in:
Salikh Gurgenidze
2025-12-23 14:50:55 +04:00
parent 0c55cd80ba
commit fee19fcfb2
5 changed files with 130 additions and 19 deletions
+4
View File
@@ -46,12 +46,16 @@ function DB:Initialize()
hideFooter = false,
bgTransparency = 0.15,
showTrackedItems = true,
showTooltipCounts = true,
trackedItems = {},
},
}
end
-- Ensure new settings exist for existing installations
if Guda_CharDB.settings.showTooltipCounts == nil then
Guda_CharDB.settings.showTooltipCounts = true
end
if Guda_CharDB.settings.bgTransparency == nil then
if Guda_CharDB.settings.frameOpacity ~= nil then
Guda_CharDB.settings.bgTransparency = 1.0 - Guda_CharDB.settings.frameOpacity
+5
View File
@@ -165,6 +165,11 @@ local function GetClassColor(classToken)
end
function Tooltip:AddInventoryInfo(tooltip, link)
-- Check if the setting is enabled
if not addon.Modules.DB:GetSetting("showTooltipCounts") then
return
end
-- Check if database is properly initialized and has the expected structure
if not Guda_DB or type(Guda_DB) ~= "table" then
return
+11
View File
@@ -8,3 +8,14 @@ BINDING_NAME_GUDA_USE_QUEST_ITEM_1 = "Quest Bar 1"
BINDING_NAME_GUDA_USE_QUEST_ITEM_2 = "Quest Bar 2"
-- Additional localization strings can be added here
L_SHOW_TOOLTIP_COUNTS = "Tooltip Extension"
L_SHOW_TOOLTIP_COUNTS_TT = "Show how many of this item you have across all your characters in the item tooltip."
L_LOCK_BAGS_TT = "Lock the bag frames in place so they cannot be moved by dragging."
L_HIDE_BORDERS_TT = "Hide the thick borders around the bag and bank frames for a cleaner look."
L_QUALITY_BORDER_EQ_TT = "Show a color-coded border around equipped items based on their quality (Common, Rare, Epic, etc.)."
L_QUALITY_BORDER_OTHER_TT = "Show a color-coded border around non-equipped items in your bags and bank based on their quality."
L_SHOW_SEARCH_BAR_TT = "Show a search bar at the top of your bags to quickly find items."
L_SHOW_QUEST_BAR_TT = "Show a bar for quickly accessing quest-related items."
L_HOVER_BAGLINE_TT = "Minimizes the bag container to show only the main bag and keyring. Hover over the main bag to view the other bags."
L_HIDE_FOOTER_TT = "Hide the bottom section of the bag frame containing money and bag slots."
+72
View File
@@ -120,6 +120,13 @@ function Guda_SettingsPopup_OnShow(self)
local showSearchBarCheckbox = getglobal("Guda_SettingsPopup_ShowSearchBarCheckbox")
local showQuestBarCheckbox = getglobal("Guda_SettingsPopup_ShowQuestBarCheckbox")
local hoverBaglineCheckbox = getglobal("Guda_SettingsPopup_HoverBaglineCheckbox")
local hideFooterCheckbox = getglobal("Guda_SettingsPopup_HideFooterCheckbox")
local showTooltipCountsCheckbox = getglobal("Guda_SettingsPopup_ShowTooltipCountsCheckbox")
local showTooltipCounts = Guda.Modules.DB:GetSetting("showTooltipCounts")
if showTooltipCounts == nil then
showTooltipCounts = true
end
if bagSlider then
bagSlider:SetValue(bagColumns)
@@ -173,6 +180,10 @@ function Guda_SettingsPopup_OnShow(self)
hoverBaglineCheckbox:SetChecked(hoverBagline and 1 or 0)
end
if showTooltipCountsCheckbox then
showTooltipCountsCheckbox:SetChecked(showTooltipCounts and 1 or 0)
end
-- Update display (might be too tall for current frame size)
local frame = getglobal("Guda_SettingsPopup")
@@ -486,6 +497,9 @@ function Guda_SettingsPopup_LockBagsCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_LOCK_BAGS_TT
local isLocked = false
if Guda and Guda.Modules and Guda.Modules.DB then
isLocked = Guda.Modules.DB:GetSetting("lockBags")
@@ -525,6 +539,9 @@ function Guda_SettingsPopup_HideBordersCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_HIDE_BORDERS_TT
local hideBorders = false
if Guda and Guda.Modules and Guda.Modules.DB then
hideBorders = Guda.Modules.DB:GetSetting("hideBorders")
@@ -583,6 +600,9 @@ function Guda_SettingsPopup_QualityBorderEquipmentCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_QUALITY_BORDER_EQ_TT
local showBorders = true
if Guda and Guda.Modules and Guda.Modules.DB then
showBorders = Guda.Modules.DB:GetSetting("showQualityBorderEquipment")
@@ -628,6 +648,9 @@ function Guda_SettingsPopup_QualityBorderOtherCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_QUALITY_BORDER_OTHER_TT
local showBorders = true
if Guda and Guda.Modules and Guda.Modules.DB then
showBorders = Guda.Modules.DB:GetSetting("showQualityBorderOther")
@@ -673,6 +696,9 @@ function Guda_SettingsPopup_ShowSearchBarCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_SHOW_SEARCH_BAR_TT
local showSearchBar = true
if Guda and Guda.Modules and Guda.Modules.DB then
showSearchBar = Guda.Modules.DB:GetSetting("showSearchBar")
@@ -727,6 +753,9 @@ function Guda_SettingsPopup_ShowQuestBarCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_SHOW_QUEST_BAR_TT
local showQuestBar = true
if Guda and Guda.Modules and Guda.Modules.DB then
showQuestBar = Guda.Modules.DB:GetSetting("showQuestBar")
@@ -766,6 +795,9 @@ function Guda_SettingsPopup_HoverBaglineCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_HOVER_BAGLINE_TT
local hoverBagline = false
if Guda and Guda.Modules and Guda.Modules.DB then
hoverBagline = Guda.Modules.DB:GetSetting("hoverBagline")
@@ -806,6 +838,9 @@ function Guda_SettingsPopup_HideFooterCheckbox_OnLoad(self)
end
end
-- Tooltip
self.tooltipText = L_HIDE_FOOTER_TT
local hideFooter = false
if Guda and Guda.Modules and Guda.Modules.DB then
hideFooter = Guda.Modules.DB:GetSetting("hideFooter")
@@ -845,6 +880,43 @@ function Guda_SettingsPopup_HideFooterCheckbox_OnClick(self)
end
end
-- Show Tooltip Counts Checkbox OnLoad
function Guda_SettingsPopup_ShowTooltipCountsCheckbox_OnLoad(self)
local text = getglobal(self:GetName().."Text")
if text then
text:SetText(L_SHOW_TOOLTIP_COUNTS or "Show Item Counts in Tooltip")
-- Increase font size
local font, _, flags = text:GetFont()
if font then
text:SetFont(font, 13, flags)
end
end
-- Tooltip
self.tooltipText = L_SHOW_TOOLTIP_COUNTS_TT or "Show how many of this item you have across all your characters in the item tooltip."
local showTooltipCounts = true
if Guda and Guda.Modules and Guda.Modules.DB then
showTooltipCounts = Guda.Modules.DB:GetSetting("showTooltipCounts")
if showTooltipCounts == nil then
showTooltipCounts = true
end
end
self:SetChecked(showTooltipCounts and 1 or 0)
end
-- Show Tooltip Counts Checkbox OnClick
function Guda_SettingsPopup_ShowTooltipCountsCheckbox_OnClick(self)
local isChecked = self:GetChecked() == 1
-- Save setting
if Guda and Guda.Modules and Guda.Modules.DB then
Guda.Modules.DB:SetSetting("showTooltipCounts", isChecked)
end
end
-- Initialize
function SettingsPopup:Initialize()
Guda:Debug("Settings popup initialized")
+38 -19
View File
@@ -3,7 +3,7 @@
<!-- Settings Popup Frame -->
<Frame name="Guda_SettingsPopup" toplevel="true" movable="true" enableMouse="true" hidden="true" parent="UIParent" frameStrata="DIALOG">
<Size>
<AbsDimension x="420" y="590"/>
<AbsDimension x="550" y="590"/>
</Size>
<Anchors>
@@ -95,7 +95,7 @@
<!-- Bag Columns Slider -->
<Slider name="Guda_SettingsPopup_BagColumnsSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP">
@@ -117,7 +117,7 @@
<!-- Bank Columns Slider -->
<Slider name="Guda_SettingsPopup_BankColumnsSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_BagColumnsSlider">
@@ -139,7 +139,7 @@
<!-- Icon Size Slider -->
<Slider name="Guda_SettingsPopup_IconSizeSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_BankColumnsSlider">
@@ -161,7 +161,7 @@
<!-- Icon Font Size Slider -->
<Slider name="Guda_SettingsPopup_IconFontSizeSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_IconSizeSlider">
@@ -183,7 +183,7 @@
<!-- Icon Spacing Slider -->
<Slider name="Guda_SettingsPopup_IconSpacingSlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_IconFontSizeSlider">
@@ -205,7 +205,7 @@
<!-- Background Transparency Slider -->
<Slider name="Guda_SettingsPopup_BgTransparencySlider" inherits="OptionsSliderTemplate">
<Size>
<AbsDimension x="370" y="17"/>
<AbsDimension x="500" y="17"/>
</Size>
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_IconSpacingSlider">
@@ -229,7 +229,7 @@
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_BgTransparencySlider">
<Offset>
<AbsDimension x="-170" y="-30"/>
<AbsDimension x="-240" y="-30"/>
</Offset>
</Anchor>
</Anchors>
@@ -248,7 +248,7 @@
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_LockBagsCheckbox">
<Offset>
<AbsDimension x="150" y="0"/>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -265,9 +265,9 @@
<!-- Quality Border Equipment Checkbox -->
<CheckButton name="Guda_SettingsPopup_QualityBorderEquipmentCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_LockBagsCheckbox">
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_HideBordersCheckbox">
<Offset>
<AbsDimension x="0" y="-8"/>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -284,9 +284,9 @@
<!-- Quality Border Other Checkbox -->
<CheckButton name="Guda_SettingsPopup_QualityBorderOtherCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_QualityBorderEquipmentCheckbox">
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_LockBagsCheckbox">
<Offset>
<AbsDimension x="150" y="0"/>
<AbsDimension x="0" y="-8"/>
</Offset>
</Anchor>
</Anchors>
@@ -303,9 +303,9 @@
<!-- Show Search Bar Checkbox -->
<CheckButton name="Guda_SettingsPopup_ShowSearchBarCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_QualityBorderEquipmentCheckbox">
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_QualityBorderOtherCheckbox">
<Offset>
<AbsDimension x="0" y="-8"/>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -324,7 +324,7 @@
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_ShowSearchBarCheckbox">
<Offset>
<AbsDimension x="150" y="0"/>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -341,7 +341,7 @@
<!-- Hover Bagline Checkbox -->
<CheckButton name="Guda_SettingsPopup_HoverBaglineCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_ShowSearchBarCheckbox">
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Guda_SettingsPopup_QualityBorderOtherCheckbox">
<Offset>
<AbsDimension x="0" y="-8"/>
</Offset>
@@ -362,7 +362,7 @@
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_HoverBaglineCheckbox">
<Offset>
<AbsDimension x="150" y="0"/>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -375,6 +375,25 @@
</OnClick>
</Scripts>
</CheckButton>
<!-- Show Tooltip Counts Checkbox -->
<CheckButton name="Guda_SettingsPopup_ShowTooltipCountsCheckbox" inherits="OptionsCheckButtonTemplate">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT" relativeTo="Guda_SettingsPopup_HideFooterCheckbox">
<Offset>
<AbsDimension x="145" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
Guda_SettingsPopup_ShowTooltipCountsCheckbox_OnLoad(this)
</OnLoad>
<OnClick>
Guda_SettingsPopup_ShowTooltipCountsCheckbox_OnClick(this)
</OnClick>
</Scripts>
</CheckButton>
</Frames>
</Frame>
@@ -384,7 +403,7 @@
<Layer level="ARTWORK">
<FontString name="$parent_Instructions" inherits="GameFontHighlight" justifyH="LEFT" justifyV="TOP">
<Size>
<AbsDimension x="360" y="0"/>
<AbsDimension x="440" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">