-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfig.lua
117 lines (112 loc) · 4.01 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
local core = LibStub("AceAddon-3.0"):GetAddon("SilverDragon")
local module = core:NewModule("Config", "AceConsole-3.0")
local function toggle(name, desc, order, inline, disabled)
return {
type = "toggle",
name = name,
desc = desc,
order = order,
descStyle = (inline or (inline == nil)) and "inline" or nil,
width = (inline or (inline == nil)) and "full" or nil,
disabled = disabled,
}
end
module.toggle = toggle
local function desc(text, order)
return {
type = "description",
name = text,
order = order,
fontSize = "medium",
}
end
module.desc = desc
local options = {
type = "group",
name = "SilverDragon",
get = function(info) return core.db.profile[info[#info]] end,
set = function(info, v) core.db.profile[info[#info]] = v end,
args = {
about = {
type = "group",
name = "About",
args = {
about = desc("SilverDragon keeps an eye out for rare mobs for you.\n\n"..
"If you want to change how it does that, go to the \"Scanning\" section "..
"of the config. You can enable or disable the different methods used, and "..
"adjust how some of them behave.\n\n"..
"If you want to adjust the way the targeting popup appears, go to the \"ClickTarget\" "..
"section.\n\n"..
"If you want to change how you're told about seeing a rare, check out the "..
"\"Outputs\" section.\n\n"..
"If you want to add a custom mob to scan for, look at \"Custom\" in the \"Mobs\" "..
"section.\n\n"..
"If you want SilverDragon to please, please stop telling you about a certain "..
"mob, look at \"Ignore\" in the \"Mobs\" section."),
},
order = 0,
},
general = {
type = "group",
name = "General",
order = 10,
args = {
about = desc("SilverDragon wants to tell you things. Check out the sub-sections here to adjust how it does that.", 0),
loot = {
type = "group",
name = "Loot",
inline = true,
order = 5,
args = {
about = desc("Some options for how SilverDragon will treat loot drops from mobs", 0),
charloot = toggle("Current character only", "Only show loot that should drop for your current character.", 10),
transmog_specific = toggle("Transmog exact items", "For transmog appearances, only count them as known if you know them from that exact item, rather than from another sharing the same appearance", 20),
}
},
},
plugins = {},
},
scanning = {
type = "group",
name = "Scanning",
order = 20,
args = {
about = desc("SilverDragon is all about scanning for rare mobs. The options you see in this tab apply generally to all the scanning methods used. For more specific controls, check out the sub-sections.", 0),
scan = {
type = "range",
name = "Scan interval",
desc = "How often to scan for nearby rares, in seconds (0 disables scanning)",
min = 0, max = 10, step = 0.1,
order = 10,
},
delay = {
type = "range",
name = "Recording delay",
desc = "How long to wait before recording the same rare again",
min = 30, max = (60 * 60), step = 10,
order = 20,
},
instances = toggle("Scan in instances", "There aren't that many actual rares in instances, and scanning might slow things down at a time when you'd like the most performance possible.", 50),
taxi = toggle("Scan on taxis", "Keep scanning for rares while flying on a taxi or in a dragon race. Just hope that it'll still be there after you land and make your way back...", 55),
},
plugins = {},
},
},
plugins = {
},
}
module.options = options
function module:OnInitialize()
options.plugins["profiles"] = {
profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(core.db)
}
options.plugins.profiles.profiles.order = -1 -- last!
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("SilverDragon", function()
core.events:Fire("OptionsRequested", options)
return options
end)
LibStub("AceConfigDialog-3.0"):AddToBlizOptions("SilverDragon", "SilverDragon")
end
function module:ShowConfig(...)
LibStub("AceConfigDialog-3.0"):Open("SilverDragon", ...)
end