2025-04-18 14:03:11 +02:00
|
|
|
local _, addon = ...
|
|
|
|
|
2025-04-19 00:41:40 +02:00
|
|
|
local function ClearStringFormatMarks(text)
|
2025-04-18 14:03:11 +02:00
|
|
|
-- Remove colors (|cffffff...)
|
|
|
|
text = text:gsub("|c%x%x%x%x%x%x%x%x", "")
|
|
|
|
-- Remove H marks
|
|
|
|
text = text:gsub("|H.-|h", "")
|
|
|
|
return text
|
|
|
|
end
|
2025-04-19 00:41:40 +02:00
|
|
|
addon.API.ClearStringFormatMarks = ClearStringFormatMarks
|
2025-04-18 14:03:11 +02:00
|
|
|
|
|
|
|
local function ColorSpellNames(text, color)
|
|
|
|
return text:gsub("%[(.-)%]", function(match)
|
|
|
|
return string.format("|c%s[%s]|r", color or "FF0000FF", match)
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
addon.API.ColorSpellNames = ColorSpellNames
|