2025-03-01 21:46:55 +01:00
|
|
|
function CzechQuestsAddon:AddSpeechOptions(category, layout)
|
2025-02-26 02:05:52 +01:00
|
|
|
|
2025-03-01 21:46:55 +01:00
|
|
|
-- Enable translations
|
|
|
|
local enableCheckbox = Settings.RegisterAddOnSetting(
|
|
|
|
category,
|
|
|
|
"CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_ENABLED",
|
|
|
|
"TRANSLATION_SPEECH_FRAME_ENABLED",
|
|
|
|
CzechQuestsAddon_Store.config,
|
|
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED),
|
|
|
|
"Zapnout *",
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED
|
2025-02-26 02:05:52 +01:00
|
|
|
)
|
2025-03-01 21:46:55 +01:00
|
|
|
Settings.CreateCheckbox(category, enableCheckbox)
|
2025-02-26 02:05:52 +01:00
|
|
|
|
|
|
|
-- Add text font dropdown menu
|
|
|
|
local textFontFamilyDropdown = Settings.RegisterProxySetting(
|
2025-03-01 21:46:55 +01:00
|
|
|
category,
|
2025-02-26 02:05:52 +01:00
|
|
|
"CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY",
|
|
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY),
|
2025-03-01 21:46:55 +01:00
|
|
|
"Písmo textu *",
|
2025-02-26 02:05:52 +01:00
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY,
|
|
|
|
function()
|
|
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY
|
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY = value
|
|
|
|
end
|
|
|
|
)
|
2025-03-01 21:46:55 +01:00
|
|
|
Settings.CreateDropdown(category, textFontFamilyDropdown, GetFontOptions)
|
2025-02-26 02:05:52 +01:00
|
|
|
|
|
|
|
-- Add slider for change secondary header font size
|
|
|
|
local textFontSizeSlider = Settings.RegisterProxySetting(
|
2025-03-01 21:46:55 +01:00
|
|
|
category,
|
2025-02-26 02:05:52 +01:00
|
|
|
"CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE",
|
|
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE),
|
2025-03-01 21:46:55 +01:00
|
|
|
"Velikost textu *",
|
2025-02-26 02:05:52 +01:00
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE,
|
|
|
|
function()
|
|
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE
|
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE = value
|
|
|
|
end
|
|
|
|
)
|
|
|
|
local textFontSizeSliderOptions = Settings.CreateSliderOptions(8, 30, 1)
|
|
|
|
textFontSizeSliderOptions:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
2025-03-01 21:46:55 +01:00
|
|
|
Settings.CreateSlider(category, textFontSizeSlider, textFontSizeSliderOptions)
|
2025-02-26 02:05:52 +01:00
|
|
|
|
2025-03-01 21:46:55 +01:00
|
|
|
-- Add slider for change frame width
|
2025-02-26 02:05:52 +01:00
|
|
|
local windowWidthSizeSlider = Settings.RegisterProxySetting(
|
2025-03-01 21:46:55 +01:00
|
|
|
category,
|
2025-02-26 02:05:52 +01:00
|
|
|
"CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_WIDTH",
|
|
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH),
|
2025-03-04 07:49:19 +01:00
|
|
|
"Šírka okna",
|
2025-02-26 02:05:52 +01:00
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH,
|
|
|
|
function()
|
|
|
|
return CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH
|
|
|
|
end,
|
|
|
|
function(value)
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH = value
|
2025-03-01 21:46:55 +01:00
|
|
|
CzechQuestsAddon.translationSpeechFrame:SetWidth(
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH
|
|
|
|
)
|
|
|
|
CzechQuestsAddon.translationSpeechFrame.content:SetWidth(
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH
|
|
|
|
)
|
2025-02-26 02:05:52 +01:00
|
|
|
end
|
|
|
|
)
|
2025-03-04 07:49:19 +01:00
|
|
|
local windowWidthSizeSliderOption = Settings.CreateSliderOptions(200, 1000, 10)
|
2025-02-26 02:05:52 +01:00
|
|
|
windowWidthSizeSliderOption:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right);
|
2025-03-01 21:46:55 +01:00
|
|
|
Settings.CreateSlider(category, windowWidthSizeSlider, windowWidthSizeSliderOption)
|
|
|
|
|
2025-03-04 07:49:19 +01:00
|
|
|
-- Show original
|
|
|
|
local originalWhenMissingCheckbox = Settings.RegisterAddOnSetting(
|
|
|
|
category,
|
|
|
|
"CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_ORIGINAL_WHEN_MISSING",
|
|
|
|
"TRANSLATION_SPEECH_FRAME_ORIGINAL_WHEN_MISSING",
|
|
|
|
CzechQuestsAddon_Store.config,
|
|
|
|
type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ORIGINAL_WHEN_MISSING),
|
|
|
|
"Original pokud není preklad",
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ORIGINAL_WHEN_MISSING
|
|
|
|
)
|
|
|
|
Settings.CreateCheckbox(category, originalWhenMissingCheckbox)
|
|
|
|
|
2025-03-01 21:46:55 +01:00
|
|
|
local initializer= CreateSettingsButtonInitializer(
|
|
|
|
'Resetovat pozici okna',
|
|
|
|
'RESET',
|
|
|
|
function()
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION = { x = 0, y = 0}
|
|
|
|
CzechQuestsAddon.translationSpeechFrame:SetPoint(
|
2025-03-04 07:49:19 +01:00
|
|
|
"TOPLEFT", UIParent, "TOPLEFT",
|
2025-03-01 21:46:55 +01:00
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION.x,
|
|
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION.y
|
|
|
|
)
|
|
|
|
end,
|
|
|
|
nil,
|
|
|
|
"Resetovat pozici okna"
|
|
|
|
)
|
|
|
|
layout:AddInitializer(initializer)
|
2025-02-26 02:05:52 +01:00
|
|
|
|
|
|
|
end
|