-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
64 lines (61 loc) · 1.99 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
local addonName, addon = ...
local L = addon.L
local ldbi = LibStub('LibDBIcon-1.0', true)
local function build()
local t = {
name = "PerformanceMonitor",
handler = PerformanceMonitor,
type = 'group',
args = {
showFPS = {
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.showFPS,
desc = L.showFPSDescription,
},
showLatency = {
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.showLatency,
desc = L.showLatencyDescription,
},
showLatencyWorld = {
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.showLatencyWorld,
desc = L.showLatencyWorldDescription,
},
showMem = {
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.showMem,
desc = L.showMemDescription,
},
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,
},
}
}
-- return our new table
return t
end
LibStub("AceConfig-3.0"):RegisterOptionsTable("PerformanceMonitor", build, nil)
addon.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(addonName, "PerformanceMonitor")