With more tinkering, I've come to this function for my tag
lua Code:
oUF.Tags.Methods["diablo:name"] = function(unit)
local color = oUF.Tags.Methods["diablo:color"](unit)
local name = UnitName(unit)
if IsAddOnLoaded("Totalrp3") then
local UnitID = TRP3_API.utils.str.getUnitID(unit)
if UnitID == nil then
local name = UnitName(unit)
return "|cff"..color..(name or "").."|r"
else
local name = TRP3_API.chat.getFullnameForUnitUsingChatMethod(UnitID)
return "|cff"..color..(name or "").."|r"
end
end
end
However, it misbehaves.
If I target someone with a TRP profile, it works 100% as expected, however, whenever I target someone without a profile, or an NPC, it doesn't display a name.
The "if UnitID == nil" /should/ work around this issue, but for some reason it does now, and i'm confused as to why.