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
+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