diff AfterOptions.lua @ 1:f601b8507480

AfterDark - Initial Import
author wobin
date Sun, 20 Dec 2009 21:45:17 +1100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AfterOptions.lua	Sun Dec 20 21:45:17 2009 +1100
@@ -0,0 +1,74 @@
+local AddonName, AfterDark = ...
+local AceDialog 
+local L = AfterDark.L
+
+local function loadToasterOptions()
+	options.args.general = {
+		order = 1,
+		type = "group",
+		name = L["General"],
+		set = function(info, value) AfterDark.db.profile[info[#info]] = value end,
+		get = function(info) return AfterDark.db.profile[info[#info]] end,
+		args = {
+					Darkness = {
+						order = 1,
+						type = "range",
+						name = L["Darkness"],
+						desc = L["How well done you want your toast"],
+						min = 0, max = 1,
+					},
+					Music = {
+						order = 2,
+						type = "select",
+						name = L["Music"],
+						values = { ["Anthem"] = L["Anthem of the Flying Toasters"], ["Ride"]  = L["Ride of the Valkyries"], ["zRandom"] = L["Both"] },
+						style = "dropdown",
+						width = "double"
+					},
+					Busy = {
+						order = 3,
+						type = "range",
+						name = L["Busy"],
+						desc = L["How busy do you want it?"],
+						min = 10, max = 120, step = 1,
+						width = "full"
+					},
+					Speed = {
+						order = 4,
+						type = "range",
+						name = L["Speed"],
+						desc = L["Do you feel... the Need for Speed?"],
+						min = 1, max = 30, step = 1,
+						width = "full"
+					}
+				}
+			}
+end
+
+local function loadOptions()
+	options = {
+		type = "group",
+		name = "After Dark",
+		childGroups = "tab",
+		args = {}
+	}
+	loadToasterOptions()
+end
+
+
+SLASH_AFTERDARK1 = "/afterdark"
+SLASH_AFTERDARK2 = "/ad"
+
+SlashCmdList["AFTERDARK"] = function(msg)
+	InterfaceOptionsFrame_OpenToCategory(AfterDark.Config)
+end
+
+function AfterDark:SetupOptions()
+	if not AceDialog then
+		loadOptions()
+
+		AceDialog = LibStub("AceConfigDialog-3.0")
+		LibStub("AceConfig-3.0"):RegisterOptionsTable("AfterDark", options)
+		AfterDark.Config = AceDialog:AddToBlizOptions("AfterDark", "After Dark", nil, 'general') 
+	end
+end