end |
|
-------------------------------------------------------------------------------- |
function GuildTracker:GetAlertMessage(change, msgFormat) |
function GuildTracker:GetAlertMessage(change, msgFormat, makelink) |
-------------------------------------------------------------------------------- |
local state = change.type |
local info = (state == State.GuildLeave or state == State.NameChange) and change.oldinfo or change.newinfo |
local nameColor = RAID_CLASS_COLORS_hex[info[Field.Class]] |
local nameText = info[Field.Name] |
local name = info[Field.Name] |
local coloredName = "[" .. RAID_CLASS_COLORS_hex[info[Field.Class]] .. name .. "|r" .. "]" |
local nameText = makelink and format("|Hplayer:%s|h%s|h", name, coloredName) or coloredName |
|
if msgFormat == 1 then -- Short |
|
local stateColor, stateText, _, _ = self:GetStateText(state) |
return string.format("%s%s|r: [%s%s|r]", stateColor, stateText, nameColor, nameText) |
return string.format("%s%s|r: %s", stateColor, stateText, nameText) |
|
elseif msgFormat == 2 then -- Long |
|
local stateColor, stateText, longText, _ = self:GetStateText(state) |
return string.format("Player %s: [%s%s|r]", longText, nameColor, nameText) |
return string.format("Player %s: %s", longText, nameText) |
|
else -- if msgFormat == 3 then -- Full |
|
local stateColor, stateText, _, fullText, category = self:GetChangeText(change) |
return string.format("%s%s|r: [%s%s|r] %s", stateColor, category, nameColor, nameText, fullText) |
return string.format("%s%s|r: %s %s", stateColor, category, nameText, fullText) |
|
end |
end |