cleanup and update chat

This commit is contained in:
Crum
2018-01-25 14:46:24 -06:00
parent feec2011d3
commit fc4a2b628b
+3 -34
View File
@@ -85,12 +85,6 @@ local hyperlinkTypes = {
["talent"] = true, ["talent"] = true,
} }
local specialChatIcons = {
-- ["Smolderforge"] = {
-- ["Loaal"] = "|TInterface\\AddOns\\ElvUI\\media\\textures\\ElvUI_Chat_Logo:13:22|t",
-- }
}
CH.Keywords = {} CH.Keywords = {}
local numScrollMessages local numScrollMessages
@@ -307,15 +301,6 @@ function CH:UpdateSettings()
ChatFrameEditBox:SetAltArrowKeyMode(CH.db.useAltKey) ChatFrameEditBox:SetAltArrowKeyMode(CH.db.useAltKey)
end end
local function removeIconFromLine(text)
text = gsub(text, "|TInterface\\TargetingFrame\\UI%-RaidTargetingIcon_(%d+):0|t", function(x)
x = _G["RAID_TARGET_"..x]; return "{"..strlower(x).."}"
end)
text = gsub(text, "|H.-|h(.-)|h", "%1")
return gsub(text, "|T.-|t", "")
end
local function colorizeLine(text, r, g, b) local function colorizeLine(text, r, g, b)
local hexCode = E:RGBToHex(r, g, b) local hexCode = E:RGBToHex(r, g, b)
local hexReplacement = format("|r%s", hexCode) local hexReplacement = format("|r%s", hexCode)
@@ -335,7 +320,6 @@ function CH:GetLines(...)
local line = tostring(region:GetText()) local line = tostring(region:GetText())
local r, g, b = region:GetTextColor() local r, g, b = region:GetTextColor()
line = removeIconFromLine(line)
line = colorizeLine(line, r, g, b) line = colorizeLine(line, r, g, b)
lines[index] = line lines[index] = line
@@ -728,18 +712,6 @@ function GetColoredName(event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, a
return arg2 return arg2
end end
local function GetChatIcons(sender)
if specialChatIcons[PLAYER_REALM] and specialChatIcons[PLAYER_REALM][E.myname] then
for realm, _ in pairs(specialChatIcons) do
for character, texture in pairs(specialChatIcons[realm]) do
if sender == character or sender == character.."-"..realm then
return texture
end
end
end
end
end
function CH:ChatFrame_MessageEventHandler(event, ...) function CH:ChatFrame_MessageEventHandler(event, ...)
if event == "UPDATE_CHAT_WINDOWS" then if event == "UPDATE_CHAT_WINDOWS" then
local name, fontSize, r, g, b, a, shown, locked = GetChatWindowInfo(self:GetID()) local name, fontSize, r, g, b, a, shown, locked = GetChatWindowInfo(self:GetID())
@@ -946,12 +918,9 @@ function CH:ChatFrame_MessageEventHandler(event, ...)
end end
-- Add AFK/DND flags -- Add AFK/DND flags
local pflag = GetChatIcons(arg2) local pflag
if arg6 ~= "" then if arg6 ~= "" then
if arg6 == "GM" then if arg6 == "DND" or arg6 == "AFK" then
--Add Blizzard Icon, this was sent by a GM
pflag = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:0:2:0:-3|t "
elseif arg6 == "DND" or arg6 == "AFK" then
pflag = (pflag or "").._G["CHAT_FLAG_"..arg6] pflag = (pflag or "").._G["CHAT_FLAG_"..arg6]
else else
pflag = _G["CHAT_FLAG_"..arg6] pflag = _G["CHAT_FLAG_"..arg6]
@@ -1017,7 +986,7 @@ function CH:ChatFrame_MessageEventHandler(event, ...)
end end
if type == "WHISPER" then if type == "WHISPER" then
ChatEdit_SetLastTellTarget(arg2) ChatEdit_SetLastTellTarget(self.editBox, arg2)
if self.tellTimer and (GetTime() > self.tellTimer) then if self.tellTimer and (GetTime() > self.tellTimer) then
PlaySound("TellMessage") PlaySound("TellMessage")
end end