fixed class played time spamming chat

This commit is contained in:
Tercio Jose
2022-12-08 15:41:24 -03:00
parent 0707c310d9
commit 6609580f09
6 changed files with 410 additions and 394 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
local addonName, Details222 = ...
local version, build, date, tocversion = GetBuildInfo()
_detalhes.build_counter = 10333
_detalhes.alpha_build_counter = 10333 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 10334
_detalhes.alpha_build_counter = 10334 --if this is higher than the regular counter, use it instead
_detalhes.dont_open_news = true
_detalhes.game_version = version
_detalhes.userversion = version .. " " .. _detalhes.build_counter
+9 -1
View File
@@ -3128,7 +3128,15 @@ end
hooksecurefunc("ChatFrame_DisplayTimePlayed", function()
if (Details.played_class_time) then
print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)")
C_Timer.After(0, function()
local levelText = TIME_PLAYED_LEVEL and TIME_PLAYED_LEVEL:gsub("%%s", "") or ""
for fontString in ChatFrame1.fontStringPool:EnumerateActive() do
if (fontString:GetText() and fontString:GetText():find(levelText)) then
print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)")
break
end
end
end)
end
end)
+3 -3
View File
@@ -6136,9 +6136,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_instance_backup = {},
}
local exitErrors = __details_backup._exit_error
local addToExitErrors = function(text)
table.insert(exitErrors, 1, text)
table.insert(exitErrors, 1, date() .. "|" .. text)
table.remove(exitErrors, 10)
end
@@ -6150,7 +6150,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end)
if (not savePlayTimeClass) then
addToExitErrors("Saving Play Time:" .. savePlayTimeError)
addToExitErrors("Saving Play Time: " .. savePlayTimeError)
end
--SAVINGDATA = true
+2 -2
View File
@@ -1443,7 +1443,7 @@ local default_global_data = {
},
--auras (wa auras created from the aura panel)
details_auras = {},
details_auras = {}, --deprecated due to major security wa code revamp
--ilvl
item_level_pool = {},
@@ -1467,7 +1467,7 @@ local default_global_data = {
npcid_pool = {},
--aura creation frame libwindow
createauraframe = {},
createauraframe = {}, --deprecated
--min health done on the death report
deathlog_healingdone_min = 1,
+388 -380
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -13,6 +13,12 @@ function Details:StartMeUp() --I'll never stop!
Details.lastArenaStartTime = GetTime()
Details.lastBattlegroundStartTime = GetTime()
--save the time when the addon finished loading
Details.AddOnStartTime = GetTime()
function Details.GetStartupTime()
return Details.AddOnStartTime or GetTime()
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--row single click, this determines what happen when the user click on a bar
@@ -493,12 +499,6 @@ function Details:StartMeUp() --I'll never stop!
--embed windows on the chat window
Details.chat_embed:CheckChatEmbed(true)
--save the time when the addon finished loading
Details.AddOnStartTime = GetTime()
function Details.GetStartupTime()
return Details.AddOnStartTime or GetTime()
end
if (Details.player_details_window.skin ~= "ElvUI") then
local setDefaultSkinOnPlayerBreakdownWindow = function()
Details:ApplyPDWSkin("ElvUI")