d288be9 - Add icon tinting
authorAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 28 Dec 2017 16:54:32 +0000
committerAleksi Blinnikka <aleksi.blinnikka@gmail.com>
Thu, 28 Dec 2017 16:54:32 +0000
Core.lua
Indicators.lua
IndicatorsConfig.lua

index ad8d6b3..cb4134f 100644 (file)
--- a/Core.lua
+++ b/Core.lua
@@ -18,13 +18,14 @@ local defaults = {
         indicators = {
             ['**'] = {
                 textSize = 10,
-                color = {1, 1, 1, 1},
+                textColor = {1, 1, 1, 1},
                 mine = false,
                 stack = true,
                 showText = true,
                 showIcon = true,
                 useDefaultIcon = true,
                 iconSize = 10,
+                iconColor = {1, 1, 1, 1},
             },
         },
     }
@@ -32,10 +33,10 @@ local defaults = {
 
 function RaidFrameCustomization:OnInitialize()
     self.db = LibStub("AceDB-3.0"):New("RaidFrameCustomizationDB", defaults);
-    self:SetupOptions();
     self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig");
     self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig");
     self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig");
+    self:SetupOptions();
 end
 
 function RaidFrameCustomization:OnEnable()
index 22712f2..ce916a6 100644 (file)
@@ -36,10 +36,11 @@ local function configureIndicators(frame)
     local font = media and media:Fetch('font', config.indicatorFont) or STANDARD_TEXT_FONT;
     for pos, ind in pairs(f[frameName]) do
         ind.text:SetFont(font, config[pos]["textSize"]);
-        ind.text:SetTextColor(unpack(config[pos]["color"]));
+        ind.text:SetTextColor(unpack(config[pos]["textColor"]));
         ind.icon:SetWidth(config[pos]["iconSize"]);
         ind.icon:SetHeight(config[pos]["iconSize"]);
         ind.icon:SetTexture(DEFAULT_ICON);
+        ind.icon:SetVertexColor(unpack(config[pos]["iconColor"]));
         if config[pos]["showIcon"] then
             ind.icon:Show();
         else
index 958fa59..5cbd343 100644 (file)
@@ -66,14 +66,14 @@ local function createOptionsTable(self)
                     step = 1,
                     width = "full",
                 },
-                color = {
+                textColor = {
                     type = "color",
                     name = "Text color",
                     get = function(item)
-                        return unpack(self.db.profile[pos]["color"]);
+                        return unpack(self.db.profile[pos]["textColor"]);
                     end,
                     set = function(item, r, g, b, a)
-                        self.db.profile[pos]["color"] = {r, g, b, a};
+                        self.db.profile[pos]["textColor"] = {r, g, b, a};
                         self:RefreshConfig();
                     end,
                 },
@@ -98,6 +98,17 @@ local function createOptionsTable(self)
                     step = 1,
                     width = "full",
                 },
+                iconColor = {
+                    type = "color",
+                    name = "Icon tint",
+                    get = function(item)
+                        return unpack(self.db.profile[pos]["iconColor"]);
+                    end,
+                    set = function(item, r, g, b, a)
+                        self.db.profile[pos]["iconColor"] = {r, g, b, a};
+                        self:RefreshConfig();
+                    end,
+                },
             }
         };
     end