diff --git a/boot.lua b/boot.lua index 12e1babf..3b47472a 100644 --- a/boot.lua +++ b/boot.lua @@ -13,8 +13,8 @@ local addonName, Details222 = ... local version, build, date, tocversion = GetBuildInfo() - Details.build_counter = 12039 - Details.alpha_build_counter = 12039 --if this is higher than the regular counter, use it instead + Details.build_counter = 12040 + Details.alpha_build_counter = 12040 --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 diff --git a/core/parser.lua b/core/parser.lua index 697b16e2..e2184d55 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -6106,6 +6106,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details.playername = UnitName("player") end + Details.playername = Details:Ambiguate(Details.playername) + --player faction and enemy faction Details.faction = UnitFactionGroup("player") if (Details.faction == PLAYER_FACTION_GROUP[0]) then --player is horde @@ -6373,11 +6375,33 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 xpcall(saveAutoRunCode, logSaverError) end) --end of saving data - - local eraNamedSpellsToID = {} -- ~parserstart ~startparser ~cleu ~parser + Details.UnitNameCache = {} + function Details.OnParserEventRetail() --not in use - added on 2023.11.13 + local time, token, hidding, sourceSerial, sourceName, sourceFlags, sourceFlags2, targetSerial, targetName, targetFlags, targetFlags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() + + local func = token_list[token] + if (func) then + if (sourceName) then + if (Details.UnitNameCache[sourceName]) then + sourceName = Details.UnitNameCache[sourceName] + else + --detect if this is player by reading the flags + if (bitBand(sourceFlags, OBJECT_TYPE_PLAYER) ~= 0) then + sourceName = Ambiguate(sourceName, "none") + Details.UnitNameCache[sourceName] = sourceName + else + Details.UnitNameCache[sourceName] = sourceName + end + end + end + + return func(nil, token, time, sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags, targetFlags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) + end + end + function Details.OnParserEvent() local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() @@ -7143,6 +7167,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end end + name = Details:Ambiguate(name) + --damage done local actor = currentCombat:GetActor(DETAILS_ATTRIBUTE_DAMAGE, name) if (actor) then diff --git a/functions/classes.lua b/functions/classes.lua index 9d56565c..27b2855e 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -192,9 +192,9 @@ do end function Details:Ambiguate(unitName) - if (toc >= 100200) then + --if (toc >= 100200) then unitName = Ambiguate(unitName, "none") - end + --end return unitName end @@ -206,6 +206,7 @@ do end local UnitFullName = UnitFullName + --Details:GetCurrentCombat():GetActor(DETAILS_ATTRIBUTE_DAMAGE, Details:GetFullName("player")):GetSpell(1) ---create a CLEU compatible name of the unit passed ---return string is in the format "playerName-realmName" @@ -235,9 +236,9 @@ do return Details:GetFullName(unitId, "none") end - if (toc < 100200) then + --if (toc < 100200) then Details.GetFullName = Details.GetCLName - end + --end function Details:Class(actor) return self.classe or actor and actor.classe diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 69b310de..7770eade 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -2362,6 +2362,8 @@ function StreamOverlay:OnEvent (_, event, ...) playerName = interimPlayerName .. '-' .. playerRealm end + playerName = _G.Details:Ambiguate(playerName) + if (_G.Details) then