diff options
| author | Merov Linden <merov@lindenlab.com> | 2011-05-07 11:01:58 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2011-05-07 11:01:58 -0700 |
| commit | 460aa3ade72fe999eebccb390ae371dfdfeaf125 (patch) | |
| tree | 0f74ec821139deb23057956e89ef7d814c82c671 /indra/newview/llviewerchat.cpp | |
| parent | c03eb76bcf66665ee8a7618dbec0d13e3fc66c32 (diff) | |
| parent | 51c779b5e832a0c303b4c84c7263c7fed3bd9b30 (diff) | |
Merge with viewer-experience
Diffstat (limited to 'indra/newview/llviewerchat.cpp')
| -rw-r--r-- | indra/newview/llviewerchat.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 286b16bab2..e7a0d17c3a 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -36,6 +36,7 @@ #include "llinstantmessage.h" //SYSTEM_FROM // LLViewerChat +LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal; //static void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) @@ -89,8 +90,9 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) if (!chat.mPosAgent.isExactlyZero()) { LLVector3 pos_agent = gAgent.getPositionAgent(); - F32 distance = dist_vec(pos_agent, chat.mPosAgent); - if (distance > gAgent.getNearChatRadius()) + F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent); + F32 dist_near_chat = gAgent.getNearChatRadius(); + if (distance_squared > dist_near_chat * dist_near_chat) { // diminish far-off chat r_color.mV[VALPHA] = 0.8f; @@ -154,8 +156,9 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F if (!chat.mPosAgent.isExactlyZero()) { LLVector3 pos_agent = gAgent.getPositionAgent(); - F32 distance = dist_vec(pos_agent, chat.mPosAgent); - if (distance > gAgent.getNearChatRadius()) + F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent); + F32 dist_near_chat = gAgent.getNearChatRadius(); + if (distance_squared > dist_near_chat * dist_near_chat) { // diminish far-off chat r_color_alpha = 0.8f; @@ -256,3 +259,16 @@ std::string LLViewerChat::getObjectImSLURL(const LLChat& chat, const LLSD& args) return url; } + +//static +boost::signals2::connection LLViewerChat::setFontChangedCallback(const font_change_signal_t::slot_type& cb) +{ + return sChatFontChangedSignal.connect(cb); +} + +//static +void LLViewerChat::signalChatFontChanged() +{ + // Notify all observers that our font has changed + sChatFontChangedSignal(getChatFont()); +} |
