From 413c24bde85775b935f2331da10e5f4998ca4bec Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 20 Jan 2019 14:23:43 -0500 Subject: [PATCH] Bug Fix/Feature: Make the spam of radar on open/close and login optional Adds RadarAlertFlood and RadarAlertFloodLeaving RadarAlertFloodLeaving requires RadarAlertFlood Radar uses new announcements for these events. These settings are off by default, Find them in your local debug settings! --- indra/newview/app_settings/settings.xml | 22 +++++++++++++ indra/newview/llfloateravatarlist.cpp | 31 ++++++++++++------- indra/newview/llfloateravatarlist.h | 8 ++--- .../skins/default/xui/en-us/strings.xml | 2 ++ 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 15b0a927a..dbaa6406e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7790,6 +7790,28 @@ This should be as low as possible, but too low may break functionality Value 1 + RadarAlertFlood + + Comment + Show the flood of people arriving and (if RadarAlertFloodLeaving) leaving when you login and when you open/close the Radar with RadarKeepOpen off. + Persist + 1 + Type + Boolean + Value + 0 + + RadarAlertFloodLeaving + + Comment + When activated along with RadarAlertFlood shows the flood of people leaving when you close the Radar with RadarKeepOpen off. + Persist + 1 + Type + Boolean + Value + 0 + RadarAlertShowDist Comment diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 87c742e47..7c1c0e096 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -70,7 +70,7 @@ const S32& radar_namesystem() namespace { - void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering, const F32& dist) + void chat_avatar_status(const std::string& name, const LLUUID& key, ERadarStatType type, bool entering, const F32& dist, bool flood = false) { static LLCachedControl radar_chat_alerts(gSavedSettings, "RadarChatAlerts"); if (!radar_chat_alerts) return; @@ -82,6 +82,8 @@ namespace } // if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) return; // RLVa:LF Don't announce people are around when blind, that cheats the system. + static LLCachedControl radar_alert_flood(gSavedSettings, "RadarAlertFlood"); + if (flood && !radar_alert_flood) return; static LLCachedControl radar_alert_sim(gSavedSettings, "RadarAlertSim"); static LLCachedControl radar_alert_draw(gSavedSettings, "RadarAlertDraw"); static LLCachedControl radar_alert_shout_range(gSavedSettings, "RadarAlertShoutRange"); @@ -100,7 +102,7 @@ namespace default: llassert(type); break; } args["[NAME]"] = name; - args["[ACTION]"] = LLTrans::getString(entering ? "has_entered" : "has_left"); + args["[ACTION]"] = LLTrans::getString((entering ? "has_entered" : "has_left") + (flood ? "_flood" : LLStringUtil::null)); if (args.find("[RANGE]") != args.end()) chat.mText = LLTrans::getString("radar_alert_template", args); else if (chat.mText.empty()) return; @@ -144,7 +146,12 @@ LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string& name, LLAvatarListEntry::~LLAvatarListEntry() { - setPosition(mPosition, F32_MIN, false); // Dead and gone + static LLCachedControl radar_alert_flood_leaving(gSavedSettings, "RadarAlertFloodLeaving"); + bool cleanup = LLFloaterAvatarList::instance().isCleanup(); + if (radar_alert_flood_leaving || !cleanup) + { + setPosition(mPosition, F32_MIN, false, cleanup); // Dead and gone + } LLAvatarPropertiesProcessor::instance().removeObserver(mID, this); } @@ -185,17 +192,17 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) } } -void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, bool drawn) +void LLAvatarListEntry::setPosition(const LLVector3d& position, const F32& dist, bool drawn, bool flood) { mPosition = position; bool here(dist != F32_MIN); // F32_MIN only if dead bool this_sim(here && (gAgent.getRegion()->pointInRegionGlobal(position) || !(LLWorld::getInstance()->positionRegionValidGlobal(position)))); - if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim, dist); - if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn, dist); + if (this_sim != mStats[STAT_TYPE_SIM]) chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim, dist, flood); + if (drawn != mStats[STAT_TYPE_DRAW]) chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn, dist, flood); bool shoutrange(here && dist < LFSimFeatureHandler::getInstance()->shoutRange()); - if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange, dist); + if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange, dist, flood); bool chatrange(here && dist < LFSimFeatureHandler::getInstance()->sayRange()); - if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange, dist); + if (chatrange != mStats[STAT_TYPE_CHATRANGE]) chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange, dist, flood); } void LLAvatarListEntry::resetName(const bool& hide_tags, const bool& anon_names, const std::string& hidden) @@ -240,6 +247,8 @@ LLFloaterAvatarList::LLFloaterAvatarList() : LLFloater(std::string("radar")), LLFloaterAvatarList::~LLFloaterAvatarList() { + mCleanup = true; + mAvatars.clear(); } //static @@ -413,7 +422,7 @@ BOOL LLFloaterAvatarList::postBuild() mAvatarList->setSortChangedCallback(boost::bind(&LLFloaterAvatarList::onAvatarSortingChanged,this)); for (LLViewerRegion* region : LLWorld::instance().getRegionList()) { - updateAvatarList(region); + updateAvatarList(region, true); } assessColumns(); @@ -515,7 +524,7 @@ const F32& radar_range_radius() return radius; } -void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region) +void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region, bool first) { // Check whether updates are enabled if (!mUpdate) @@ -561,7 +570,7 @@ void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region) } // Announce position - entry->setPosition(position, (position - mypos).magVec(), avatarp); + entry->setPosition(position, (position - mypos).magVec(), avatarp, first); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 10397ffdf..0da776495 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -79,7 +79,7 @@ enum ACTIVITY_TYPE * Update world position. * Affects age. */ - void setPosition(const LLVector3d& position, const F32& dist, bool drawn); + void setPosition(const LLVector3d& position, const F32& dist, bool drawn, bool flood = false); const LLVector3d& getPosition() const { return mPosition; } @@ -202,7 +202,7 @@ public: /** * @brief Updates the internal avatar list with the currently present avatars. */ - void updateAvatarList(const class LLViewerRegion* region); + void updateAvatarList(const class LLViewerRegion* region, bool first = false); /** * @brief Refresh avatar list (display) @@ -318,8 +318,6 @@ public: static bool onConfirmRadarChatKeys(const LLSD& notification, const LLSD& response ); - static void callbackIdle(void *userdata); - void doCommand(avlist_command_t cmd, bool single = false) const; /** @@ -330,6 +328,7 @@ public: */ void expireAvatarList(const std::list& ids); void updateAvatarSorting(); + bool isCleanup() const { return mCleanup; } private: void setFocusAvatarInternal(const LLUUID& id); @@ -340,6 +339,7 @@ private: LLScrollListCtrl* mAvatarList; av_list_t mAvatars; bool mDirtyAvatarSorting; + bool mCleanup = false; /** * @brief true when Updating diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index 66e72db88..b34d3d165 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -3119,7 +3119,9 @@ Where tag = tag string to match. Removes bot's matching the tag. has triggered your avatar age alert has entered + is now detected in has left + is now off the radar for the sim draw distance