Skip to content

Commit

Permalink
fixed class played time spamming chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Dec 8, 2022
1 parent 0707c31 commit 6609580
Show file tree
Hide file tree
Showing 6 changed files with 410 additions and 394 deletions.
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion core/gears.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {},
Expand All @@ -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,
Expand Down
Loading

0 comments on commit 6609580

Please sign in to comment.