-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.lua
58 lines (45 loc) · 1.85 KB
/
settings.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
-- Neglected Gear Copyright 2017 [email protected]
local NeglectedGear = _G.NeglectedGear
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
function NeglectedGear:InitSettings()
NeglectedGearDB = {};
NeglectedGearCharDB = {};
NeglectedGearDB.major_version = NeglectedGear.major_version;
NeglectedGearDB.minor_version = NeglectedGear.minor_version;
NeglectedGearCharDB.major_version = NeglectedGear.major_version;
NeglectedGearCharDB.minor_version = NeglectedGear.minor_version;
NeglectedGearDB.debug = { [1] = false, [2] = false, [3] = false };
local options = {
type = 'group',
name = "Neglected Gear",
args = {
General = {
order = 1;
type = "group",
name = "General Settings",
desc = "General settings",
args = {
debug = {
order = 1,
type = "multiselect",
name = "Debug",
desc = "Enable different levels of debug",
values = { [1]="Level 1", [2]="Level 2", [3]="Level 3" },
get = function(info, index) return NeglectedGearDB.debug[index]; end,
set = function(info, index, val) NeglectedGearDB.debug[index] = val; end
},
}
}
}
};
LibStub("AceConfig-3.0"):RegisterOptionsTable("NeglectedGear", options);
AceConfigDialog:AddToBlizOptions("NeglectedGear", "Neglected Gear", nil, "General");
end
function NeglectedGear:UpdateSettings()
-- When we get a major version change, use this function
-- to update the settings structure if necessary.
NeglectedGearDB.major_version = NeglectedGear.major_version;
NeglectedGearDB.minor_version = NeglectedGear.minor_version;
NeglectedGearCharDB.major_version = NeglectedGear.major_version;
NeglectedGearCharDB.minor_version = NeglectedGear.minor_version;
end