Added played class time to /played, also added a command to disable it

This commit is contained in:
Tercio Jose
2022-12-04 12:21:44 -03:00
parent 60c797d9ca
commit e12ec18381
6 changed files with 45 additions and 18 deletions
+4 -3
View File
@@ -3127,7 +3127,9 @@ function Details.GetPlayTimeOnClassString()
end
hooksecurefunc("ChatFrame_DisplayTimePlayed", function()
print(Details.GetPlayTimeOnClassString())
if (Details.played_class_time) then
print(Details.GetPlayTimeOnClassString() .. " (/details playedclass)")
end
end)
--game freeze prevention, there are people calling UpdateAddOnMemoryUsage() making the game client on the end user to freeze, this is bad, really bad.
@@ -3137,8 +3139,7 @@ local bigStutterCounter = 0
local UpdateAddOnMemoryUsage_Original = _G.UpdateAddOnMemoryUsage
Details.UpdateAddOnMemoryUsage_Original = _G.UpdateAddOnMemoryUsage
--to ignore this, use /run _G["UpdateAddOnMemoryUsage"] = Details.UpdateAddOnMemoryUsage_Original or add to any script that run on login
_G["UpdateAddOnMemoryUsage"] = function()
Details.UpdateAddOnMemoryUsage_Custom = function()
local currentTime = debugprofilestop()
UpdateAddOnMemoryUsage_Original()
local deltaTime = debugprofilestop() - currentTime