From e9102c45187fb957f50a4bc30f59b69a14df61e7 Mon Sep 17 00:00:00 2001 From: Anonomit Date: Sun, 25 Sep 2022 01:57:29 -0400 Subject: [PATCH] Options polish --- Config.lua | 44 ++++++++++++++++++++++++++------------------ Init.lua | 1 + 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Config.lua b/Config.lua index c4ed58b..89253e5 100644 --- a/Config.lua +++ b/Config.lua @@ -450,32 +450,40 @@ function Addon:MakeAddonOptions() local opts = GUI:CreateGroupTop(title, "tab") do - local enabled = self:GetOption"enabled" - local invertMode = self:GetOption"invertMode" - local opts = GUI:CreateGroup(opts, 1, self.L["Enable"], "tab") - GUI:CreateToggle(opts, {"enabled"}, self.L["Enabled"]) - GUI:CreateDivider(opts, 2) - - local text = enabled and self.L["Disable"] or self.L["Enable"] - GUI:CreateSelect(opts, {"invertMode"}, text, desc, {none = self.L["never"], any = self.L["any"], all = self.L["all"]}, {"none", "any", "all"}).width = 0.7 - GUI:CreateNewline(opts) + do + local opts = GUI:CreateGroupBox(opts, ADDON_NAME) + + GUI:CreateToggle(opts, {"enabled"}, self.L["Enabled"]) + end - local disabled = invertMode == "none" - GUI:CreateToggle(opts, {"modKeys", "shift"}, self.L["SHIFT key"], nil, disabled).width = 0.8 - GUI:CreateToggle(opts, {"modKeys", "ctrl"} , self.L["CTRL key"] , nil, disabled).width = 0.8 - GUI:CreateToggle(opts, {"modKeys", "alt"} , self.L["ALT key"] , nil, disabled).width = 0.8 + do + local opts = GUI:CreateGroupBox(opts, self.L["Modifiers:"]) + + local text = self:GetOption"enabled" and self.L["Disable"] or self.L["Enable"] + GUI:CreateSelect(opts, {"invertMode"}, text, desc, {none = self.L["never"], any = self.L["any"], all = self.L["all"]}, {"none", "any", "all"}).width = 0.7 + GUI:CreateNewline(opts) + + local disabled = self:GetOption"invertMode" == "none" + GUI:CreateToggle(opts, {"modKeys", "shift"}, self.L["SHIFT key"], nil, disabled).width = 0.8 + GUI:CreateToggle(opts, {"modKeys", "ctrl"} , self.L["CTRL key"] , nil, disabled).width = 0.8 + GUI:CreateToggle(opts, {"modKeys", "alt"} , self.L["ALT key"] , nil, disabled).width = 0.8 + end end do local opts = GUI:CreateGroup(opts, 2, self.L["Features"], "tab") - GUI:CreateToggle(opts, {"allow", "reorder"}, L["Reorder"]) - GUI:CreateNewline(opts) - GUI:CreateToggle(opts, {"allow", "reword"} , self.L["Rename"]) - GUI:CreateNewline(opts) - GUI:CreateToggle(opts, {"allow", "recolor"}, L["Recolor"]) + do + local opts = GUI:CreateGroupBox(opts, self.L["Features"]) + + GUI:CreateToggle(opts, {"allow", "reorder"}, L["Reorder"]) + GUI:CreateNewline(opts) + GUI:CreateToggle(opts, {"allow", "reword"} , self.L["Rename"]) + GUI:CreateNewline(opts) + GUI:CreateToggle(opts, {"allow", "recolor"}, L["Recolor"]) + end end return opts diff --git a/Init.lua b/Init.lua index 5605da2..cf6128d 100644 --- a/Init.lua +++ b/Init.lua @@ -186,6 +186,7 @@ L["Enable"] = ENABLE L["Disable"] = DISABLE L["Enabled"] = VIDEO_OPTIONS_ENABLED -- L["Disabled"] = ADDON_DISABLED +L["Modifiers:"] = MODIFIERS_COLON L["never"] = strLower(CALENDAR_REPEAT_NEVER) L["any"] = strLower(SPELL_TARGET_TYPE1_DESC)