comparison AfterOptions.lua @ 1:f601b8507480

AfterDark - Initial Import
author wobin
date Sun, 20 Dec 2009 21:45:17 +1100
parents
children
comparison
equal deleted inserted replaced
0:1bfd89cb7f44 1:f601b8507480
1 local AddonName, AfterDark = ...
2 local AceDialog
3 local L = AfterDark.L
4
5 local function loadToasterOptions()
6 options.args.general = {
7 order = 1,
8 type = "group",
9 name = L["General"],
10 set = function(info, value) AfterDark.db.profile[info[#info]] = value end,
11 get = function(info) return AfterDark.db.profile[info[#info]] end,
12 args = {
13 Darkness = {
14 order = 1,
15 type = "range",
16 name = L["Darkness"],
17 desc = L["How well done you want your toast"],
18 min = 0, max = 1,
19 },
20 Music = {
21 order = 2,
22 type = "select",
23 name = L["Music"],
24 values = { ["Anthem"] = L["Anthem of the Flying Toasters"], ["Ride"] = L["Ride of the Valkyries"], ["zRandom"] = L["Both"] },
25 style = "dropdown",
26 width = "double"
27 },
28 Busy = {
29 order = 3,
30 type = "range",
31 name = L["Busy"],
32 desc = L["How busy do you want it?"],
33 min = 10, max = 120, step = 1,
34 width = "full"
35 },
36 Speed = {
37 order = 4,
38 type = "range",
39 name = L["Speed"],
40 desc = L["Do you feel... the Need for Speed?"],
41 min = 1, max = 30, step = 1,
42 width = "full"
43 }
44 }
45 }
46 end
47
48 local function loadOptions()
49 options = {
50 type = "group",
51 name = "After Dark",
52 childGroups = "tab",
53 args = {}
54 }
55 loadToasterOptions()
56 end
57
58
59 SLASH_AFTERDARK1 = "/afterdark"
60 SLASH_AFTERDARK2 = "/ad"
61
62 SlashCmdList["AFTERDARK"] = function(msg)
63 InterfaceOptionsFrame_OpenToCategory(AfterDark.Config)
64 end
65
66 function AfterDark:SetupOptions()
67 if not AceDialog then
68 loadOptions()
69
70 AceDialog = LibStub("AceConfigDialog-3.0")
71 LibStub("AceConfig-3.0"):RegisterOptionsTable("AfterDark", options)
72 AfterDark.Config = AceDialog:AddToBlizOptions("AfterDark", "After Dark", nil, 'general')
73 end
74 end