Commit aa72c74d authored by Blazeflack's avatar Blazeflack

Added faction:icon tag

Reference: #2
parent 6ebc0024
......@@ -15,6 +15,7 @@ local GetNumGroupMembers = GetNumGroupMembers
local IsInGroup = IsInGroup
local IsInRaid = IsInRaid
local UnitClass = UnitClass
local UnitFactionGroup = UnitFactionGroup
local UnitHealth = UnitHealth
local UnitHealthMax = UnitHealthMax
local UnitIsDead = UnitIsDead
......@@ -591,6 +592,20 @@ ElvUF.Tags.Methods['name:long:abbreviate'] = function(unit)
return name
end
ElvUF.Tags.Events['faction:icon'] = 'UNIT_NAME_UPDATE'
ElvUF.Tags.Methods['faction:icon'] = function(unit)
local faction = UnitFactionGroup(unit)
local str = ""
if faction == "Alliance" then
str = "|TInterface\\AddOns\\ElvUI_CustomTags\\media\\Alliance:0:0:0:-1|t"
elseif faction == "Horde" then
str = "|TInterface\\AddOns\\ElvUI_CustomTags\\media\\Horde:0:0:0:-1|t"
end
return str
end
ElvUF.Tags.Methods["classcolor:player"] = function()
local _, unitClass = UnitClass("player")
local String
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment