Fixed an issue with player names cache getting 'Unknown' from UnitName()

This commit is contained in:
Tercio Jose
2024-08-17 17:59:01 -03:00
committed by andrew6180
parent 11a821729b
commit 0897550b1b
5 changed files with 74 additions and 5 deletions
+1
View File
@@ -125,6 +125,7 @@ frames\window_classcolor.lua
frames\window_statistics.lua frames\window_statistics.lua
frames\window_aura_tracker.lua frames\window_aura_tracker.lua
frames\window_debug.lua frames\window_debug.lua
frames\window_pro_file.lua
classes\class_error.lua classes\class_error.lua
classes\class_spelltable.lua classes\class_spelltable.lua
+2 -2
View File
@@ -19,8 +19,8 @@
local addonName, Details222 = ... local addonName, Details222 = ...
local version = GetBuildInfo() local version = GetBuildInfo()
Details.build_counter = 12869 Details.build_counter = 12877
Details.alpha_build_counter = 12869 --if this is higher than the regular counter, use it instead Details.alpha_build_counter = 12877 --if this is higher than the regular counter, use it instead
Details.dont_open_news = true Details.dont_open_news = true
Details.game_version = version Details.game_version = version
Details.userversion = version .. " " .. Details.build_counter Details.userversion = version .. " " .. Details.build_counter
+16 -3
View File
@@ -635,7 +635,7 @@
Details:Msg(Details.WhoAggroTimer.HitBy) Details:Msg(Details.WhoAggroTimer.HitBy)
end end
local spellInfo = C_Spell.GetSpellInfo(spellId) --local spellInfo = C_Spell.GetSpellInfo(spellId)
Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags) Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
else else
--entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atrs --entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atrs
@@ -5585,6 +5585,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end end
local update_persistant_unitname_cache = function() local update_persistant_unitname_cache = function()
Details.UpdatePersistantCacheTimer = nil
local unitIdCache local unitIdCache
if (IsInRaid()) then if (IsInRaid()) then
@@ -5613,7 +5615,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function Details.parser_functions:GROUP_ROSTER_UPDATE(...) function Details.parser_functions:GROUP_ROSTER_UPDATE(...)
local bIsInGroup = IsInGroup() or IsInRaid() 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 if (not Details.in_group) then
Details.in_group = bIsInGroup Details.in_group = bIsInGroup
@@ -5817,8 +5821,17 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end end
end end
function Details.parser_functions:UNIT_NAME_UPDATE(...) function Details.parser_functions:UNIT_NAME_UPDATE(unitId)
Details:SchedulePetUpdate(5) 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 end
function Details.parser_functions:PLAYER_TARGET_CHANGED(...) function Details.parser_functions:PLAYER_TARGET_CHANGED(...)
+6
View File
@@ -0,0 +1,6 @@
local Details = Details
local addonName, Details222 = ...
---@type detailsframework
local detailsFramework = DetailsFramework
local _
+49
View File
@@ -583,6 +583,55 @@ function Details222.StartUp.StartMeUp()
Details.cached_specs[UnitGUID("player")] = GetSpecializationInfo(GetSpecialization() or 0) Details.cached_specs[UnitGUID("player")] = GetSpecializationInfo(GetSpecialization() or 0)
if (GetExpansionLevel() == 2) then
if (not Details.data_wipes_exp["3"]) then
Details:Msg("New expansion detected, clearing data...")
Details:Destroy(Details.encounter_spell_pool or {})
Details:Destroy(Details.boss_mods_timers or {})
Details:Destroy(Details.spell_school_cache or {})
Details:Destroy(Details.spell_pool or {})
Details:Destroy(Details.npcid_pool or {})
Details:Destroy(Details.current_exp_raid_encounters or {})
Details.data_wipes_exp["3"] = true
Details.frame_background_color[1] = 0.0549
Details.frame_background_color[2] = 0.0549
Details.frame_background_color[3] = 0.0549
Details.frame_background_color[4] = 0.934
if (Details.breakdown_spell_tab.spellcontainer_headers.critpercent) then
Details.breakdown_spell_tab.spellcontainer_headers.critpercent.enabled = true
end
if (Details.breakdown_spell_tab.spellcontainer_headers.uptime) then
Details.breakdown_spell_tab.spellcontainer_headers.uptime.enabled = true
end
if (Details.breakdown_spell_tab.spellcontainer_headers.hits) then
Details.breakdown_spell_tab.spellcontainer_headers.hits.enabled = true
end
Details.breakdown_general.bar_texture = "You Are the Best!"
Details.tooltip.rounded_corner = false
local tooltipBarColor = Details.tooltip.bar_color
tooltipBarColor[1] = 0.129
tooltipBarColor[2] = 0.129
tooltipBarColor[3] = 0.129
tooltipBarColor[4] = 1
local tooltipBackgroundColor = Details.tooltip.background
tooltipBackgroundColor[1] = 0.054
tooltipBackgroundColor[2] = 0.054
tooltipBackgroundColor[3] = 0.054
tooltipBackgroundColor[4] = 0.8
Details.tooltip.fontshadow = true
Details.tooltip.fontsize = 11
end
end
Details.boss_mods_timers.encounter_timers_dbm = Details.boss_mods_timers.encounter_timers_dbm or {} Details.boss_mods_timers.encounter_timers_dbm = Details.boss_mods_timers.encounter_timers_dbm or {}
Details.boss_mods_timers.encounter_timers_bw = Details.boss_mods_timers.encounter_timers_bw or {} Details.boss_mods_timers.encounter_timers_bw = Details.boss_mods_timers.encounter_timers_bw or {}