d288be9 - Add icon tinting
[wowui.git] / Indicators.lua
index 7858b4b..ce916a6 100644 (file)
@@ -18,7 +18,7 @@ local _;
 -- global functions used every update
 local GetTime = GetTime;
 local UnitAura = UnitAura;
 -- global functions used every update
 local GetTime = GetTime;
 local UnitAura = UnitAura;
-local UnitIsUnit = UnitIsUnit;
+local UnitIsPlayer = UnitIsPlayer;
 local UnitIsConnected = UnitIsConnected;
 local UnitIsDeadOrGhost = UnitIsDeadOrGhost;
 local CompactRaidFrameContainer_ApplyToFrames = CompactRaidFrameContainer_ApplyToFrames;
 local UnitIsConnected = UnitIsConnected;
 local UnitIsDeadOrGhost = UnitIsDeadOrGhost;
 local CompactRaidFrameContainer_ApplyToFrames = CompactRaidFrameContainer_ApplyToFrames;
@@ -28,10 +28,6 @@ local centerAuras = {
     "Power Word: Shield"
 };
 
     "Power Word: Shield"
 };
 
-local function dPrint(s)
-    DEFAULT_CHAT_FRAME:AddMessage("Indicators: ".. tostring(s));
-end
-
 local function configureIndicators(frame)
     local frameName = frame:GetName();
     if not f[frameName] then return end
 local function configureIndicators(frame)
     local frameName = frame:GetName();
     if not f[frameName] then return end
@@ -40,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"]);
     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: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
         if config[pos]["showIcon"] then
             ind.icon:Show();
         else
@@ -83,7 +80,7 @@ local function getAuras(unit)
                 aura.spellId = spellId;
                 aura.count = count;
                 aura.expires = expires;
                 aura.spellId = spellId;
                 aura.count = count;
                 aura.expires = expires;
-                aura.mine = UnitIsUnit(caster, "player");
+                aura.mine = UnitIsPlayer(caster);
                 aura.icon = icon;
                 aura.debuffType = debuffType;
                 table.insert(unitAuras, aura);
                 aura.icon = icon;
                 aura.debuffType = debuffType;
                 table.insert(unitAuras, aura);
@@ -136,8 +133,6 @@ local function updateIndicators(frame)
                     -- show icon TODO coloring
                     ind.icon:SetTexture(found.icon);
                 end
                     -- show icon TODO coloring
                     ind.icon:SetTexture(found.icon);
                 end
-                -- TODO make show text into general setting
-                -- under which you can select what text to show
                 if config.showText then
                     -- show text
                     local text;
                 if config.showText then
                     -- show text
                     local text;