Skip to content

Commit

Permalink
Fixed an issue with player names cache getting 'Unknown' from UnitName()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Aug 17, 2024
1 parent c6bbeb0 commit 6de6be1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions Details.toc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ frames\window_classcolor.lua
frames\window_statistics.lua
frames\window_aura_tracker.lua
frames\window_debug.lua
frames\window_pro_file.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ frames\window_classcolor.lua
frames\window_statistics.lua
frames\window_aura_tracker.lua
frames\window_debug.lua
frames\window_pro_file.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ frames\window_bookmark.lua
frames\window_classcolor.lua
frames\window_statistics.lua
frames\window_debug.lua
frames\window_pro_file.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
1 change: 1 addition & 0 deletions Details_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ frames\window_bookmark.lua
frames\window_classcolor.lua
frames\window_statistics.lua
frames\window_debug.lua
frames\window_pro_file.lua

classes\class_error.lua
classes\class_spelltable.lua
Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
local addonName, Details222 = ...
local version, build, date, tvs = GetBuildInfo()

Details.build_counter = 12869
Details.alpha_build_counter = 12869 --if this is higher than the regular counter, use it instead
Details.build_counter = 12877
Details.alpha_build_counter = 12877 --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
19 changes: 16 additions & 3 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@
end
end

local spellInfo = C_Spell.GetSpellInfo(spellId)
--local spellInfo = C_Spell.GetSpellInfo(spellId)
Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
else
--entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s
Expand Down Expand Up @@ -6202,6 +6202,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end

local update_persistant_unitname_cache = function()
Details.UpdatePersistantCacheTimer = nil

local unitIdCache

if (IsInRaid()) then
Expand Down Expand Up @@ -6230,7 +6232,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function Details.parser_functions:GROUP_ROSTER_UPDATE(...)
local bIsInGroup = IsInGroup() or IsInRaid()

update_persistant_unitname_cache()
if (not Details.UpdatePersistantCacheTimer) then
Details.UpdatePersistantCacheTimer = C_Timer.NewTimer(2, update_persistant_unitname_cache)
end

if (not Details.in_group) then
Details.in_group = bIsInGroup
Expand Down Expand Up @@ -6441,8 +6445,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end

function Details.parser_functions:UNIT_NAME_UPDATE(...)
function Details.parser_functions:UNIT_NAME_UPDATE(unitId)
Details:SchedulePetUpdate(5)
local unitGUID = UnitGUID(unitId)
if (unitGUID) then
if (unitGUID:match("^Pl")) then
local unitFullName = Details:GetFullName(unitId)
if (unitFullName) then
group_roster_name_cache[unitGUID] = unitFullName
end
end
end
end

function Details.parser_functions:PLAYER_TARGET_CHANGED(...)
Expand Down
6 changes: 6 additions & 0 deletions frames/window_pro_file.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

local Details = Details
local addonName, Details222 = ...
---@type detailsframework
local detailsFramework = DetailsFramework
local _
3 changes: 1 addition & 2 deletions startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,7 @@ function Details222.StartUp.StartMeUp()
tooltipBackgroundColor[4] = 0.8

Details.tooltip.fontshadow = true


Details.tooltip.fontsize = 11
end
end

Expand Down

0 comments on commit 6de6be1

Please sign in to comment.