From 57f6cc4471267473c70aa8b9aa66bf34011bca4a Mon Sep 17 00:00:00 2001 From: Xurkon Date: Thu, 2 Apr 2026 19:27:05 -0500 Subject: [PATCH] feat: Add arrow font settings; Add Apply to All font options to Tracker --- Modules/Arrow/QuestieArrow.lua | 16 +++++-- .../Options/ArrowTab/QuestieOptionsArrow.lua | 35 ++++++++++++++- Modules/Options/QuestieOptionsDefaults.lua | 2 + .../TrackerTab/QuestieOptionsTracker.lua | 43 +++++++++++++++++++ 4 files changed, 92 insertions(+), 4 deletions(-) diff --git a/Modules/Arrow/QuestieArrow.lua b/Modules/Arrow/QuestieArrow.lua index d998c07..963ba21 100644 --- a/Modules/Arrow/QuestieArrow.lua +++ b/Modules/Arrow/QuestieArrow.lua @@ -794,13 +794,23 @@ function QuestieArrow:ApplyAlpha() end function QuestieArrow:UpdateSettings() - print("UpdateSettings called, arrowFrame=" .. tostring(arrowFrame)) EnsureArrowFrame() - print("After EnsureArrowFrame, arrowFrame=" .. tostring(arrowFrame)) if arrowFrame then - print("Setting scale to " .. tostring(_GetArrowScale())) arrowFrame:SetScale(_GetArrowScale()) arrowFrame:SetAlpha(_GetArrowAlpha()) + QuestieArrow:UpdateFont() + end +end + +function QuestieArrow:UpdateFont() + if not arrowFrame then return end + local fontSize = Questie.db.profile.arrowFontSize or 10 + local fontFace = Questie.db.profile.arrowFont or QuestieFont:GetFont() + if arrowFrame.title then + arrowFrame.title:SetFont(fontFace, fontSize, "OUTLINE") + end + if arrowFrame.distance then + arrowFrame.distance:SetFont(fontFace, fontSize - 2, "OUTLINE") end end diff --git a/Modules/Options/ArrowTab/QuestieOptionsArrow.lua b/Modules/Options/ArrowTab/QuestieOptionsArrow.lua index 78863a3..0971fa2 100644 --- a/Modules/Options/ArrowTab/QuestieOptionsArrow.lua +++ b/Modules/Options/ArrowTab/QuestieOptionsArrow.lua @@ -55,7 +55,6 @@ function QuestieOptions.tabs.arrow:Initialize() step = 0.05, get = function() return Questie.db.profile.arrowScale or 1 end, set = function(_, value) - print("SCALE SET CALLED: " .. tostring(value)) Questie.db.profile.arrowScale = value if QuestieArrow and QuestieArrow.UpdateSettings then QuestieArrow:UpdateSettings() @@ -80,6 +79,40 @@ function QuestieOptions.tabs.arrow:Initialize() end, }, arrow_spacer_2 = QuestieOptionsUtils:Spacer(6), + arrowFont = { + type = "select", + dialogControl = 'LSM30_Font', + order = 7, + values = SharedMedia:HashTable("font"), + style = 'dropdown', + name = function() return l10n("Arrow Font") end, + desc = function() return l10n("The font used for the arrow distance and title text.") end, + get = function() return Questie.db.profile.arrowFont or "Friz Quadrata TT" end, + set = function(_, value) + Questie.db.profile.arrowFont = value + if QuestieArrow and QuestieArrow.UpdateFont then + QuestieArrow:UpdateFont() + end + end, + }, + arrowFontSize = { + type = "range", + order = 8, + name = function() return l10n("Arrow Font Size") end, + desc = function() return l10n("The font size used for the arrow distance and title text.") end, + width = "double", + min = 8, + max = 18, + step = 1, + get = function() return Questie.db.profile.arrowFontSize or 10 end, + set = function(_, value) + Questie.db.profile.arrowFontSize = value + if QuestieArrow and QuestieArrow.UpdateFont then + QuestieArrow:UpdateFont() + end + end, + }, + arrow_spacer_2 = QuestieOptionsUtils:Spacer(6), autoTrackQuests = { type = "toggle", order = 7, diff --git a/Modules/Options/QuestieOptionsDefaults.lua b/Modules/Options/QuestieOptionsDefaults.lua index e0b5586..442bb78 100644 --- a/Modules/Options/QuestieOptionsDefaults.lua +++ b/Modules/Options/QuestieOptionsDefaults.lua @@ -52,6 +52,8 @@ function QuestieOptionsDefaults:Load() arrowEnabled = true, arrowScale = 1, arrowAlpha = 1.0, + arrowFontSize = 10, + arrowFont = 'Friz Quadrata TT', debugArrow = false, enableObjectives = true, enableTurnins = true, diff --git a/Modules/Options/TrackerTab/QuestieOptionsTracker.lua b/Modules/Options/TrackerTab/QuestieOptionsTracker.lua index b62f176..80d1da9 100644 --- a/Modules/Options/TrackerTab/QuestieOptionsTracker.lua +++ b/Modules/Options/TrackerTab/QuestieOptionsTracker.lua @@ -924,6 +924,49 @@ function QuestieOptions.tabs.tracker:Initialize() QuestieTracker:Update() end }, + applyAllHeader = { + type = "header", + order = 9.1, + name = function() return l10n("Apply to All") end, + }, + applyAllFont = { + type = "select", + dialogControl = 'LSM30_Font', + order = 9.2, + values = SharedMedia:HashTable("font"), + style = 'dropdown', + width = 1.5, + name = function() return l10n("Font for All") end, + desc = function() return l10n("Set the font for Header, Zones, Quests, and Objectives all at once.") end, + disabled = function() return not Questie.db.profile.trackerEnabled end, + get = function() return Questie.db.profile.trackerFontHeader or "Friz Quadrata TT" end, + set = function(_, value) + Questie.db.profile.trackerFontHeader = value + Questie.db.profile.trackerFontZone = value + Questie.db.profile.trackerFontQuest = value + Questie.db.profile.trackerFontObjective = value + QuestieTracker:Update() + end + }, + applyAllFontSize = { + type = "range", + order = 9.3, + name = function() return l10n("Font Size for All") end, + desc = function() return l10n("Set the font size for Header, Zones, Quests, and Objectives all at once.") end, + width = "double", + min = 8, + max = 26, + step = 1, + disabled = function() return not Questie.db.profile.trackerEnabled end, + get = function() return Questie.db.profile.trackerFontSizeHeader or 12 end, + set = function(_, value) + Questie.db.profile.trackerFontSizeHeader = value + Questie.db.profile.trackerFontSizeZone = value + Questie.db.profile.trackerFontSizeQuest = value + Questie.db.profile.trackerFontSizeObjective = math.min(value, Questie.db.profile.trackerFontSizeQuest) + QuestieTracker:Update() + end + }, fontOutline = { type = "select", dialogControl = 'LSM30_Font',