9bc8361 - Fix bugs found in testing
[wowui.git] / OmaRFConfig / IndicatorsConfig.lua
index 8561f21..0867cdc 100644 (file)
@@ -20,11 +20,12 @@ local function createOptionsTable(self)
     for _, pos in ipairs(self.positions) do
         options.args[pos] = {
             type = "group",
     for _, pos in ipairs(self.positions) do
         options.args[pos] = {
             type = "group",
+            name = pos,
             get = function(item)
             get = function(item)
-                return self.db.profile[pos][item[#item]];
+                return self.db.profile.indicators[pos][item[#item]];
             end,
             set = function(item, value)
             end,
             set = function(item, value)
-                self.db.profile[pos][item[#item]] = value;
+                self.db.profile.indicators[pos][item[#item]] = value;
                 self:RefreshConfig();
             end,
             args = {
                 self:RefreshConfig();
             end,
             args = {
@@ -34,7 +35,7 @@ local function createOptionsTable(self)
                     multiline = true,
                     width = "full",
                     get = function(item)
                     multiline = true,
                     width = "full",
                     get = function(item)
-                        return table.concat(self.db.profile[pos]["auras"], "\n");
+                        return table.concat(self.db.profile.indicators[pos]["auras"], "\n");
                     end,
                     set = function(item, value)
                         local t = {};
                     end,
                     set = function(item, value)
                         local t = {};
@@ -46,7 +47,7 @@ local function createOptionsTable(self)
                                 table.insert(t, aura);
                             end
                         end
                                 table.insert(t, aura);
                             end
                         end
-                        self.db.profile[pos]["auras"] = t;
+                        self.db.profile.indicators[pos]["auras"] = t;
                         self:RefreshConfig();
                     end,
                 },
                         self:RefreshConfig();
                     end,
                 },
@@ -70,10 +71,10 @@ local function createOptionsTable(self)
                     type = "color",
                     name = "Text color",
                     get = function(item)
                     type = "color",
                     name = "Text color",
                     get = function(item)
-                        return unpack(self.db.profile[pos]["textColor"]);
+                        return unpack(self.db.profile.indicators[pos]["textColor"]);
                     end,
                     set = function(item, r, g, b, a)
                     end,
                     set = function(item, r, g, b, a)
-                        self.db.profile[pos]["textColor"] = {r, g, b, a};
+                        self.db.profile.indicators[pos]["textColor"] = {r, g, b, a};
                         self:RefreshConfig();
                     end,
                 },
                         self:RefreshConfig();
                     end,
                 },
@@ -88,7 +89,7 @@ local function createOptionsTable(self)
                 useDefaultIcon = {
                     type = "toggle",
                     name = "Use default icon",
                 useDefaultIcon = {
                     type = "toggle",
                     name = "Use default icon",
-                    disabled = function() return not self.db.profile[pos]["showIcon"] end,
+                    disabled = function() return not self.db.profile.indicators[pos]["showIcon"] end,
                 },
                 iconSize = {
                     type = "range",
                 },
                 iconSize = {
                     type = "range",
@@ -102,10 +103,10 @@ local function createOptionsTable(self)
                     type = "color",
                     name = "Icon tint",
                     get = function(item)
                     type = "color",
                     name = "Icon tint",
                     get = function(item)
-                        return unpack(self.db.profile[pos]["iconColor"]);
+                        return unpack(self.db.profile.indicators[pos]["iconColor"]);
                     end,
                     set = function(item, r, g, b, a)
                     end,
                     set = function(item, r, g, b, a)
-                        self.db.profile[pos]["iconColor"] = {r, g, b, a};
+                        self.db.profile.indicators[pos]["iconColor"] = {r, g, b, a};
                         self:RefreshConfig();
                     end,
                 },
                         self:RefreshConfig();
                     end,
                 },