-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
71 lines (69 loc) · 2.24 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
local addonName, addon = ...
local L = addon.L
local ldbi = LibStub('LibDBIcon-1.0', true)
local function build()
local t = {
name = "Broken",
handler = Broken,
type = 'group',
args = {
showMinimapIcon = {
type = 'toggle',
name = L.showMinimapIcon,
desc = L.showMinimapIconDescription,
order = 0,
get = function(info) return not addon.db.minimap.hide end,
set = function(info, value)
local config = addon.db.minimap
config.hide = not value
addon:setDB("minimap", config)
ldbi:Refresh(addonName)
end,
},
showValues = {
type = 'toggle',
order = 1,
get = function(info) return addon.db[info[#info]] end,
set = function(info, value) return addon:setDB(info[#info], value) end,
name = L.showValues,
desc = L.showValuesDescription,
},
showValuesAlways = {
type = 'toggle',
order = 1,
get = function(info) return addon.db[info[#info]] end,
set = function(info, value) return addon:setDB(info[#info], value) end,
name = L.showValuesAlways,
desc = L.showValuesAlwaysDescription,
},
showPercent = {
type = 'toggle',
order = 1,
get = function(info) return addon.db[info[#info]] end,
set = function(info, value) return addon:setDB(info[#info], value) end,
name = L.showPercent,
desc = L.showPercentDescription,
},
showCost = {
type = 'toggle',
order = 1,
get = function(info) return addon.db[info[#info]] end,
set = function(info, value) return addon:setDB(info[#info], value) end,
name = L.showCost,
desc = L.showCostDescription,
},
showCostAlways = {
type = 'toggle',
order = 1,
get = function(info) return addon.db[info[#info]] end,
set = function(info, value) return addon:setDB(info[#info], value) end,
name = L.showCostAlways,
desc = L.showCostAlwaysDescription,
},
}
}
-- return our new table
return t
end
LibStub("AceConfig-3.0"):RegisterOptionsTable("Broken", build, nil)
addon.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(addonName, "Broken")