diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-17 18:35:38 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2009-11-17 18:35:38 +0000 |
commit | 939e48d38cf9f15e1f7220cc3860810badd8a778 (patch) | |
tree | e7135ea43d8945c173c5cade2c3767193fa76f56 /indra/newview/llnearbychat.cpp | |
parent | a402f4894d72209f9ac9bc9d7962c28b3c26bb18 (diff) | |
parent | 6253e2611d3ecf4ff5c778d0e53f34aed06f35da (diff) |
merge.
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 029019a8dc..cae5c52378 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -155,7 +155,37 @@ void LLNearbyChat::addMessage(const LLChat& chat) if (!chat.mMuted) { - mChatHistory->appendWidgetMessage(chat); + std::string message = chat.mText; + std::string prefix = message.substr(0, 4); + + if (chat.mChatStyle == CHAT_STYLE_IRC) + { + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + std::string font_name = LLFontGL::nameFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); + LLStyle::Params append_style_params; + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font.name(font_name); + append_style_params.font.size(font_size); + if (chat.mFromName.size() > 0) + { + append_style_params.font.style = "ITALIC"; + LLChat add_chat=chat; + add_chat.mText = chat.mFromName + " "; + mChatHistory->appendWidgetMessage(add_chat, append_style_params); + } + + message = message.substr(3); + append_style_params.font.style = "UNDERLINE"; + mChatHistory->appendText(message, FALSE, append_style_params); + } + else + { + mChatHistory->appendWidgetMessage(chat); + } } } |