From 9fa80ef1991a12cafa2294ecb79c0c0913f41e5f Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sat, 11 Jun 2011 12:49:02 -0400 Subject: [PATCH] Radar improvement: Region Crossing chat alerts --- indra/newview/llpanelpeople.cpp | 25 ++++++++++++++++--- indra/newview/llpanelpeople.h | 2 ++ .../xui/en/menu_people_nearby_view_sort.xml | 10 ++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index e735c3fe6f..a69e5f0c43 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -976,9 +976,11 @@ void LLPanelPeople::updateNearbyList() if (lastRadarSweep.count(avId) == 0) { if (gSavedSettings.getBOOL("RadarReportChatRange") && (avRange <= CHAT_NORMAL_RADIUS)) - LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, llformat(" entered chat range (%3.2f m)",avRange))); + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, llformat(" entered chat range (%3.2f m).",avRange))); if (gSavedSettings.getBOOL("RadarReportDrawRange") && (avRange <= drawRadius)) - LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, llformat(" entered draw distance (%3.2f m)",avRange))); + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, llformat(" entered draw distance (%3.2f m).",avRange))); + if (gSavedSettings.getBOOL("RadarReportSimRange") && (avRegion == regionSelf)) + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, llformat(" entered the region (%3.2f m).",avRange))); if (gSavedSettings.getBOOL("RadarEnterChannelAlert") && (!mRadarAlertRequest)) { // Autodetect Phoenix chat UUID compatibility. @@ -1056,6 +1058,13 @@ void LLPanelPeople::updateNearbyList() else if ((avRange > drawRadius) && (rf.lastDistance <= drawRadius)) LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left draw distance.")); } + if (gSavedSettings.getBOOL("RadarReportSimRange")) + { + if ((avRegion == regionSelf) && (avRegion != rf.lastRegion)) + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " entered the region.")); + else if ((rf.lastRegion == regionSelf) && (avRegion != regionSelf)) + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left the region.")); + } } else if (lastRadarSweep.count(avId) > 1) // handle duplicates, from sim crossing oddness { @@ -1084,7 +1093,14 @@ void LLPanelPeople::updateNearbyList() LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " entered draw distance.")); else if ((avRange > drawRadius) && (rf.lastDistance <= drawRadius)) LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left draw distance.")); - } + } + if (gSavedSettings.getBOOL("RadarReportSimRange")) + { + if ((avRegion == regionSelf) && (avRegion != rf.lastRegion)) + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " entered the region.")); + else if ((rf.lastRegion == regionSelf) && (avRegion != regionSelf)) + LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left the region.")); + } } } @@ -1103,6 +1119,9 @@ void LLPanelPeople::updateNearbyList() LLAvatarNameCache::get(prevId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left chat range.")); if (gSavedSettings.getBOOL("RadarReportDrawRange") && (rf.lastDistance <= drawRadius)) LLAvatarNameCache::get(prevId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left draw distance.")); + if (gSavedSettings.getBOOL("RadarReportSimRange") && (rf.lastRegion == regionSelf)) + LLAvatarNameCache::get(prevId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, " left the region.")); + if (gSavedSettings.getBOOL("RadarLeaveChannelAlert")) mRadarLeaveAlerts.push_back(prevId); } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 60ed38a094..b9d775f8e9 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -46,6 +46,7 @@ class LLMenuButton; class LLMenuGL; const U32 MAX_AVATARS_PER_ALERT = 27; // maximum number of UUIDs we can cram into a single channel radar alert message +const U32 COARSE_OFFSET_INTERVAL = 31; // seconds after which we query the bridge for a coarse location adjustment const U32 NAMEFORMAT_DISPLAYNAME = 0; const U32 NAMEFORMAT_USERNAME = 1; const U32 NAMEFORMAT_DISPLAYNAME_USERNAME = 2; @@ -209,6 +210,7 @@ private: LLUUID lastRegion; time_t firstSeen; S32 lastStatus; + S32 coarseOffset; }; std::multimap < LLUUID, radarFields > lastRadarSweep; std::vector mRadarEnterAlerts; diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml index c99d2d23fe..2443091b0d 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -83,6 +83,16 @@ parameter="RadarReportChatRange" /> + + + + +