diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-16 16:28:04 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-11-16 16:28:04 +0200 |
commit | eef22e0baf9e62f8c38058ad22e6e6bd5e5aca26 (patch) | |
tree | 2a498eb73a80802c7811193ce63253c9be905295 /indra/newview/llnearbychat.cpp | |
parent | 59d575fe615bf14a10056c9b9fe0c109ec2c103e (diff) | |
parent | bd42c1ae2cd6bb6e005478cc121c2b5d7a844eb4 (diff) |
Merge from default branch
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llnearbychat.cpp')
-rw-r--r-- | indra/newview/llnearbychat.cpp | 107 |
1 files changed, 9 insertions, 98 deletions
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 8bf964f0a7..029019a8dc 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -132,120 +132,31 @@ void LLNearbyChat::applySavedVariables() } } -LLColor4 nearbychat_get_text_color(const LLChat& chat) -{ - LLColor4 text_color; - - if(chat.mMuted) - { - text_color.setVec(0.8f, 0.8f, 0.8f, 1.f); - } - else - { - switch(chat.mSourceType) - { - case CHAT_SOURCE_SYSTEM: - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - break; - case CHAT_SOURCE_AGENT: - if (chat.mFromID.isNull()) - { - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - } - else - { - if(gAgentID == chat.mFromID) - { - text_color = LLUIColorTable::instance().getColor("UserChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("AgentChatColor"); - } - } - break; - case CHAT_SOURCE_OBJECT: - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) - { - text_color = LLUIColorTable::instance().getColor("ScriptErrorColor"); - } - else if ( chat.mChatType == CHAT_TYPE_OWNER ) - { - text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("ObjectChatColor"); - } - break; - default: - text_color.setToWhite(); - } - - if (!chat.mPosAgent.isExactlyZero()) - { - LLVector3 pos_agent = gAgent.getPositionAgent(); - F32 distance = dist_vec(pos_agent, chat.mPosAgent); - if (distance > gAgent.getNearChatRadius()) - { - // diminish far-off chat - text_color.mV[VALPHA] = 0.8f; - } - } - } - - return text_color; -} - -void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& color) -{ - S32 font_size = gSavedSettings.getS32("ChatFontSize"); - - const LLFontGL* fontp = NULL; - switch(font_size) - { - case 0: - fontp = LLFontGL::getFontSansSerifSmall(); - break; - default: - case 1: - fontp = LLFontGL::getFontSansSerif(); - break; - case 2: - fontp = LLFontGL::getFontSansSerifBig(); - break; - } - - LLStyle::Params style_params; - style_params.color(color); - style_params.font(fontp); - LLUUID uuid = chat.mFromID; - std::string from = chat.mFromName; - std::string message = chat.mText; - mChatHistory->appendWidgetMessage(chat, style_params); -} - void LLNearbyChat::addMessage(const LLChat& chat) { - LLColor4 color = nearbychat_get_text_color(chat); - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) return; if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat")) { + + LLColor4 txt_color; + + LLViewerChat::getChatColor(chat,txt_color); + LLFloaterScriptDebug::addScriptLine(chat.mText, chat.mFromName, - color, + txt_color, chat.mFromID); return; } } - // could flash the chat button in the status bar here. JC if (!chat.mMuted) - add_timestamped_line(chat, color); + { + mChatHistory->appendWidgetMessage(chat); + } } void LLNearbyChat::onNearbySpeakers() |