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
+17 -2
View File
@@ -13,8 +13,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()
Details.build_counter = 12025
Details.alpha_build_counter = 12025 --if this is higher than the regular counter, use it instead
Details.build_counter = 12026
Details.alpha_build_counter = 12026 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true
Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter
@@ -1360,6 +1360,21 @@ if (select(4, GetBuildInfo()) >= 100000) then
end)
end
local classCacheName = Details222.ClassCache.ByName
local classCacheGUID = Details222.ClassCache.ByGUID
function Details222.ClassCache.GetClassFromCache(value)
return classCacheName[value] or classCacheGUID[value]
end
function Details222.ClassCache.AddClassToCache(value, whichCache)
if (whichCache == "name") then
classCacheName[value] = true
elseif (whichCache == "guid") then
classCacheGUID[value] = true
end
end
function Details222.ClassCache.GetClass(value)
local className = Details222.ClassCache.ByName[value] or Details222.ClassCache.ByGUID[value]
if (className) then