|
local function AddMessage(frame, text, red, green, blue, id) |
text = tostring(text) or '' |
text = text:gsub('%[Guild%] (|Hplayer.+)', 'G %1') |
text = text:gsub('%[Party%] (|Hplayer.+)', 'P %1') |
text = text:gsub('%[Raid%] (|Hplayer.+)', 'R %1') |
text = text:gsub('%[Raid Leader%] (|Hplayer.+)', 'RL %1') |
text = text:gsub('%[Raid Warning%] (|Hplayer.+)', 'RW %1') |
text = text:gsub('%[Officer%] (|Hplayer.+)', 'O %1') |
text = text:gsub('%[Battleground%] (|Hplayer.+)', 'B %1') |
text = text:gsub('%[Battleground Leader%] (|Hplayer.+)', 'BL %1') |
text = text:gsub('%<AFK%>(|Hplayer.+)', '%1') |
text = text:gsub('%<DND%>(|Hplayer.+)', '%1') |
text = text:gsub('%[(%d+)%. .+%] (|Hplayer.+)', '%1 %2') |
|
for k,v in pairs(replaces) do |
text = text:gsub('|h%['..k..'%]|h', '|h'..v..'|h') |
end |
|
text = text:gsub('(|Hplayer.-|h)%[(.-)%].-:', '%1%2|h:') |
text = '|cff999999' .. date('%H%M') .. '|r ' .. text |
|