From bca8f830f20f0e984163a577fb194401d7202c14 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 24 Apr 2013 14:15:00 -0400 Subject: [PATCH] Group Feature Request: Optionally display indicator over typing avatar's heads. Adds Debug Setting UseTypingBubbles Adds "Use overhead typing indicator bubbles" to Adv. Chat-> Chat/IM Thanks to Firestorm for this simple addition --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/ascentprefschat.cpp | 2 ++ indra/newview/ascentprefschat.h | 1 + indra/newview/llvoavatar.cpp | 19 +++++++++++++++---- indra/newview/llvoavatar.h | 1 + .../en-us/panel_preferences_ascent_chat.xml | 1 + 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 17aaf4c42..d62dc5bd6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -15173,6 +15173,17 @@ This should be as low as possible, but too low may break functionality Value 0 + UseTypingBubbles + + Comment + Show typing indicator in avatar nametags + Persist + 1 + Type + Boolean + Value + 0 + UseDebugMenus Comment diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 599ab0c66..f24724279 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -329,6 +329,7 @@ void LLPrefsAscentChat::refreshValues() mHideTypingNotification = gSavedSettings.getBOOL("AscentHideTypingNotification"); mShowGroupNameInChatIM = gSavedSettings.getBOOL("OptionShowGroupNameInChatIM"); mShowDisplayNameChanges = gSavedSettings.getBOOL("ShowDisplayNameChanges"); + mUseTypingBubbles = gSavedSettings.getBOOL("UseTypingBubbles"); mPlayTypingSound = gSavedSettings.getBOOL("PlayTypingSound"); mHideNotificationsInChat = gSavedSettings.getBOOL("HideNotificationsInChat"); mEnableMUPose = gSavedSettings.getBOOL("AscentAllowMUpose"); @@ -545,6 +546,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("AscentHideTypingNotification", mHideTypingNotification); gSavedSettings.setBOOL("OptionShowGroupNameInChatIM", mShowGroupNameInChatIM); gSavedSettings.setBOOL("ShowDisplayNameChanges", mShowDisplayNameChanges); + gSavedSettings.setBOOL("UseTypingBubbles", mUseTypingBubbles); gSavedSettings.setBOOL("PlayTypingSound", mPlayTypingSound); gSavedSettings.setBOOL("HideNotificationsInChat", mHideNotificationsInChat); gSavedSettings.setBOOL("AscentAllowMUpose", mEnableMUPose); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index 291645b42..04fa1a69c 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -66,6 +66,7 @@ protected: BOOL mHideTypingNotification; BOOL mShowGroupNameInChatIM; bool mShowDisplayNameChanges; + bool mUseTypingBubbles; BOOL mPlayTypingSound; BOOL mHideNotificationsInChat; BOOL mEnableMUPose; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1044f1f59..843c9ad81 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2830,14 +2830,17 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) static const LLCachedControl NAME_SHOW_TIME("RenderNameShowTime",10); // seconds static const LLCachedControl FADE_DURATION("RenderNameFadeDuration",1); // seconds static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); + static const LLCachedControl use_typing_bubbles("UseTypingBubbles"); static const LLCachedControl render_name_hide_self("RenderNameHideSelf",false); static const LLCachedControl allow_nameplate_override ("CCSAllowNameplateOverride", true); -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b +// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); // [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = use_chat_bubbles && (mChats.size() || mTyping); + bool visible_typing = use_typing_bubbles && mTyping; BOOL render_name = visible_chat || + visible_typing || (visible_avatar && // [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-1.0.0h ( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) && @@ -2871,6 +2874,11 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mVisibleChat = visible_chat; new_name = TRUE; } + if (visible_typing != mVisibleTyping) + { + mVisibleTyping = visible_typing; + new_name = true; + } // [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b if (fRlvShowNames) @@ -2895,7 +2903,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (mAppAngle > 5.f) { const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION; - if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) + if (!visible_chat && !visible_typing && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) { alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION; } @@ -3271,7 +3279,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) new_name = TRUE; } - if (mVisibleChat) + if (mVisibleChat || mVisibleTyping) { mNameText->setFont(LLFontGL::getFontSansSerif()); mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_LEFT); @@ -3281,6 +3289,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->clearString(); LLColor4 new_chat = gColors.getColor( "AvatarNameColor" ); + if (mVisibleChat) + { LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) @@ -3320,6 +3330,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) mNameText->addLine(chat_iter->mText, old_chat, style); } } + } mNameText->setVisibleOffScreen(TRUE); if (mTyping) @@ -3351,7 +3362,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) void LLVOAvatar::addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font) { llassert(mNameText); - if (mVisibleChat) + if (mVisibleChat || mVisibleTyping) { mNameText->addLabel(line); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index b4f8f12f0..90d9bcd62 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -814,6 +814,7 @@ public: void stopTyping() { mTyping = FALSE; mIdleTimer.reset();} private: BOOL mVisibleChat; + bool mVisibleTyping; //-------------------------------------------------------------------- // Lip synch morphs diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index d2bb0c5a5..b1910f032 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -24,6 +24,7 @@ + Show links on chatting object names in chat history for: