Been trying to find a way to add icons above friendly players. You can do it in threatplates options but I prefer KUI.
So I managed to find one on here that did this and then made it into an addon through addon bool which looks like this;
a7bd3dc555ffb3bc22837164f241954f.png
I managed to change the addon so the icon is in the right place and fits in above KUI as well as adding evokers. (blurred their name here but the KUI name is shown there)
But for some reason it shows an icon above the personal resource display like this;
cc236f035392a85ad2c8d37de3d27d17.png
Which even more annoyingly clips with the buffs that show up like this;
c20dd40e3329c248e3fe2be2a75adec4.png
As well as adding icons on npc's like this;
npcicon.png
Does anyone know how to remove the icon from the personal resource bar and the npc's? Here is the lua
Code:
local addonName = ...
local iconKey = addonName .. "Icon"
local GetNamePlateForUnit = C_NamePlate.GetNamePlateForUnit
local iconTexture = {
["DEATHKNIGHT"] = 135771,
["DEMONHUNTER"] = 1260827,
["DRUID"] = 625999,
["EVOKER"] = 4574311,
["HUNTER"] = 626000,
["MAGE"] = 626001,
["MONK"] = 626002,
["PALADIN"] = 626003,
["PRIEST"] = 626004,
["ROGUE"] = 626005,
["SHAMAN"] = 626006,
["WARLOCK"] = 626007,
["WARRIOR"] = 626008
}
local frame = CreateFrame("Frame")
frame:SetScript("OnEvent", function(self, event, unit)
local namePlate = GetNamePlateForUnit(unit)
if event == "NAME_PLATE_UNIT_ADDED" and UnitIsFriend("player", unit) then
local _, class = UnitClass(unit)
if iconTexture[class] then
local icon = namePlate[iconKey]
if not icon then
icon = namePlate:CreateTexture(nil, "OVERLAY")
icon:SetPoint('CENTER', 0, 18)
icon:SetSize(20, 20)
namePlate[iconKey] = icon
end
icon:SetTexture(iconTexture[class])
icon:Show()
return
end
end
if namePlate[iconKey] then
namePlate[iconKey]:Hide()
end
end)
frame:RegisterEvent("NAME_PLATE_UNIT_ADDED")
frame:RegisterEvent("NAME_PLATE_UNIT_REMOVED")
Many Thanks