161 lines
7.9 KiB
Lua
Executable file
161 lines
7.9 KiB
Lua
Executable file
function CzechQuestsAddon:AddQuestOptions(category)
|
|
|
|
-- Enable translations
|
|
local enableCheckbox = Settings.RegisterAddOnSetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_ENABLED",
|
|
"TRANSLATION_QUEST_FRAME_ENABLED",
|
|
CzechQuestsAddon_Store.config,
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED),
|
|
"Zapnout *",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED
|
|
)
|
|
Settings.CreateCheckbox(category, enableCheckbox)
|
|
|
|
if (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) then
|
|
-- Add DARK mode checkbox
|
|
local darkModeCheckbox = Settings.RegisterAddOnSetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_DARK_MODE",
|
|
"TRANSLATION_QUEST_FRAME_DARK_MODE",
|
|
CzechQuestsAddon_Store.config,
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE),
|
|
"Použít tmavý režim",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE
|
|
)
|
|
Settings.CreateCheckbox(category, darkModeCheckbox)
|
|
end
|
|
|
|
-- define FontOptions
|
|
local function GetFontOptions()
|
|
local container = Settings.CreateControlTextContainer()
|
|
container:Add("morpheus_cz.ttf", "Morpheus (cz)")
|
|
container:Add("frizquadratatt_cz.ttf", "Friz Quadrata TT (cz)")
|
|
container:Add("quicksand.ttf", "Quicksand")
|
|
container:Add("caveat.ttf", "Caveat")
|
|
return container:GetData()
|
|
end
|
|
|
|
-- Add header font dropdown menu
|
|
local headerFontFamilyDropdown = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY),
|
|
"Písmo nadpisu",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY = value
|
|
CzechQuestsAddon:UpdateTranslationQuestFrameFontSettings()
|
|
end
|
|
)
|
|
Settings.CreateDropdown(category, headerFontFamilyDropdown, GetFontOptions)
|
|
|
|
-- Add text font dropdown menu
|
|
local textFontFamilyDropdown = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY),
|
|
"Písmo textu",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY = value
|
|
CzechQuestsAddon:UpdateTranslationQuestFrameFontSettings()
|
|
end
|
|
)
|
|
Settings.CreateDropdown(category, textFontFamilyDropdown, GetFontOptions)
|
|
|
|
-- Add slider for change primary header font size
|
|
local primaryHeaderFontSizeSlider = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE),
|
|
"Velikost názvu",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE = value
|
|
CzechQuestsAddon:UpdateTranslationQuestFrameFontSettings()
|
|
end
|
|
)
|
|
local primaryHeaderFontSizeSliderOptions = Settings.CreateSliderOptions(10, 30, 1)
|
|
primaryHeaderFontSizeSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
|
Settings.CreateSlider(category, primaryHeaderFontSizeSlider, primaryHeaderFontSizeSliderOptions)
|
|
|
|
-- Add slider for change secondary header font size
|
|
local secondaryHeaderFontSizeSlider = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE),
|
|
"Velikost nadpisu",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE = value
|
|
CzechQuestsAddon:UpdateTranslationQuestFrameFontSettings()
|
|
end
|
|
)
|
|
local secondaryHeaderFontSizeSliderOptions = Settings.CreateSliderOptions(10, 30, 1)
|
|
secondaryHeaderFontSizeSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
|
Settings.CreateSlider(category, secondaryHeaderFontSizeSlider, secondaryHeaderFontSizeSliderOptions)
|
|
|
|
|
|
-- Add slider for change secondary header font size
|
|
local textFontSizeSlider = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE),
|
|
"Velikost textu",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE = value
|
|
CzechQuestsAddon:UpdateTranslationQuestFrameFontSettings()
|
|
end
|
|
)
|
|
local textFontSizeSliderOptions = Settings.CreateSliderOptions(10, 30, 1)
|
|
textFontSizeSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
|
Settings.CreateSlider(category, textFontSizeSlider, textFontSizeSliderOptions)
|
|
|
|
-- Add DARK mode checkbox
|
|
local darkModeCheckbox = Settings.RegisterAddOnSetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING",
|
|
"TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING",
|
|
CzechQuestsAddon_Store.config,
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING),
|
|
"Pruhlednost pouze pri chuzi *",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING
|
|
)
|
|
Settings.CreateCheckbox(category, darkModeCheckbox)
|
|
|
|
-- Add slider for change secondary header font size
|
|
local textureAlphaSlider = Settings.RegisterProxySetting(
|
|
category,
|
|
"CzechQuestsAddon__TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA",
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA),
|
|
"Pruhlednost pozadí",
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA,
|
|
function()
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA
|
|
end,
|
|
function(value)
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA = value
|
|
end
|
|
)
|
|
local textureAlphaSliderOptions = Settings.CreateSliderOptions(10, 100, 10)
|
|
textureAlphaSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
|
Settings.CreateSlider(category, textureAlphaSlider, textureAlphaSliderOptions)
|
|
|
|
end
|