From 414ffb3a94cc3562e82bcbe717e7111042281279 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 20 Jul 2013 13:59:15 -0400 Subject: [PATCH 01/11] Further attempt to fix Issue 929 by having the appearance manager remove the attached bridge item --- indra/newview/llvoavatar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5fce8e843..f87fdba79 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6211,6 +6211,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge")) { llinfos << "Bridge detected! detaching" << llendl; + LLAppearanceMgr::getInstance()->removeItemFromAvatar(viewer_object->getAttachmentItemID()); return 0; } // attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) From 72a335daf01e89571d7e3cbc8dfda031c6aaf33a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 20 Jul 2013 22:52:50 -0400 Subject: [PATCH 02/11] [Radar] Move avatar age block into processProperties as this is more logical --- indra/newview/llfloateravatarlist.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index e96abc908..4f69d1fc1 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -200,6 +200,15 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) int year, month, day; sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d",&month,&day,&year); mAge = (day_clock::local_day() - date(year, month, day)).days(); + if (!mAgeAlert && mAge >= 0) //Only announce age once per entry. + { + static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); + if ((U32)mAge < sAvatarAgeAlertDays) + { + mAgeAlert = true; + chat_avatar_status(mName, mID, ALERT_TYPE_AGE, true); + } + } // If one wanted more information that gets displayed on profiles to be displayed, here would be the place to do it. } } @@ -594,15 +603,6 @@ void LLFloaterAvatarList::updateAvatarList() LLAvatarListEntry* entry = getAvatarEntry(avid); - if (entry && !entry->mAgeAlert && entry->mAge >= 0) //Only announce age once per entry. - { - static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); - if ((U32)entry->mAge < sAvatarAgeAlertDays) - { - entry->mAgeAlert = true; - chat_avatar_status(entry->getName().c_str(), avid, ALERT_TYPE_AGE, true); - } - } LLVector3d position; LLVOAvatar* avatarp = gObjectList.findAvatar(avid); From 98813c75f34dde731de081741feaeb96229adea9 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 20 Jul 2013 23:02:14 -0400 Subject: [PATCH 03/11] [Radar] Remove duplicate code from updateAvatarList that was already performed during LLWorld::getAvatars --- indra/newview/llfloateravatarlist.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 4f69d1fc1..e1002f43d 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -571,19 +571,6 @@ void LLFloaterAvatarList::updateAvatarList() LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX); - sorted_avatar_ids = avatar_ids; - std::sort(sorted_avatar_ids.begin(), sorted_avatar_ids.end()); - - BOOST_FOREACH(std::vector::value_type& iter, LLCharacter::sInstances) - { - LLUUID avid = iter->getID(); - - if (!std::binary_search(sorted_avatar_ids.begin(), sorted_avatar_ids.end(), avid)) - { - avatar_ids.push_back(avid); - } - } - size_t i; size_t count = avatar_ids.size(); @@ -595,11 +582,6 @@ void LLFloaterAvatarList::updateAvatarList() std::string name; const LLUUID &avid = avatar_ids[i]; - if (avid.isNull()) - { - //llinfos << "Key empty for avatar " << name << llendl; - continue; - } LLAvatarListEntry* entry = getAvatarEntry(avid); @@ -609,14 +591,6 @@ void LLFloaterAvatarList::updateAvatarList() if (avatarp) { - // Skip if avatar is dead(what's that?) - // or if the avatar is ourselves. - // or if the avatar is a dummy - if (avatarp->isDead() || avatarp->isSelf() || avatarp->mIsDummy) - { - continue; - } - // Get avatar data position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition()); name = avatarp->getFullname(); From 2d55b1ab1c06f93b0b6f6332ac031de768d1fdb8 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 20 Jul 2013 23:07:04 -0400 Subject: [PATCH 04/11] [Radar] Condense updateAvatarList to have less duplicate code --- indra/newview/llfloateravatarlist.cpp | 99 ++++++++------------------- 1 file changed, 28 insertions(+), 71 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index e1002f43d..ac6cef81e 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -547,28 +547,13 @@ void LLFloaterAvatarList::updateAvatarList() //todo: make this less of a hacked up copypasta from dales 1.18. - if(gAudiop != NULL) - { - LLAudioEngine::source_map::iterator iter; - for (iter = gAudiop->mAllSources.begin(); iter != gAudiop->mAllSources.end(); ++iter) - { - LLAudioSource *sourcep = iter->second; - LLUUID uuid = sourcep->getOwnerID(); - LLAvatarListEntry *ent = getAvatarEntry(uuid); - if ( ent ) - { - ent->setActivity(LLAvatarListEntry::ACTIVITY_SOUND); - } - } - } - - LLVector3d mypos = gAgent.getPositionGlobal(); { std::vector avatar_ids; std::vector sorted_avatar_ids; std::vector positions; + LLVector3d mypos = gAgent.getPositionGlobal(); LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX); size_t i; @@ -579,80 +564,52 @@ void LLFloaterAvatarList::updateAvatarList() for (i = 0; i < count; ++i) { - std::string name; const LLUUID &avid = avatar_ids[i]; + std::string name; + if (!LLAvatarNameCache::getPNSName(avid, name)) + continue; //prevent (Loading...) LLAvatarListEntry* entry = getAvatarEntry(avid); + LLVector3d position = positions[i]; - LLVector3d position; LLVOAvatar* avatarp = gObjectList.findAvatar(avid); - if (avatarp) { // Get avatar data position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition()); - name = avatarp->getFullname(); - - if (!LLAvatarNameCache::getPNSName(avatarp->getID(), name)) - continue; - - //duped for lower section - if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0)) - { - if (!gCacheName->getFullName(avid, name)) //seems redudant with LLAvatarNameCache::getPNSName above... - { - continue; - } - } - - if (entry) - { - // Avatar already in list, update position - F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, (avatarp->getRegion() == gAgent.getRegion()), true, dist < 20.0, dist < 100.0); - if(avatarp->isTyping())entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); - } - else - { - // Avatar not there yet, add it - if(announce && avatarp->getRegion() == gAgent.getRegion()) - announce_keys.push(avid); - mAvatars.push_back(LLAvatarListEntryPtr(new LLAvatarListEntry(avid, name, position))); - } } - else + + if (!entry) { - if (i < positions.size()) - { - position = positions[i]; - } - else - { - continue; - } + // Avatar not there yet, add it + if(announce && gAgent.getRegion()->pointInRegionGlobal(position)) + announce_keys.push(avid); + mAvatars.push_back(LLAvatarListEntryPtr(entry = new LLAvatarListEntry(avid, name, position))); + } - if (!LLAvatarNameCache::getPNSName(avid, name)) - { - //name = gCacheName->getDefaultName(); - continue; //prevent (Loading...) - } + // Announce position + F32 dist = (F32)(position - mypos).magVec(); + entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 100.0); - if (entry) + // Mark as typing if they are typing + if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); + } + + // Set activity for anyone making sounds + if (gAudiop) + { + for (LLAudioEngine::source_map::iterator iter = gAudiop->mAllSources.begin(); iter != gAudiop->mAllSources.end(); ++iter) + { + LLAudioSource* sourcep = iter->second; + if (LLAvatarListEntry* entry = getAvatarEntry(sourcep->getOwnerID())) { - // Avatar already in list, update position - F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), false, dist < 20.0, dist < 100.0); - } - else - { - if(announce && gAgent.getRegion()->pointInRegionGlobal(position)) - announce_keys.push(avid); - mAvatars.push_back(LLAvatarListEntryPtr(new LLAvatarListEntry(avid, name, position))); + entry->setActivity(LLAvatarListEntry::ACTIVITY_SOUND); } } } + //let us send the keys in a more timely fashion if (announce && !announce_keys.empty()) { From 6fb68b491329d2ee1f79d6a2b999b590583e4d14 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 20 Jul 2013 23:16:29 -0400 Subject: [PATCH 05/11] [Radar] Add a debug setting RadarRangeRadius to limit how far away avatars showing up on radar can be (0, the default, is unlimited) --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llfloateravatarlist.cpp | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aab81f293..c042fc3fd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6964,6 +6964,17 @@ This should be as low as possible, but too low may break functionality Value 0 + RadarRangeRadius + + Comment + How far away avatars on the radar can be, 0 for no limit + Persist + 1 + Type + F32 + Value + 0 + RadarUpdateEnabled Comment diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index ac6cef81e..e72292f15 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -554,7 +554,8 @@ void LLFloaterAvatarList::updateAvatarList() std::vector positions; LLVector3d mypos = gAgent.getPositionGlobal(); - LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX); + static const LLCachedControl radar_range_radius("RadarRangeRadius", 0); + LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, radar_range_radius ? radar_range_radius : F32_MAX); size_t i; size_t count = avatar_ids.size(); From 82c37ca9a31941f03adf0bfe99deefb9527fe9b4 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 01:24:58 -0400 Subject: [PATCH 06/11] [Radar] Remove unused member mDrawPosition --- indra/newview/llfloateravatarlist.cpp | 11 +---------- indra/newview/llfloateravatarlist.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index e72292f15..76cc835b6 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -168,7 +168,7 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool } //namespace LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string &name, const LLVector3d &position) : - mID(id), mName(name), mPosition(position), mDrawPosition(), mMarked(false), mFocused(false), + mID(id), mName(name), mPosition(position), mMarked(false), mFocused(false), mUpdateTimer(), mFrame(gFrameCount), mInSimFrame(U32_MAX), mInDrawFrame(U32_MAX), mInChatFrame(U32_MAX), mInShoutFrame(U32_MAX), mActivityType(ACTIVITY_NEW), mActivityTimer(), @@ -216,15 +216,6 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) void LLAvatarListEntry::setPosition(LLVector3d position, bool this_sim, bool drawn, bool chatrange, bool shoutrange) { - if (drawn) - { - mDrawPosition = position; - } - else if (mInDrawFrame == U32_MAX) - { - mDrawPosition.setZero(); - } - mPosition = position; mFrame = gFrameCount; diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 2ad3de090..c06051dd2 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -143,7 +143,6 @@ private: std::string mName; time_t mTime; LLVector3d mPosition; - LLVector3d mDrawPosition; bool mMarked; bool mFocused; bool mIsInList; From 3650a564079d6ad6fd728305f5486cf5aef48b44 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 02:06:57 -0400 Subject: [PATCH 07/11] [Radar] Remove id null checks where null id is an impossibility due to earlier checks --- indra/newview/llfloateravatarlist.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 76cc835b6..e03d24225 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -174,17 +174,13 @@ LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string &name, mActivityType(ACTIVITY_NEW), mActivityTimer(), mIsInList(false), mAge(-1), mAgeAlert(false), mTime(time(NULL)) { - if (mID.notNull()) - { - LLAvatarPropertiesProcessor::getInstance()->addObserver(mID, this); - LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(mID); - } + LLAvatarPropertiesProcessor::getInstance()->addObserver(mID, this); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(mID); } LLAvatarListEntry::~LLAvatarListEntry() { - if (mID.notNull()) - LLAvatarPropertiesProcessor::getInstance()->removeObserver(mID, this); + LLAvatarPropertiesProcessor::getInstance()->removeObserver(mID, this); } // virtual @@ -764,12 +760,6 @@ void LLFloaterAvatarList::refreshAvatarList() continue; } - if (av_id.isNull()) - { - //llwarns << "Avatar with null key somehow got into the list!" << llendl; - continue; - } - element.value = av_id; LLScrollListCell::Params mark; From 845088166a284a3892fb342dd211f91eeb0ac3b7 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 04:43:01 -0400 Subject: [PATCH 08/11] [Radar] Switch from using frames in keeping track of ranges to using a bitset Renames ALERT_TYPE_* to STAT_TYPE_* and ERadarAlertType to ERadarStatType Removes mIn*Frame and accessors for these in favor of checking for the bit in mStats Use mStats instead of mAgeAlert now. Moves the range leave handling out of getAlive and into setPosition, where it logically belongs Should fix Issue 43: Radar reports multiple times for agent entry upon rendering --- indra/newview/llfloateravatarlist.cpp | 96 ++++++++------------------- indra/newview/llfloateravatarlist.h | 29 ++++---- 2 files changed, 43 insertions(+), 82 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index e03d24225..1d6758273 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -73,18 +73,9 @@ const F32 DEAD_KEEP_TIME = 10.0f; extern U32 gFrameCount; -typedef enum e_radar_alert_type -{ - ALERT_TYPE_SIM = 1, - ALERT_TYPE_DRAW = 2, - ALERT_TYPE_SHOUTRANGE = 4, - ALERT_TYPE_CHATRANGE = 8, - ALERT_TYPE_AGE = 16, -} ERadarAlertType; - namespace { -void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool entering) +void chat_avatar_status(std::string name, LLUUID key, ERadarStatType type, bool entering) { if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return; //RLVa:LF Don't announce people are around when blind, that cheats the system. static LLCachedControl radar_chat_alerts(gSavedSettings, "RadarChatAlerts"); @@ -100,35 +91,35 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool args["[NAME]"] = name; switch(type) { - case ALERT_TYPE_SIM: + case STAT_TYPE_SIM: if (radar_alert_sim) { args["[RANGE]"] = self->getString("the_sim"); } break; - case ALERT_TYPE_DRAW: + case STAT_TYPE_DRAW: if (radar_alert_draw) { args["[RANGE]"] = self->getString("draw_distance"); } break; - case ALERT_TYPE_SHOUTRANGE: + case STAT_TYPE_SHOUTRANGE: if (radar_alert_shout_range) { args["[RANGE]"] = self->getString("shout_range"); } break; - case ALERT_TYPE_CHATRANGE: + case STAT_TYPE_CHATRANGE: if (radar_alert_chat_range) { args["[RANGE]"] = self->getString("chat_range"); } break; - case ALERT_TYPE_AGE: + case STAT_TYPE_AGE: if (radar_alert_age) { LLChat chat; @@ -139,6 +130,9 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool LLFloaterChat::addChat(chat); } break; + default: + llassert(type); + break; } if (args.find("[RANGE]") != args.end()) { @@ -169,10 +163,9 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string &name, const LLVector3d &position) : mID(id), mName(name), mPosition(position), mMarked(false), mFocused(false), - mUpdateTimer(), mFrame(gFrameCount), mInSimFrame(U32_MAX), mInDrawFrame(U32_MAX), - mInChatFrame(U32_MAX), mInShoutFrame(U32_MAX), + mUpdateTimer(), mFrame(gFrameCount), mStats(), mActivityType(ACTIVITY_NEW), mActivityTimer(), - mIsInList(false), mAge(-1), mAgeAlert(false), mTime(time(NULL)) + mIsInList(false), mAge(-1), mTime(time(NULL)) { LLAvatarPropertiesProcessor::getInstance()->addObserver(mID, this); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(mID); @@ -196,13 +189,12 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type) int year, month, day; sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d",&month,&day,&year); mAge = (day_clock::local_day() - date(year, month, day)).days(); - if (!mAgeAlert && mAge >= 0) //Only announce age once per entry. + if (!mStats[STAT_TYPE_AGE] && mAge >= 0) //Only announce age once per entry. { static const LLCachedControl sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays"); if ((U32)mAge < sAvatarAgeAlertDays) { - mAgeAlert = true; - chat_avatar_status(mName, mID, ALERT_TYPE_AGE, true); + chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true); } } // If one wanted more information that gets displayed on profiles to be displayed, here would be the place to do it. @@ -215,37 +207,22 @@ void LLAvatarListEntry::setPosition(LLVector3d position, bool this_sim, bool dra mPosition = position; mFrame = gFrameCount; - if (this_sim) + + if (this_sim != mStats[STAT_TYPE_SIM]) { - if (mInSimFrame == U32_MAX) - { - chat_avatar_status(mName, mID, ALERT_TYPE_SIM, true); - } - mInSimFrame = mFrame; + chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim); } - if (drawn) + if (drawn != mStats[STAT_TYPE_DRAW]) { - if (mInDrawFrame == U32_MAX) - { - chat_avatar_status(mName, mID, ALERT_TYPE_DRAW, true); - } - mInDrawFrame = mFrame; + chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn); } - if (shoutrange) + if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE]) { - if (mInShoutFrame == U32_MAX) - { - chat_avatar_status(mName, mID, ALERT_TYPE_SHOUTRANGE, true); - } - mInShoutFrame = mFrame; + chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange); } - if (chatrange) + if (chatrange != mStats[STAT_TYPE_CHATRANGE]) { - if (mInChatFrame == U32_MAX) - { - chat_avatar_status(mName, mID, ALERT_TYPE_CHATRANGE, true); - } - mInChatFrame = mFrame; + chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange); } mUpdateTimer.start(); @@ -254,26 +231,6 @@ void LLAvatarListEntry::setPosition(LLVector3d position, bool this_sim, bool dra bool LLAvatarListEntry::getAlive() { U32 current = gFrameCount; - if (mInSimFrame != U32_MAX && (current - mInSimFrame) >= 2) - { - mInSimFrame = U32_MAX; - chat_avatar_status(mName, mID, ALERT_TYPE_SIM, false); - } - if (mInDrawFrame != U32_MAX && (current - mInDrawFrame) >= 2) - { - mInDrawFrame = U32_MAX; - chat_avatar_status(mName, mID, ALERT_TYPE_DRAW, false); - } - if (mInShoutFrame != U32_MAX && (current - mInShoutFrame) >= 2) - { - mInShoutFrame = U32_MAX; - chat_avatar_status(mName, mID, ALERT_TYPE_SHOUTRANGE, false); - } - if (mInChatFrame != U32_MAX && (current - mInChatFrame) >= 2) - { - mInChatFrame = U32_MAX; - chat_avatar_status(mName, mID, ALERT_TYPE_CHATRANGE, false); - } return ((current - mFrame) <= 2); } @@ -579,7 +536,7 @@ void LLFloaterAvatarList::updateAvatarList() // Announce position F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 100.0); + entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 96.0); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); @@ -659,6 +616,7 @@ void LLFloaterAvatarList::expireAvatarList() } else { + entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone if(mAvatars.back() == *it) { mAvatars.pop_back(); @@ -837,7 +795,7 @@ void LLFloaterAvatarList::refreshAvatarList() if (UnknownAltitude) { strcpy(temp, "?"); - if (entry->isDrawn()) + if (entry->mStats[STAT_TYPE_DRAW]) { color = sRadarTextDrawDist; } @@ -858,7 +816,7 @@ void LLFloaterAvatarList::refreshAvatarList() } else { - if (entry->isDrawn()) + if (entry->mStats[STAT_TYPE_DRAW]) { color = sRadarTextDrawDist; } @@ -1646,7 +1604,7 @@ void LLFloaterAvatarList::onSelectName() LLAvatarListEntry* entry = getAvatarEntry(agent_id); if (entry) { - BOOL enabled = entry->isDrawn(); + BOOL enabled = entry->mStats[STAT_TYPE_DRAW]; childSetEnabled("focus_btn", enabled); childSetEnabled("prev_in_list_btn", enabled); childSetEnabled("next_in_list_btn", enabled); diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index c06051dd2..7b7291e21 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -19,6 +19,7 @@ #include "llscrolllistctrl.h" #include +#include #include #include @@ -26,6 +27,16 @@ class LLFloaterAvatarList; +enum ERadarStatType +{ + STAT_TYPE_SIM, + STAT_TYPE_DRAW, + STAT_TYPE_SHOUTRANGE, + STAT_TYPE_CHATRANGE, + STAT_TYPE_AGE, + STAT_TYPE_SIZE +}; + /** * @brief This class is used to hold data about avatars. * We cache data about avatars to avoid repeating requests in this class. @@ -109,10 +120,6 @@ enum ACTIVITY_TYPE bool isMarked() const { return mMarked; } - bool isDrawn() const { return (mInDrawFrame != U32_MAX); } - - bool isInSim() const { return (mInSimFrame != U32_MAX); } - /** * @brief 'InList' signifies that the entry has been displayed in the floaters avatar list * Until this happens our focusprev/focusnext logic should ignore this entry. @@ -146,9 +153,13 @@ private: bool mMarked; bool mFocused; bool mIsInList; - bool mAgeAlert; int mAge; + /** + * @brief Bitset to keep track of what stats still hold true about the avatar + */ + std::bitset mStats; + /** * @brief Timer to keep track of whether avatars are still there */ @@ -163,14 +174,6 @@ private: * @brief Last frame when this avatar was updated */ U32 mFrame; - //last frame when this avatar was in sim - U32 mInSimFrame; - //last frame when this avatar was in draw - U32 mInDrawFrame; - //last frame when this avatar was in shout range - U32 mInShoutFrame; - //last frame when this avatar was in chat range - U32 mInChatFrame; }; From 799b5408e413d281b967f62898f1a4956e9a159f Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 04:57:33 -0400 Subject: [PATCH 09/11] [Radar] Fix up expireAvatarList to actually expire all the dead avatar entries, not just the back one. --- indra/newview/llfloateravatarlist.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 1d6758273..d5820df38 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -617,15 +617,7 @@ void LLFloaterAvatarList::expireAvatarList() else { entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone - if(mAvatars.back() == *it) - { - mAvatars.pop_back(); - return; - } - *it = mAvatars.back(); - mAvatars.pop_back(); - if(mAvatars.empty()) - return; + mAvatars.erase(it); } } } From f98f1e9f5d55a5c47756a1aec918286441dfbe4d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 09:59:35 -0400 Subject: [PATCH 10/11] [Radar] In expireAvatarList, use the return value of erase --- indra/newview/llfloateravatarlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index d5820df38..2ed61cf89 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -617,7 +617,7 @@ void LLFloaterAvatarList::expireAvatarList() else { entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone - mAvatars.erase(it); + it = mAvatars.erase(it); } } } From c3b4ceff971e56ea56292fa4d69cf508e44f225e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 21 Jul 2013 12:48:57 -0400 Subject: [PATCH 11/11] Fix venusmari's issue of not being able to drag and drop calling cards to people via profile or IM --- indra/newview/lltooldraganddrop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index fe41db3a6..a97711e4e 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1618,6 +1618,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + case DAD_CALLINGCARD: { LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; if(gInventory.getItem(inv_item->getUUID()) @@ -1662,7 +1663,6 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ } break; } - case DAD_CALLINGCARD: default: *accept = ACCEPT_NO; break;