Move error function.

Sasky [06-06-14 - 15:16]
Move error function.
Add color for ALLIANCE_NONE
Filename
CyrHUD.lua
classes/Battle.lua
classes/Info.lua
diff --git a/CyrHUD.lua b/CyrHUD.lua
index a53d00f..1ce94d8 100644
--- a/CyrHUD.lua
+++ b/CyrHUD.lua
@@ -32,6 +32,14 @@ function CyrHUD.formatTime(delta, inclueSec)
     return out
 end

+CyrHUD.errors = {}
+CyrHUD.error = function(val)
+    if not CyrHUD.errors[val] then
+        CyrHUD.errors[val] = 1
+        d("|cFF0000ERROR (CyrHUD): " .. val .. " / Please file this bug info at esoui.com")
+    end
+end
+
 ----------------------------------------------
 -- Score
 ----------------------------------------------
diff --git a/classes/Battle.lua b/classes/Battle.lua
index 6c43025..a170486 100644
--- a/classes/Battle.lua
+++ b/classes/Battle.lua
@@ -12,13 +12,6 @@ end
 -- Setup class
 CyrHUD.Battle = {}
 CyrHUD.Battle.__index = CyrHUD.Battle
-CyrHUD.errors = ""
-CyrHUD.error = function(val)
-    if not CyrHUD.errors[val] then
-        CyrHUD.errors[val] = 1
-        d("|cFF0000ERROR (CyrHUD): " .. val .. " / Please file this bug info at esoui.com")
-    end
-end
 setmetatable(CyrHUD.Battle, {
     __call = function (cls, ...)
         return cls.new(...)
@@ -166,7 +159,7 @@ end
     @see CyrHUD.info
 ]]
 function CyrHUD.Battle:getIcon()
-    if self.defender == 0 then
+    if self.defender == ALLIANCE_NONE then
         return CyrHUD.info.noIcon
     end

diff --git a/classes/Info.lua b/classes/Info.lua
index 9d23d2c..26ca5ca 100644
--- a/classes/Info.lua
+++ b/classes/Info.lua
@@ -15,6 +15,8 @@ local EP = ALLIANCE_EBONHEART_PACT

 CyrHUD.info = {}
 CyrHUD.info.noIcon = "/esoui/art/mappins/ava_largekeep_neutral.dds"
+CyrHUD.info[ALLIANCE_NONE] = {}
+CyrHUD.info[ALLIANCE_NONE].color = { hex = "CCCCCC", r = .8, g = .8, b = .8}
 CyrHUD.info[AD] = {}
 CyrHUD.info[AD].color = { hex = "B2B222", r = .698, g = .698, b = .133 }
 CyrHUD.info[AD][KEEPTYPE_KEEP] = "/esoui/art/mappins/ava_largekeep_aldmeri.dds"