Refactor config initialization and enhance font safety checks
All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good

This commit is contained in:
Roman Jaroš 2025-03-30 22:52:27 +02:00
parent 30e04df022
commit 666bbc4659
3 changed files with 31 additions and 21 deletions

View file

@ -17,6 +17,9 @@ end
addon.API.CreateCzechFont = CreateCzechFont
local function UpdateCzechFont(FontString, name, size)
if not FontString then
return
end
local _, currentSize, flags = FontString:GetFont()
FontString:SetFont(FontPath .. name, size or currentSize, flags)
end

View file

@ -125,7 +125,7 @@ local function InitTactics()
local layout = Options.layout
layout:AddInitializer(CreateSettingsListSectionHeaderInitializer("Taktiky"))
CreateCheckbox("TACTIC_ENABLED", "Zapnout", Update)
CreateCheckbox("TACTIC_ENABLED", "Zapnout *", Update)
CreateDropdown("TACTIC_TEXT_FONT_NAME", "Pismo *", addon.API.GetFontContainer, Update)