Skip to content

Commit

Permalink
Undoing changes for combatlog changes on 10.2 as the combatlog change…
Browse files Browse the repository at this point in the history
…s got reverted
  • Loading branch information
Tercioo committed Nov 14, 2023
1 parent 4b7463a commit e721a07
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 28 additions & 2 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions functions/classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions plugins/Details_Streamer/Details_Streamer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,8 @@ function StreamOverlay:OnEvent (_, event, ...)
playerName = interimPlayerName .. '-' .. playerRealm
end

playerName = _G.Details:Ambiguate(playerName)

if (_G.Details) then


Expand Down

0 comments on commit e721a07

Please sign in to comment.