Add an option to show timestamps in chat copy

"Show Timestamps In Chat Copy" (chat text settings, on by default) is read
each time chat copy opens. With it off, chat copy takes each line through
pfUI.chat.StripTimestamp, which removes the exact timestamp AddMessage
prepends: the configured color and brackets, so other bracketed text
stays.

Whispers are now recolored before the timestamp goes on, not after. The
recolor turned the stamp's closing "|r " into "|r" plus the whisper color,
so whisper lines did not match. The shown text and the saved history come
out the same.
This commit is contained in:
Brues
2026-10-30 01:25:36 -05:00
parent 7928db33bf
commit 393b37b8c3
4 changed files with 27 additions and 6 deletions
+3
View File
@@ -75,6 +75,9 @@ pfUI:RegisterModule("chatcopy", function ()
local lines = {}
for index=1, frame:GetNumMessages() do
local text, r, g, b = frame:GetMessageInfo(index)
if C.chat.text.copytime == "0" then
text = pfUI.chat.StripTimestamp(text)
end
local color = rgbhex(r, g, b)
table.insert(lines, color .. text:gsub("|r", color))
end