-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.lua
82 lines (81 loc) · 3.65 KB
/
Config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
local addonName, addon = ...
function addon:GetOptions()
self.options = self.options or {
type = "group",
args = {
general_settings = {
name = "General options",
type = "group",
args = {
minimap = {
order = 1,
name = "Minimap Icon",
desc = "Display a button next to the minimap.",
type = "toggle",
width = "full",
set = function(info, value)
self.db.global.minimap.hide = not value
if value then
self.icon:Show(addonName)
else
self.icon:Hide(addonName)
end
end,
get = function(info)
return not self.db.global.minimap.hide
end,
},
auto_save = {
order = 2,
name = "Auto save keybinds on change",
desc = "If enabled (default), automatically saves your keybinds to the active profile when you make changes, manual saving is not required. If disabled, no keybind changes will be saved until you manually save your keybinds (either with the /kbp command or the 'save keybinds' button)",
type = "toggle",
width = "full",
confirm = function(info, value)
if value then
self.db.global.auto_save.enabled = true
return "This setting is applied only after reloading your UI. Do you want to reload UI now?"
else
self.db.global.auto_save.enabled = false
return "This setting is applied only after reloading your UI. Do you want to reload UI now?"
end
end,
set = function(info, value)
ReloadUI();
end,
get = function(info)
return self.db.global.auto_save.enabled
end,
},
save_profile = {
order = 3,
name = "Save current profile",
desc = "Manually saves your keybinds to the active profile. Not required when 'Auto save keybinds on change' is enabled.",
type = "execute",
width = "normal",
func = function()
self:Print("Profile saved")
self:SaveProfile()
end,
},
whitespace = {
order = 4,
name = " ",
type = "description",
width = "full",
fontSize = "large"
},
help_commands = {
order = 5,
name = "Type '/kbp help' for a list of commands",
type = "description",
width = "full",
fontSize = "large"
}
},
},
profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db),
},
}
return self.options
end