diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2025-05-08 19:35:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-08 19:35:19 +0300 |
commit | 377d1b3813077619fc795f54f93b0d478cf03cbd (patch) | |
tree | ba4e63fc86345c4a51407abac1a1009c42c6abad | |
parent | 37134720bce619a754ff097aff764d9a44bb0893 (diff) |
#4010 Add audio ping for chat mentions
-rw-r--r-- | indra/newview/app_settings/settings.xml | 33 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llvieweraudio.cpp | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_chat.xml | 25 |
4 files changed, 65 insertions, 13 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1025c9299d..61d2013224 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6361,6 +6361,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>PlaySoundChatMention</key> + <map> + <key>Comment</key> + <string>Plays a sound when got mentioned in a chat</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>PluginAttachDebuggerToPlugins</key> <map> <key>Comment</key> @@ -12395,6 +12406,28 @@ <key>Value</key> <string>2ca849ba-2885-4bc3-90ef-d4987a5b983a</string> </map> + <key>UISndChatMention</key> + <map> + <key>Comment</key> + <string>Sound file for chat mention(uuid for sound asset)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>03e77cb5-592c-5b33-d271-2e46497c3fb3</string> + </map> + <key>UISndChatPing</key> + <map> + <key>Comment</key> + <string>Sound file for chat ping(uuid for sound asset)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>7dd36df6-2624-5438-f988-fdf8588a0ad9</string> + </map> <key>UISndClick</key> <map> <key>Comment</key> diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 23bba99ed6..6f085adcbd 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -199,6 +199,8 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) bool store_dnd_message = false; // flag storage of a dnd message bool is_session_focused = session_floater->isTornOff() && session_floater->hasFocus(); bool contains_mention = LLUrlRegistry::getInstance()->containsAgentMention(msg["message"].asString()); + static LLCachedControl<bool> play_snd_mention_pref(gSavedSettings, "PlaySoundChatMention", false); + bool play_snd_mention = contains_mention && play_snd_mention_pref && (msg["source_type"].asInteger() != CHAT_SOURCE_OBJECT); if (!LLFloater::isVisible(im_box) || im_box->isMinimized()) { conversations_floater_status = CLOSED; @@ -232,7 +234,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) else { user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); - if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM"))) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNearbyChatIM")) && !play_snd_mention) { make_ui_sound("UISndNewIncomingIMSession"); } @@ -243,7 +245,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) if (LLAvatarTracker::instance().isBuddy(participant_id)) { user_preferences = gSavedSettings.getString("NotificationFriendIMOptions"); - if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM"))) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundFriendIM")) && !play_snd_mention) { make_ui_sound("UISndNewIncomingIMSession"); } @@ -251,7 +253,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) else { user_preferences = gSavedSettings.getString("NotificationNonFriendIMOptions"); - if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM"))) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNonFriendIM")) && !play_snd_mention) { make_ui_sound("UISndNewIncomingIMSession"); } @@ -260,7 +262,7 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) else if (session->isAdHocSessionType()) { user_preferences = gSavedSettings.getString("NotificationConferenceIMOptions"); - if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM"))) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundConferenceIM")) && !play_snd_mention) { make_ui_sound("UISndNewIncomingIMSession"); } @@ -268,11 +270,18 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) else if(session->isGroupSessionType()) { user_preferences = gSavedSettings.getString("NotificationGroupChatOptions"); - if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM"))) + if (!gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundGroupChatIM")) && !play_snd_mention) { make_ui_sound("UISndNewIncomingIMSession"); } } + if (play_snd_mention) + { + if (!gAgent.isDoNotDisturb()) + { + make_ui_sound("UISndChatMention"); + } + } // actions: diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 404297c58f..aa0cbac91f 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -390,6 +390,7 @@ void init_audio() gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowClose"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowOpen"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndRestart"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndChatMention"))); } audio_update_volume(true); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 88716c7f96..0aa1af7de6 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -409,7 +409,7 @@ layout="topleft" left="0" name="play_sound" - width="100" + width="90" top_pad="8" visible="true"> Play sound: @@ -419,10 +419,10 @@ height="16" label="New conversation" layout="topleft" - left_pad="15" + left_pad="5" top_pad="-10" name="new_conversation" - width="150" /> + width="130" /> <check_box control_name="PlaySoundIncomingVoiceCall" height="16" @@ -430,16 +430,16 @@ layout="topleft" top_pad="6" name="incoming_voice_call" - width="150" /> + width="130" /> <check_box control_name="PlaySoundTeleportOffer" height="16" label="Teleport offer" layout="topleft" - left_pad="35" + left_pad="18" top_pad="-38" name="teleport_offer" - width="150" /> + width="130" /> <check_box control_name="PlaySoundInventoryOffer" height="16" @@ -447,14 +447,23 @@ layout="topleft" top_pad="6" name="inventory_offer" - width="150" /> + width="130" /> + <check_box + control_name="PlaySoundChatMention" + height="16" + label="Chat mention" + layout="topleft" + left_pad="7" + top_pad="-38" + name="chat_mention" + width="130" /> <view_border bevel_style="none" height="0" layout="topleft" left="0" name="cost_text_border" - top_pad="7" + top_pad="29" width="492"/> </panel> |