Added Details:GetUntitClass(unitId), this call handles the Ambiguate in combatlog's player name when calling UnitClass

This commit is contained in:
Tercio Jose
2023-11-08 20:25:25 -03:00
parent 3b2ba40b29
commit 5e7df0d94a
9 changed files with 66 additions and 32 deletions
+22
View File
@@ -174,6 +174,28 @@ do
end
end
---return the class file name of the unit passed
local getFromCache = Details222.ClassCache.GetClassFromCache
local Ambiguate = Ambiguate
local UnitClass = UnitClass
function Details:GetUnitClass(unitId)
local class, classFileName = getFromCache(unitId)
if (not classFileName) then
unitId = Ambiguate(unitId, "none")
classFileName = select(2, UnitClass(unitId))
end
return classFileName
end
---return the class name, class file name and class id of the unit passed
function Details:GetUnitClassFull(unitId)
unitId = Ambiguate(unitId, "none")
local locClassName, classFileName, classId = UnitClass(unitId)
return locClassName, classFileName, classId
end
function Details:GetFullName(unitId)
--playerName, realmName = UnitFullName(unitId) --realm name already has spaces removed
--return playerName .. "-" .. realmName