From 6542699b750f9ad8507ab56c5d92da030b91df4d Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Tue, 13 Dec 2022 08:32:16 -0300 Subject: [PATCH] don't print the class played time if the played time is already in the chat window --- core/gears.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/gears.lua b/core/gears.lua index 7201d81d..fc093005 100644 --- a/core/gears.lua +++ b/core/gears.lua @@ -3129,6 +3129,13 @@ end hooksecurefunc("ChatFrame_DisplayTimePlayed", function() if (Details.played_class_time) then C_Timer.After(0, function() + local expansionName = _G["EXPANSION_NAME" .. GetExpansionLevel()] + for fontString in ChatFrame1.fontStringPool:EnumerateActive() do + if (fontString:GetText() and fontString:GetText():find(expansionName)) then + return + end + end + 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