diff --git a/Chattynator.toc b/Chattynator.toc index a9bf8ac..59a756b 100644 --- a/Chattynator.toc +++ b/Chattynator.toc @@ -62,3 +62,5 @@ CustomiseDialog/Initialize.lua CustomiseDialog/Main.lua CustomiseDialog/Filtering.lua CustomiseDialog/Components.lua + +Core/FinalRefresh.lua diff --git a/Core/Config.lua b/Core/Config.lua index 7623606..ec8ec7e 100644 --- a/Core/Config.lua +++ b/Core/Config.lua @@ -122,7 +122,10 @@ local settings = { APPLIED_MESSAGE_IDS = {key = "applied_message_ids", default = false, transfer = true}, APPLIED_PLAYER_TABLE = {key = "applied_player_table_5", default = false, transfer = true}, - CHAT_COLORS = {key = "chat_colors", default = {}, refresh = {addonTable.Constants.RefreshReason.MessageColor}} + CHAT_COLORS = {key = "chat_colors", default = {}, refresh = {addonTable.Constants.RefreshReason.MessageColor}}, + + TABSIZE_PADDING = {key = "tabsize_padding", default = 30}, + TABSIZE_SPACING = {key = "tabsize_spacing", default = 10} } addonTable.Config.RefreshType = {} diff --git a/Core/FinalRefresh.lua b/Core/FinalRefresh.lua new file mode 100644 index 0000000..63e015e --- /dev/null +++ b/Core/FinalRefresh.lua @@ -0,0 +1,11 @@ +---@class addonTableChattynator +local addonTable = select(2, ...) + +EventFrame_FinalRefresh = CreateFrame("Frame") +EventFrame_FinalRefresh:RegisterEvent("ADDON_LOADED") +EventFrame_FinalRefresh:SetScript("OnEvent", function(self, event) + addonTable.Constants.TabPadding = addonTable.Config.Get(addonTable.Config.Options.TABSIZE_PADDING) + addonTable.Constants.TabSpacing = addonTable.Config.Get(addonTable.Config.Options.TABSIZE_SPACING) + addonTable.CallbackRegistry:TriggerEvent("RefreshStateChange", {[addonTable.Constants.RefreshReason.Tabs] = true}) +EventFrame_FinalRefresh:UnregisterEvent("ADDON_LOADED") +end) diff --git a/CustomiseDialog/Main.lua b/CustomiseDialog/Main.lua index c3031ba..602d926 100644 --- a/CustomiseDialog/Main.lua +++ b/CustomiseDialog/Main.lua @@ -441,6 +441,26 @@ local function SetupDisplay(parent) end table.insert(allFrames, flashOnDropdown) + local tabsettingspadding + tabsettingspadding = addonTable.CustomiseDialog.Components.GetSlider(container, addonTable.Locales.TABSIZE_PADDING, 5, 30, "%s", function() + addonTable.Config.Set(addonTable.Config.Options.TABSIZE_PADDING, tabsettingspadding:GetValue()) + addonTable.Constants.TabPadding = tabsettingspadding:GetValue() + addonTable.CallbackRegistry:TriggerEvent("RefreshStateChange", {[addonTable.Constants.RefreshReason.Tabs] = true}) + end) + tabsettingspadding.option = addonTable.Config.Options.TABSIZE_PADDING + tabsettingspadding:SetPoint("TOP", allFrames[#allFrames], "BOTTOM") + table.insert(allFrames, tabsettingspadding) + + local tabsettingsspacing + tabsettingsspacing = addonTable.CustomiseDialog.Components.GetSlider(container, addonTable.Locales.TABSIZE_SPACING, 1, 20, "%s", function() + addonTable.Config.Set(addonTable.Config.Options.TABSIZE_SPACING, tabsettingsspacing:GetValue()) + addonTable.Constants.TabSpacing = tabsettingsspacing:GetValue() + addonTable.CallbackRegistry:TriggerEvent("RefreshStateChange", {[addonTable.Constants.RefreshReason.Tabs] = true}) + end) + tabsettingsspacing.option = addonTable.Config.Options.TABSIZE_SPACING + tabsettingsspacing:SetPoint("TOP", allFrames[#allFrames], "BOTTOM") + table.insert(allFrames, tabsettingsspacing) + container:SetScript("OnShow", function() local LibSharedMedia = LibStub and LibStub:GetLibrary("LibSharedMedia-3.0", true) local fontValues, fontLabels = {}, {} diff --git a/Locales.lua b/Locales.lua index 2ed8f43..c0c87de 100644 --- a/Locales.lua +++ b/Locales.lua @@ -174,6 +174,9 @@ L["SLASH_RESET_HELP"] = "Reset all Chattynator settings, then reload." L["SLASH_HELP"] = "Open the Chattynator settings." L["SLASH_UNKNOWN_COMMAND"] = "Unknown command '%s'" +L["TABSIZE_PADDING"] = "Tab Padding" +L["TABSIZE_SPACING"] = "Tab Spacing" + local L = Locales.frFR --@localization(locale="frFR", format="lua_additive_table")@