summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-20 21:33:20 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-20 21:46:56 +0800
commit1bd4836e7c36f3c1ee4a821c39f78ca1397e3291 (patch)
tree55e25c151c31bd6c97504acc7b63450a9dea6001
parent9c79b4a04e4afe5b84448dbf8f7f6b95e4c84462 (diff)
Arrival, distance & leaving notifs in local chat
https://megapahit.com/show_bug.cgi?id=49 The LLVOAvatar class doesn't seem to have a display name getter.
-rw-r--r--indra/newview/llvoavatar.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index d7382eaac6..62884ecb3c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -70,6 +70,7 @@
#include "llmeshrepository.h"
#include "llmutelist.h"
#include "llmoveview.h"
+#include "llnotificationmanager.h"
#include "llnotificationsutil.h"
#include "llphysicsshapebuilderutil.h"
#include "llquantize.h"
@@ -811,6 +812,7 @@ 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 (!mFullyLoaded)
{
debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
@@ -2462,6 +2464,20 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
{
mDebugExistenceTimer.reset();
debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived");
+ uuid_vec_t uuids;
+ std::vector<LLVector3d> 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 (*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;
+ }
+ }
}
if(retval & LLViewerObject::INVALID_UPDATE)