function CzechQuestsAddon:AddSpeechOptions(category, layout) -- 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 ) Settings.CreateCheckbox(category, enableCheckbox) -- Add text font dropdown menu local textFontFamilyDropdown = Settings.RegisterProxySetting( category, "CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY", type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY), "Písmo textu *", 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 ) Settings.CreateDropdown(category, textFontFamilyDropdown, GetFontOptions) -- Add slider for change secondary header font size local textFontSizeSlider = Settings.RegisterProxySetting( category, "CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE", type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE), "Velikost textu *", 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); Settings.CreateSlider(category, textFontSizeSlider, textFontSizeSliderOptions) -- Add slider for change frame width local windowWidthSizeSlider = Settings.RegisterProxySetting( category, "CzechQuestsAddon__TRANSLATION_SPEECH_FRAME_WIDTH", type(CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH), "Šírka zprávy", 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 CzechQuestsAddon.translationSpeechFrame:SetWidth( CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH ) CzechQuestsAddon.translationSpeechFrame.content:SetWidth( CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH ) end ) local windowWidthSizeSliderOption = Settings.CreateSliderOptions(200, 800, 10) windowWidthSizeSliderOption:SetLabelFormatter(MinimalSliderWithSteppersMixin.Label.Right); Settings.CreateSlider(category, windowWidthSizeSlider, windowWidthSizeSliderOption) local initializer= CreateSettingsButtonInitializer( 'Resetovat pozici okna', 'RESET', function() CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION = { x = 0, y = 0} CzechQuestsAddon.translationSpeechFrame:ClearAllPoints() CzechQuestsAddon.translationSpeechFrame:SetPoint( "CENTER", UIParent, "CENTER", CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION.x, CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION.y ) end, nil, "Resetovat pozici okna" ) layout:AddInitializer(initializer) end