summaryrefslogtreecommitdiff
path: root/indra/newview/llnearbychat.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-19 13:19:16 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-19 13:19:16 -0500
commit6cea252986ef6d33f2e37333a286362b8e0272c5 (patch)
treeec0e4d56a9dc2d8a97cc9bce4744b097f4b7efe4 /indra/newview/llnearbychat.cpp
parent2b0a997b13de15c7aae009b52d7353c97e1781f3 (diff)
parent815f336a157cc33233633deed66634195d3dc552 (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r--indra/newview/llnearbychat.cpp41
1 files changed, 39 insertions, 2 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 85db69174d..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);
+ }
}
}
@@ -203,5 +233,12 @@ void LLNearbyChat::getAllowedRect(LLRect& rect)
{
rect = gViewerWindow->getWorldViewRectRaw();
}
-
+void LLNearbyChat::setMinimized (BOOL minimize)
+{
+ if(minimize && !isDocked())
+ {
+ setVisible(FALSE);
+ }
+ LLDockableFloater::setMinimized(minimize);
+}