changeset 57:4d359ee4649c

enable config option/gui for consolidated buff option
author Chris Mellon <arkanes@gmail.com>
date Wed, 13 Jul 2011 22:25:52 -0500
parents 4403bc0ec643
children a332676ec5f4
files .pkgmeta KBF.lua KBF.toc config.lua embeds.xml
diffstat 5 files changed, 30 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.pkgmeta	Wed Jul 13 21:49:55 2011 -0500
+++ b/.pkgmeta	Wed Jul 13 22:25:52 2011 -0500
@@ -20,6 +20,8 @@
   url: svn://svn.wowace.com/wow/libgratuity-3-0/mainline/trunk
  libs/AceGUI-3.0: 
   url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceGUI-3.0
+ libs/AceConfigDialog-3.0:
+  url: svn://svn.wowace.com/wow/ace3/mainline/trunk/AceConfigDialog-3.0
 
 ignore:
   - .pkgmeta
--- a/KBF.lua	Wed Jul 13 21:49:55 2011 -0500
+++ b/KBF.lua	Wed Jul 13 22:25:52 2011 -0500
@@ -15,6 +15,8 @@
     self:RegisterEvent("UNIT_AURA")
     self:RegisterEvent("UNIT_ENTERING_VEHICLE", "PollForVehicleChange")
     self:RegisterEvent("UNIT_EXITING_VEHICLE", "PollForVehicleChange")
+    LibStub("AceConfig-3.0"):RegisterOptionsTable("KBF", self.options);
+    self.profilesFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("KBF", "KBF");
     self:RegisterChatCommand("kbf", "ToggleAnchor")
     
     self.oocQueue = {}
--- a/KBF.toc	Wed Jul 13 21:49:55 2011 -0500
+++ b/KBF.toc	Wed Jul 13 22:25:52 2011 -0500
@@ -3,7 +3,7 @@
 ## Notes: Cata-compatible buff frames
 ## Author: Kaylen
 ## OptionalDeps: Ace3, LibGratuity-3.0, LibStub, AceEvent-3.0, AceConsole-3.0
-## SavedVars: KBFSavedVars
+## SavedVariables: KBFSavedVars
 
 config.lua
 embeds.xml
--- a/config.lua	Wed Jul 13 21:49:55 2011 -0500
+++ b/config.lua	Wed Jul 13 22:25:52 2011 -0500
@@ -11,4 +11,25 @@
 	profile = {
 		["consolidateBuffs"] = true,
 	}
-}
\ No newline at end of file
+}
+
+-- AceConfig options table
+kbf.options = {
+	type="group",
+	args={
+		consolidateBuffs = {
+			name="Consolidate Buffs",
+			desc="Enable or disable the consolidated buff collapsing",
+			type="toggle",
+			set=function(info, val) kbf:setConsolidatedBuffs(info, val) end,
+			get=function(info) return kbf.db.profile.consolidateBuffs end
+		}
+	}
+}
+
+function kbf:setConsolidatedBuffs(info, val)
+	self.db.profile.consolidateBuffs = val
+	local attr = val and "99" or nil
+	self.secureHeader:SetAttribute("consolidateTo", attr)
+	self.dirty = true -- need a rescan
+end
\ No newline at end of file
--- a/embeds.xml	Wed Jul 13 21:49:55 2011 -0500
+++ b/embeds.xml	Wed Jul 13 22:25:52 2011 -0500
@@ -7,8 +7,9 @@
 <Include file="libs\AceEvent-3.0\AceEvent-3.0.xml" />
 <Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
 <Include file="libs\AceGUI-3.0\AceGUI-3.0.xml"/>
-<Include file="Libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
-<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
+<Include file="libs\AceDBOptions-3.0\AceDBOptions-3.0.xml"/>
+<Include file="libs\AceConfig-3.0\AceConfig-3.0.xml"/>
+<Include file="libs\AceConfigDialog-3.0\AceConfigDialog-3.0.xml" />
 <Include file="libs\AceConsole-3.0\AceConsole-3.0.xml" />
 <Include file="libs\LibGratuity-3.0\lib.xml" />
 <!--@end-no-lib-strip@-->