feat: Add arrow font settings; Add Apply to All font options to Tracker
This commit is contained in:
@@ -794,13 +794,23 @@ function QuestieArrow:ApplyAlpha()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function QuestieArrow:UpdateSettings()
|
function QuestieArrow:UpdateSettings()
|
||||||
print("UpdateSettings called, arrowFrame=" .. tostring(arrowFrame))
|
|
||||||
EnsureArrowFrame()
|
EnsureArrowFrame()
|
||||||
print("After EnsureArrowFrame, arrowFrame=" .. tostring(arrowFrame))
|
|
||||||
if arrowFrame then
|
if arrowFrame then
|
||||||
print("Setting scale to " .. tostring(_GetArrowScale()))
|
|
||||||
arrowFrame:SetScale(_GetArrowScale())
|
arrowFrame:SetScale(_GetArrowScale())
|
||||||
arrowFrame:SetAlpha(_GetArrowAlpha())
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ function QuestieOptions.tabs.arrow:Initialize()
|
|||||||
step = 0.05,
|
step = 0.05,
|
||||||
get = function() return Questie.db.profile.arrowScale or 1 end,
|
get = function() return Questie.db.profile.arrowScale or 1 end,
|
||||||
set = function(_, value)
|
set = function(_, value)
|
||||||
print("SCALE SET CALLED: " .. tostring(value))
|
|
||||||
Questie.db.profile.arrowScale = value
|
Questie.db.profile.arrowScale = value
|
||||||
if QuestieArrow and QuestieArrow.UpdateSettings then
|
if QuestieArrow and QuestieArrow.UpdateSettings then
|
||||||
QuestieArrow:UpdateSettings()
|
QuestieArrow:UpdateSettings()
|
||||||
@@ -80,6 +79,40 @@ function QuestieOptions.tabs.arrow:Initialize()
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
arrow_spacer_2 = QuestieOptionsUtils:Spacer(6),
|
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 = {
|
autoTrackQuests = {
|
||||||
type = "toggle",
|
type = "toggle",
|
||||||
order = 7,
|
order = 7,
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ function QuestieOptionsDefaults:Load()
|
|||||||
arrowEnabled = true,
|
arrowEnabled = true,
|
||||||
arrowScale = 1,
|
arrowScale = 1,
|
||||||
arrowAlpha = 1.0,
|
arrowAlpha = 1.0,
|
||||||
|
arrowFontSize = 10,
|
||||||
|
arrowFont = 'Friz Quadrata TT',
|
||||||
debugArrow = false,
|
debugArrow = false,
|
||||||
enableObjectives = true,
|
enableObjectives = true,
|
||||||
enableTurnins = true,
|
enableTurnins = true,
|
||||||
|
|||||||
@@ -924,6 +924,49 @@ function QuestieOptions.tabs.tracker:Initialize()
|
|||||||
QuestieTracker:Update()
|
QuestieTracker:Update()
|
||||||
end
|
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 = {
|
fontOutline = {
|
||||||
type = "select",
|
type = "select",
|
||||||
dialogControl = 'LSM30_Font',
|
dialogControl = 'LSM30_Font',
|
||||||
|
|||||||
Reference in New Issue
Block a user