Skip to content

Commit

Permalink
Options polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Sep 25, 2022
1 parent eaafa86 commit e9102c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
44 changes: 26 additions & 18 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e9102c4

Please sign in to comment.