Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer
This commit is contained in:
@@ -6964,6 +6964,17 @@ This should be as low as possible, but too low may break functionality</string>
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>RadarRangeRadius</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>How far away avatars on the radar can be, 0 for no limit</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>F32</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<real>0</real>
|
||||||
|
</map>
|
||||||
<key>RadarUpdateEnabled</key>
|
<key>RadarUpdateEnabled</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -73,18 +73,9 @@ const F32 DEAD_KEEP_TIME = 10.0f;
|
|||||||
|
|
||||||
extern U32 gFrameCount;
|
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
|
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.
|
if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) return; //RLVa:LF Don't announce people are around when blind, that cheats the system.
|
||||||
static LLCachedControl<bool> radar_chat_alerts(gSavedSettings, "RadarChatAlerts");
|
static LLCachedControl<bool> radar_chat_alerts(gSavedSettings, "RadarChatAlerts");
|
||||||
@@ -100,35 +91,35 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool
|
|||||||
args["[NAME]"] = name;
|
args["[NAME]"] = name;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case ALERT_TYPE_SIM:
|
case STAT_TYPE_SIM:
|
||||||
if (radar_alert_sim)
|
if (radar_alert_sim)
|
||||||
{
|
{
|
||||||
args["[RANGE]"] = self->getString("the_sim");
|
args["[RANGE]"] = self->getString("the_sim");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALERT_TYPE_DRAW:
|
case STAT_TYPE_DRAW:
|
||||||
if (radar_alert_draw)
|
if (radar_alert_draw)
|
||||||
{
|
{
|
||||||
args["[RANGE]"] = self->getString("draw_distance");
|
args["[RANGE]"] = self->getString("draw_distance");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALERT_TYPE_SHOUTRANGE:
|
case STAT_TYPE_SHOUTRANGE:
|
||||||
if (radar_alert_shout_range)
|
if (radar_alert_shout_range)
|
||||||
{
|
{
|
||||||
args["[RANGE]"] = self->getString("shout_range");
|
args["[RANGE]"] = self->getString("shout_range");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALERT_TYPE_CHATRANGE:
|
case STAT_TYPE_CHATRANGE:
|
||||||
if (radar_alert_chat_range)
|
if (radar_alert_chat_range)
|
||||||
{
|
{
|
||||||
args["[RANGE]"] = self->getString("chat_range");
|
args["[RANGE]"] = self->getString("chat_range");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALERT_TYPE_AGE:
|
case STAT_TYPE_AGE:
|
||||||
if (radar_alert_age)
|
if (radar_alert_age)
|
||||||
{
|
{
|
||||||
LLChat chat;
|
LLChat chat;
|
||||||
@@ -139,6 +130,9 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool
|
|||||||
LLFloaterChat::addChat(chat);
|
LLFloaterChat::addChat(chat);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
llassert(type);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (args.find("[RANGE]") != args.end())
|
if (args.find("[RANGE]") != args.end())
|
||||||
{
|
{
|
||||||
@@ -168,23 +162,18 @@ void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool
|
|||||||
} //namespace
|
} //namespace
|
||||||
|
|
||||||
LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string &name, const LLVector3d &position) :
|
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),
|
mUpdateTimer(), mFrame(gFrameCount), mStats(),
|
||||||
mInChatFrame(U32_MAX), mInShoutFrame(U32_MAX),
|
|
||||||
mActivityType(ACTIVITY_NEW), mActivityTimer(),
|
mActivityType(ACTIVITY_NEW), mActivityTimer(),
|
||||||
mIsInList(false), mAge(-1), mAgeAlert(false), mTime(time(NULL))
|
mIsInList(false), mAge(-1), 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()
|
LLAvatarListEntry::~LLAvatarListEntry()
|
||||||
{
|
{
|
||||||
if (mID.notNull())
|
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mID, this);
|
||||||
LLAvatarPropertiesProcessor::getInstance()->removeObserver(mID, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// virtual
|
// virtual
|
||||||
@@ -200,6 +189,14 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
|
|||||||
int year, month, day;
|
int year, month, day;
|
||||||
sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d",&month,&day,&year);
|
sscanf(pAvatarData->born_on.c_str(),"%d/%d/%d",&month,&day,&year);
|
||||||
mAge = (day_clock::local_day() - date(year, month, day)).days();
|
mAge = (day_clock::local_day() - date(year, month, day)).days();
|
||||||
|
if (!mStats[STAT_TYPE_AGE] && mAge >= 0) //Only announce age once per entry.
|
||||||
|
{
|
||||||
|
static const LLCachedControl<U32> sAvatarAgeAlertDays(gSavedSettings, "AvatarAgeAlertDays");
|
||||||
|
if ((U32)mAge < sAvatarAgeAlertDays)
|
||||||
|
{
|
||||||
|
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.
|
// If one wanted more information that gets displayed on profiles to be displayed, here would be the place to do it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,49 +204,25 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
|
|||||||
|
|
||||||
void LLAvatarListEntry::setPosition(LLVector3d position, bool this_sim, bool drawn, bool chatrange, bool shoutrange)
|
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;
|
mPosition = position;
|
||||||
|
|
||||||
mFrame = gFrameCount;
|
mFrame = gFrameCount;
|
||||||
if (this_sim)
|
|
||||||
|
if (this_sim != mStats[STAT_TYPE_SIM])
|
||||||
{
|
{
|
||||||
if (mInSimFrame == U32_MAX)
|
chat_avatar_status(mName, mID, STAT_TYPE_SIM, mStats[STAT_TYPE_SIM] = this_sim);
|
||||||
{
|
|
||||||
chat_avatar_status(mName, mID, ALERT_TYPE_SIM, true);
|
|
||||||
}
|
|
||||||
mInSimFrame = mFrame;
|
|
||||||
}
|
}
|
||||||
if (drawn)
|
if (drawn != mStats[STAT_TYPE_DRAW])
|
||||||
{
|
{
|
||||||
if (mInDrawFrame == U32_MAX)
|
chat_avatar_status(mName, mID, STAT_TYPE_DRAW, mStats[STAT_TYPE_DRAW] = drawn);
|
||||||
{
|
|
||||||
chat_avatar_status(mName, mID, ALERT_TYPE_DRAW, true);
|
|
||||||
}
|
|
||||||
mInDrawFrame = mFrame;
|
|
||||||
}
|
}
|
||||||
if (shoutrange)
|
if (shoutrange != mStats[STAT_TYPE_SHOUTRANGE])
|
||||||
{
|
{
|
||||||
if (mInShoutFrame == U32_MAX)
|
chat_avatar_status(mName, mID, STAT_TYPE_SHOUTRANGE, mStats[STAT_TYPE_SHOUTRANGE] = shoutrange);
|
||||||
{
|
|
||||||
chat_avatar_status(mName, mID, ALERT_TYPE_SHOUTRANGE, true);
|
|
||||||
}
|
|
||||||
mInShoutFrame = mFrame;
|
|
||||||
}
|
}
|
||||||
if (chatrange)
|
if (chatrange != mStats[STAT_TYPE_CHATRANGE])
|
||||||
{
|
{
|
||||||
if (mInChatFrame == U32_MAX)
|
chat_avatar_status(mName, mID, STAT_TYPE_CHATRANGE, mStats[STAT_TYPE_CHATRANGE] = chatrange);
|
||||||
{
|
|
||||||
chat_avatar_status(mName, mID, ALERT_TYPE_CHATRANGE, true);
|
|
||||||
}
|
|
||||||
mInChatFrame = mFrame;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mUpdateTimer.start();
|
mUpdateTimer.start();
|
||||||
@@ -258,26 +231,6 @@ void LLAvatarListEntry::setPosition(LLVector3d position, bool this_sim, bool dra
|
|||||||
bool LLAvatarListEntry::getAlive()
|
bool LLAvatarListEntry::getAlive()
|
||||||
{
|
{
|
||||||
U32 current = gFrameCount;
|
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);
|
return ((current - mFrame) <= 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,42 +491,15 @@ void LLFloaterAvatarList::updateAvatarList()
|
|||||||
|
|
||||||
|
|
||||||
//todo: make this less of a hacked up copypasta from dales 1.18.
|
//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<LLUUID> avatar_ids;
|
std::vector<LLUUID> avatar_ids;
|
||||||
std::vector<LLUUID> sorted_avatar_ids;
|
std::vector<LLUUID> sorted_avatar_ids;
|
||||||
std::vector<LLVector3d> positions;
|
std::vector<LLVector3d> positions;
|
||||||
|
|
||||||
LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, F32_MAX);
|
LLVector3d mypos = gAgent.getPositionGlobal();
|
||||||
|
static const LLCachedControl<F32> radar_range_radius("RadarRangeRadius", 0);
|
||||||
sorted_avatar_ids = avatar_ids;
|
LLWorld::instance().getAvatars(&avatar_ids, &positions, mypos, radar_range_radius ? radar_range_radius : F32_MAX);
|
||||||
std::sort(sorted_avatar_ids.begin(), sorted_avatar_ids.end());
|
|
||||||
|
|
||||||
BOOST_FOREACH(std::vector<LLCharacter*>::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 i;
|
||||||
size_t count = avatar_ids.size();
|
size_t count = avatar_ids.size();
|
||||||
@@ -583,102 +509,52 @@ void LLFloaterAvatarList::updateAvatarList()
|
|||||||
|
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
std::string name;
|
|
||||||
const LLUUID &avid = avatar_ids[i];
|
const LLUUID &avid = avatar_ids[i];
|
||||||
|
|
||||||
if (avid.isNull())
|
std::string name;
|
||||||
{
|
if (!LLAvatarNameCache::getPNSName(avid, name))
|
||||||
//llinfos << "Key empty for avatar " << name << llendl;
|
continue; //prevent (Loading...)
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
LLAvatarListEntry* entry = getAvatarEntry(avid);
|
LLAvatarListEntry* entry = getAvatarEntry(avid);
|
||||||
|
|
||||||
if (entry && !entry->mAgeAlert && entry->mAge >= 0) //Only announce age once per entry.
|
LLVector3d position = positions[i];
|
||||||
{
|
|
||||||
static const LLCachedControl<U32> 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);
|
LLVOAvatar* avatarp = gObjectList.findAvatar(avid);
|
||||||
|
|
||||||
if (avatarp)
|
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
|
// Get avatar data
|
||||||
position = gAgent.getPosGlobalFromAgent(avatarp->getCharacterPosition());
|
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())
|
// Avatar not there yet, add it
|
||||||
{
|
if(announce && gAgent.getRegion()->pointInRegionGlobal(position))
|
||||||
position = positions[i];
|
announce_keys.push(avid);
|
||||||
}
|
mAvatars.push_back(LLAvatarListEntryPtr(entry = new LLAvatarListEntry(avid, name, position)));
|
||||||
else
|
}
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!LLAvatarNameCache::getPNSName(avid, name))
|
// Announce position
|
||||||
{
|
F32 dist = (F32)(position - mypos).magVec();
|
||||||
//name = gCacheName->getDefaultName();
|
entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 96.0);
|
||||||
continue; //prevent (Loading...)
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
entry->setActivity(LLAvatarListEntry::ACTIVITY_SOUND);
|
||||||
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)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//let us send the keys in a more timely fashion
|
//let us send the keys in a more timely fashion
|
||||||
if (announce && !announce_keys.empty())
|
if (announce && !announce_keys.empty())
|
||||||
{
|
{
|
||||||
@@ -740,15 +616,8 @@ void LLFloaterAvatarList::expireAvatarList()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(mAvatars.back() == *it)
|
entry->setPosition(entry->getPosition(), false, false, false, false); // Dead and gone
|
||||||
{
|
it = mAvatars.erase(it);
|
||||||
mAvatars.pop_back();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*it = mAvatars.back();
|
|
||||||
mAvatars.pop_back();
|
|
||||||
if(mAvatars.empty())
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -841,12 +710,6 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (av_id.isNull())
|
|
||||||
{
|
|
||||||
//llwarns << "Avatar with null key somehow got into the list!" << llendl;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
element.value = av_id;
|
element.value = av_id;
|
||||||
|
|
||||||
LLScrollListCell::Params mark;
|
LLScrollListCell::Params mark;
|
||||||
@@ -924,7 +787,7 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
if (UnknownAltitude)
|
if (UnknownAltitude)
|
||||||
{
|
{
|
||||||
strcpy(temp, "?");
|
strcpy(temp, "?");
|
||||||
if (entry->isDrawn())
|
if (entry->mStats[STAT_TYPE_DRAW])
|
||||||
{
|
{
|
||||||
color = sRadarTextDrawDist;
|
color = sRadarTextDrawDist;
|
||||||
}
|
}
|
||||||
@@ -945,7 +808,7 @@ void LLFloaterAvatarList::refreshAvatarList()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (entry->isDrawn())
|
if (entry->mStats[STAT_TYPE_DRAW])
|
||||||
{
|
{
|
||||||
color = sRadarTextDrawDist;
|
color = sRadarTextDrawDist;
|
||||||
}
|
}
|
||||||
@@ -1733,7 +1596,7 @@ void LLFloaterAvatarList::onSelectName()
|
|||||||
LLAvatarListEntry* entry = getAvatarEntry(agent_id);
|
LLAvatarListEntry* entry = getAvatarEntry(agent_id);
|
||||||
if (entry)
|
if (entry)
|
||||||
{
|
{
|
||||||
BOOL enabled = entry->isDrawn();
|
BOOL enabled = entry->mStats[STAT_TYPE_DRAW];
|
||||||
childSetEnabled("focus_btn", enabled);
|
childSetEnabled("focus_btn", enabled);
|
||||||
childSetEnabled("prev_in_list_btn", enabled);
|
childSetEnabled("prev_in_list_btn", enabled);
|
||||||
childSetEnabled("next_in_list_btn", enabled);
|
childSetEnabled("next_in_list_btn", enabled);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "llscrolllistctrl.h"
|
#include "llscrolllistctrl.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <bitset>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
@@ -26,6 +27,16 @@
|
|||||||
|
|
||||||
class LLFloaterAvatarList;
|
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.
|
* @brief This class is used to hold data about avatars.
|
||||||
* We cache data about avatars to avoid repeating requests in this class.
|
* 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 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
|
* @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.
|
* Until this happens our focusprev/focusnext logic should ignore this entry.
|
||||||
@@ -143,13 +150,16 @@ private:
|
|||||||
std::string mName;
|
std::string mName;
|
||||||
time_t mTime;
|
time_t mTime;
|
||||||
LLVector3d mPosition;
|
LLVector3d mPosition;
|
||||||
LLVector3d mDrawPosition;
|
|
||||||
bool mMarked;
|
bool mMarked;
|
||||||
bool mFocused;
|
bool mFocused;
|
||||||
bool mIsInList;
|
bool mIsInList;
|
||||||
bool mAgeAlert;
|
|
||||||
int mAge;
|
int mAge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Bitset to keep track of what stats still hold true about the avatar
|
||||||
|
*/
|
||||||
|
std::bitset<STAT_TYPE_SIZE> mStats;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Timer to keep track of whether avatars are still there
|
* @brief Timer to keep track of whether avatars are still there
|
||||||
*/
|
*/
|
||||||
@@ -164,14 +174,6 @@ private:
|
|||||||
* @brief Last frame when this avatar was updated
|
* @brief Last frame when this avatar was updated
|
||||||
*/
|
*/
|
||||||
U32 mFrame;
|
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1618,6 +1618,7 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_
|
|||||||
case DAD_BODYPART:
|
case DAD_BODYPART:
|
||||||
case DAD_ANIMATION:
|
case DAD_ANIMATION:
|
||||||
case DAD_GESTURE:
|
case DAD_GESTURE:
|
||||||
|
case DAD_CALLINGCARD:
|
||||||
{
|
{
|
||||||
LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data;
|
LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data;
|
||||||
if(gInventory.getItem(inv_item->getUUID())
|
if(gInventory.getItem(inv_item->getUUID())
|
||||||
@@ -1662,7 +1663,6 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DAD_CALLINGCARD:
|
|
||||||
default:
|
default:
|
||||||
*accept = ACCEPT_NO;
|
*accept = ACCEPT_NO;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -6211,6 +6211,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
|
|||||||
if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
|
if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge"))
|
||||||
{
|
{
|
||||||
llinfos << "Bridge detected! detaching" << llendl;
|
llinfos << "Bridge detected! detaching" << llendl;
|
||||||
|
LLAppearanceMgr::getInstance()->removeItemFromAvatar(viewer_object->getAttachmentItemID());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest)
|
||||||
|
|||||||
Reference in New Issue
Block a user