Quantcast

corrected bad colorpickers in the config menu

Steven Jackson [07-09-14 - 15:46]
corrected bad colorpickers in the config menu
Filename
Interface/AddOns/SVUI/system/classes/Database.lua
Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua
diff --git a/Interface/AddOns/SVUI/system/classes/Database.lua b/Interface/AddOns/SVUI/system/classes/Database.lua
index 5317b11..376dbdd 100644
--- a/Interface/AddOns/SVUI/system/classes/Database.lua
+++ b/Interface/AddOns/SVUI/system/classes/Database.lua
@@ -240,7 +240,7 @@ local DatabaseDefaults = {
 		},
 		["colors"] = {
 			["default"] 	 = {0.2, 0.2, 0.2, 1},
-			["special"] 	 = {.37, .32, .29, 1},
+			["special"] 	 = {0.37, 0.32, 0.29, 1},
 		},
 		["unitframes"] = {
 			["health"] 		 = {0.3, 0.5, 0.3},
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
index 7742c2e..bb70766 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
@@ -549,28 +549,36 @@ SuperVillain.Options.args.common = {
 							type = "group",
 							name = L["Colors"],
 							guiInline = true,
-							get = function(key)
-								local color = SuperVillain.db.media.colors[key[#key]]
-								return color[1],color[2],color[3],color[4]
-							end,
-							set = function(key, rValue, gValue, bValue, aValue)
-								SuperVillain.db.media.colors[key[#key]] = {rValue, gValue, bValue, aValue}
-								SuperVillain:MediaUpdate()
-							end,
 							args = {
 								default = {
 									type = "color",
 									order = 1,
 									name = L["Default Color"],
 									desc = L["Main color used by most UI elements. (ex: Backdrop Color)"],
-									hasAlpha = false
+									hasAlpha = true,
+									get = function(key)
+										local color = SuperVillain.db.media.colors.default
+										return color[1],color[2],color[3],color[4]
+									end,
+									set = function(key, rValue, gValue, bValue, aValue)
+										SuperVillain.db.media.colors.default = {rValue, gValue, bValue, aValue}
+										SuperVillain:MediaUpdate()
+									end,
 								},
 								special = {
 									type = "color",
 									order = 2,
 									name = L["Accent Color"],
 									desc = L["Color used in various frame accents.  (ex: Dressing Room Backdrop Color)"],
-									hasAlpha = true
+									hasAlpha = true,
+									get = function(key)
+										local color = SuperVillain.db.media.colors.special
+										return color[1],color[2],color[3],color[4]
+									end,
+									set = function(key, rValue, gValue, bValue, aValue)
+										SuperVillain.db.media.colors.special = {rValue, gValue, bValue, aValue}
+										SuperVillain:MediaUpdate()
+									end,
 								},
 								resetbutton = {
 									type = "execute",
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua
index 90f0d6d..20cc413 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua
@@ -1659,7 +1659,7 @@ SuperVillain.Options.args.SVUnit = {
 									order = 1,
 									type = "toggle",
 									name = L["Class Health"],
-									desc = L["Color health by classcolor or reaction."],
+									desc = L["Color health by classcolor or reaction."],
 									get = function(key)
 										return SuperVillain.db.SVUnit[key[#key]]
 									end,
@@ -1725,11 +1725,11 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									name = L["Health"],
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["health"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.health
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["health"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.health = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1738,26 +1738,26 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									name = L["Tapped"],
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["tapped"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.tapped
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["tapped"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.tapped = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								},
 								disconnected = {
 									order = 9,
 									type = "color",
 									name = L["Disconnected"],
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["disconnected"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.disconnected
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["disconnected"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.disconnected = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								}
 							}
 						},
@@ -1786,10 +1786,10 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.power["MANA"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.power["MANA"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.power["MANA"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1799,12 +1799,12 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.power["RAGE"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.power["RAGE"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.power["RAGE"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								},
 								FOCUS = {
 									order = 4,
@@ -1812,12 +1812,12 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.power["FOCUS"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.power["FOCUS"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.power["FOCUS"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								},
 								ENERGY = {
 									order = 5,
@@ -1825,12 +1825,12 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.power["ENERGY"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.power["ENERGY"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.power["ENERGY"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								},
 								RUNIC_POWER = {
 									order = 6,
@@ -1838,12 +1838,12 @@ SuperVillain.Options.args.SVUnit = {
 									type = "color",
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.power["RUNIC_POWER"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.power["RUNIC_POWER"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.power["RUNIC_POWER"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
-									end,
+									end,
 								}
 							}
 						},
@@ -1871,11 +1871,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = L["Interruptable"],
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["casting"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.casting
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["casting"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.casting = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1884,11 +1884,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = "Spark Color",
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["spark"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.spark
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["spark"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.spark = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1897,11 +1897,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = L["Non-Interruptable"],
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["interrupt"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.interrupt
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["interrupt"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.interrupt = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								}
@@ -1944,11 +1944,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = L["Buffs"],
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["buff_bars"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.buff_bars
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["buff_bars"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.buff_bars = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1957,11 +1957,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = L["Debuffs"],
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["debuff_bars"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.debuff_bars
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["debuff_bars"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.debuff_bars = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -1970,11 +1970,11 @@ SuperVillain.Options.args.SVUnit = {
 									name = L["Shield Buffs Color"],
 									type = "color",
 									get = function(key)
-										local color = SuperVillain.db.media.unitframes["shield_bars"]
-										return color.r, color.g, color.b, color.a
-									end,
+										local color = SuperVillain.db.media.unitframes.shield_bars
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes["shield_bars"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.shield_bars = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								}
@@ -1992,10 +1992,10 @@ SuperVillain.Options.args.SVUnit = {
 									hasAlpha = true,
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.predict["personal"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.predict["personal"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.predict["personal"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -2006,10 +2006,10 @@ SuperVillain.Options.args.SVUnit = {
 									hasAlpha = true,
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.predict["others"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.predict["others"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.predict["others"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								},
@@ -2020,10 +2020,10 @@ SuperVillain.Options.args.SVUnit = {
 									hasAlpha = true,
 									get = function(key)
 										local color = SuperVillain.db.media.unitframes.predict["absorbs"]
-										return color.r, color.g, color.b, color.a
-									end,
+										return color[1],color[2],color[3]
+									end,
 									set = function(key, rValue, gValue, bValue)
-										SuperVillain.db.media.unitframes.predict["absorbs"] = {r = rValue, g = gValue, b = bValue}
+										SuperVillain.db.media.unitframes.predict["absorbs"] = {rValue, gValue, bValue}
 										MOD:RefreshUnitFrames()
 									end,
 								}
@@ -2034,34 +2034,4 @@ SuperVillain.Options.args.SVUnit = {
 			}
 		}
 	}
-}
-
---[[
-
-commonGroup = {
-					order = 1,
-					type = "group",
-					name = L["General Settings"],
-					args = {
-						baseGroup = {
-							order = 1,
-							type = "group",
-							guiInline = true,
-							name = L["Base Settings"],
-							args = {
-
-							}
-						},
-						sizeGroup = {
-							order = 2,
-							guiInline = true,
-							type = "group",
-							name = L["Size Settings"],
-							args = {
-
-							}
-						},
-					}
-				},
-
-]]
\ No newline at end of file
+}
\ No newline at end of file