From 1bc3c10bed75272dbe9137609048a1aa7c678ffe Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 22 Aug 2024 11:17:01 +0800 Subject: Showing arrivals and departures can be toggled now and by default it's off. --- indra/newview/app_settings/settings.xml | 11 +++++++++ indra/newview/llvoavatar.cpp | 28 +++++++++++++--------- .../default/xui/en/menu_im_session_showmodes.xml | 8 +++++++ 3 files changed, 36 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index e03fc429bf..727d5f25ec 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -67,6 +67,17 @@ Boolean Value 1 + + IMShowArrivalsDepartures + + Comment + Enable(disable) showing of arrivals and departures in the chat. + Persist + 1 + Type + Boolean + Value + 0 CrashHostUrl diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 62884ecb3c..4aafe1b1fb 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -812,7 +812,10 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - LLNotificationsUI::LLNotificationManager::instance().onChat(LLChat{llformat("%s left.", getFullname().c_str())}, LLSD{}); + if (gSavedSettings.getBOOL("IMShowArrivalsDepartures") && !getFullname().empty()) + { + LLNotificationsUI::LLNotificationManager::instance().onChat(LLChat{llformat("%s left.", getFullname().c_str())}, LLSD{}); + } if (!mFullyLoaded) { debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); @@ -2464,18 +2467,21 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, { mDebugExistenceTimer.reset(); debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); - uuid_vec_t uuids; - std::vector positions; - LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange")); - auto pos_it = positions.begin(); - auto id_it = uuids.begin(); - for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it) + if (gSavedSettings.getBOOL("IMShowArrivalsDepartures")) { - if (*id_it == getID() && !isSelf()) + uuid_vec_t uuids; + std::vector positions; + LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange")); + auto pos_it = positions.begin(); + auto id_it = uuids.begin(); + for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it) { - LLNotificationsUI::LLNotificationManager::instance() - .onChat(LLChat{llformat("%s arrived (%.1f m).", getFullname().c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))}, LLSD{}); - break; + if (*id_it == getID() && !isSelf()) + { + LLNotificationsUI::LLNotificationManager::instance() + .onChat(LLChat{llformat("%s arrived (%.1f m).", getFullname().c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))}, LLSD{}); + break; + } } } } diff --git a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml index 94022ef1e3..f1cf8b9995 100644 --- a/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml +++ b/indra/newview/skins/default/xui/en/menu_im_session_showmodes.xml @@ -46,4 +46,12 @@ function="IMSession.Menu.ShowModes.Enable" parameter="IMShowNamesForP2PConv" /> + + + + -- cgit v1.2.3