diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 7f07a5bc2..0edaff884 100644 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -239,12 +239,15 @@ protected: // A list of all audio sources that are known to the viewer at this time. // This is most likely a superset of the ones that we actually have audio // data for, or are playing back. +public://Jay: IDGAF typedef std::map source_map; +protected: typedef std::map data_map; - + +public://Jay: IDGAF source_map mAllSources; +protected: data_map mAllData; - LLAudioChannel *mChannels[MAX_CHANNELS]; // Buffers needs to change into a different data structure, as the number of buffers @@ -351,6 +354,9 @@ public: protected: LLUUID mID; // The ID of the source is that of the object if it's attached to an object. LLUUID mOwnerID; // owner of the object playing the sound +public: + const LLUUID &getOwnerID() { return mOwnerID; } +protected: F32 mPriority; F32 mGain; bool mSourceMuted; diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 398b4a846..747a6a329 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -57,6 +57,10 @@ #include "llsdutil.h" +#include "llaudioengine.h" + +#include "llstartup.h" + // #include "llviewermenu.h" // @@ -125,7 +129,8 @@ 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), mDrawPosition(), mMarked(FALSE), mFocused(FALSE), mUpdateTimer(), mFrame(gFrameCount), mInSimFrame(U32_MAX), mInDrawFrame(U32_MAX), - mInChatFrame(U32_MAX), mInShoutFrame(U32_MAX) + mInChatFrame(U32_MAX), mInShoutFrame(U32_MAX), + mActivityType(ACTIVITY_NEW), mActivityTimer() { } @@ -214,6 +219,26 @@ BOOL LLAvatarListEntry::isDead() { return getEntryAgeSeconds() > DEAD_KEEP_TIME; } +const F32 ACTIVITY_TIMEOUT = 1.0f; +void LLAvatarListEntry::setActivity(ACTIVITY_TYPE activity) +{ + if ( activity >= mActivityType || mActivityTimer.getElapsedTimeF32() > ACTIVITY_TIMEOUT ) + { + mActivityType = activity; + mActivityTimer.start(); + } +} + +LLAvatarListEntry::ACTIVITY_TYPE LLAvatarListEntry::getActivity() +{ + if ( mActivityTimer.getElapsedTimeF32() > ACTIVITY_TIMEOUT ) + { + mActivityType = ACTIVITY_NONE; + } + if(isDead())return ACTIVITY_DEAD; + + return mActivityType; +} LLFloaterAvatarList* LLFloaterAvatarList::sInstance = NULL; @@ -359,10 +384,29 @@ BOOL LLFloaterAvatarList::postBuild() return TRUE; } +void updateParticleActivity(LLDrawable *drawablep) +{ + if (LLFloaterAvatarList::getInstance()) + { + LLViewerObject *vobj = drawablep->getVObj(); + if (vobj && vobj->isParticleSource()) + { + LLUUID id = vobj->mPartSourcep->getOwnerUUID(); + LLAvatarListEntry *ent = LLFloaterAvatarList::getInstance()->getAvatarEntry(id); + if ( NULL != ent ) + { + ent->setActivity(LLAvatarListEntry::ACTIVITY_PARTICLES); + } + } + } +} + void LLFloaterAvatarList::updateAvatarList() { if (sInstance != this) return; + //if(LLStartUp::getStartupState() < STATE_STARTED)return; + //llinfos << "radar refresh: updating map" << llendl; // Check whether updates are enabled @@ -377,6 +421,25 @@ void LLFloaterAvatarList::updateAvatarList() { mUpdate = TRUE; } + //moved to pipeline to prevent a crash + //gPipeline.forAllVisibleDrawables(updateParticleActivity); + + + //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(); @@ -469,6 +532,7 @@ void LLFloaterAvatarList::updateAvatarList() // Avatar already in list, update position F32 dist = (F32)(position - mypos).magVec(); mAvatars[avid].setPosition(position, (avatarp->getRegion() == gAgent.getRegion()), true, dist < 20.0, dist < 100.0); + if(avatarp->isTyping())mAvatars[avid].setActivity(LLAvatarListEntry::ACTIVITY_TYPING); } else { @@ -813,6 +877,40 @@ void LLFloaterAvatarList::refreshAvatarList() snprintf(temp, sizeof(temp), "%d", (S32)position.mdV[VZ]); } element["columns"][LIST_ALTITUDE]["value"] = temp; + + element["columns"][LIST_ACTIVITY]["column"] = "activity"; + element["columns"][LIST_ACTIVITY]["type"] = "icon"; + + std::string activity_icon = ""; + switch(entry->getActivity()) + { + case LLAvatarListEntry::ACTIVITY_MOVING: + activity_icon = "inv_item_animation.tga"; + break; + case LLAvatarListEntry::ACTIVITY_GESTURING: + activity_icon = "inv_item_gesture.tga"; + break; + case LLAvatarListEntry::ACTIVITY_SOUND: + activity_icon = "inv_item_sound.tga"; + break; + case LLAvatarListEntry::ACTIVITY_REZZING: + activity_icon = "ff_edit_theirs.tga"; + break; + case LLAvatarListEntry::ACTIVITY_PARTICLES: + activity_icon = "particles_scan.tga"; + break; + case LLAvatarListEntry::ACTIVITY_NEW: + activity_icon = "avatar_new.tga"; + break; + case LLAvatarListEntry::ACTIVITY_TYPING: + activity_icon = "avatar_typing.tga"; + break; + default: + break; + } + + element["columns"][LIST_ACTIVITY]["value"] = activity_icon;//icon_image_id; //"icn_active-speakers-dot-lvl0.tga"; + //element["columns"][LIST_AVATAR_ACTIVITY]["color"] = icon_color.getValue(); element["columns"][LIST_CLIENT]["column"] = "client"; element["columns"][LIST_CLIENT]["type"] = "text"; diff --git a/indra/newview/llfloateravatarlist.h b/indra/newview/llfloateravatarlist.h index 3afd6929d..fa7f9b5f3 100644 --- a/indra/newview/llfloateravatarlist.h +++ b/indra/newview/llfloateravatarlist.h @@ -33,6 +33,18 @@ class LLAvatarListEntry { public: +enum ACTIVITY_TYPE +{ + ACTIVITY_NONE, /** Avatar not doing anything */ + ACTIVITY_MOVING, /** Changing position */ + ACTIVITY_GESTURING, /** Playing a gesture */ + ACTIVITY_REZZING, /** Rezzing objects */ + ACTIVITY_PARTICLES, /** Creating particles */ + ACTIVITY_TYPING, /** Typing */ + ACTIVITY_NEW, /** Avatar just appeared */ + ACTIVITY_SOUND, /** Playing a sound */ + ACTIVITY_DEAD /** Avatar isn't around anymore, and will be removed soon from the list */ +}; /** * @brief Initializes a list entry * @param id Avatar's key @@ -72,6 +84,13 @@ public: */ LLUUID getID() { return mID; } + void setActivity(ACTIVITY_TYPE activity); + + /** + * @brief Returns the activity type + */ + ACTIVITY_TYPE getActivity(); + /** * @brief Sets the 'focus' status on this entry (camera focused on this avatar) */ @@ -106,8 +125,13 @@ private: /** * @brief Timer to keep track of whether avatars are still there */ + LLTimer mUpdateTimer; + ACTIVITY_TYPE mActivityType; + + LLTimer mActivityTimer; + /** * @brief Last frame when this avatar was updated */ @@ -204,9 +228,11 @@ private: LIST_DISTANCE, LIST_POSITION, LIST_ALTITUDE, + LIST_ACTIVITY, LIST_CLIENT, }; + typedef void (*avlist_command_t)(const LLUUID &avatar, const std::string &name); /** diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index d1ee94a3e..fea65a635 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -676,8 +676,9 @@ protected: TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator // extra data sent from the sim...currently only used for tree species info U8* mData; - +public://Jay: IDGAF LLPointer mPartSourcep; // Particle source associated with this object. +protected: LLAudioSourceVO* mAudioSourcep; F32 mAudioGain; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 84bdda8fd..4ac8ffce1 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -992,6 +992,9 @@ private: LLFrameTimer mTimeVisible; std::deque mChats; BOOL mTyping; +public: + BOOL isTyping(){ return mTyping; } +private: LLFrameTimer mTypingTimer; static void on_avatar_name_response(const LLUUID& agent_id, const LLAvatarName& av_name, void *userdata); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2d4fe26b5..3c113c0ac 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3105,6 +3105,8 @@ void renderSoundHighlights(LLDrawable* drawablep) } } +void updateParticleActivity(LLDrawable *drawablep); + void LLPipeline::postSort(LLCamera& camera) { LLMemType mt(LLMemType::MTYPE_PIPELINE_POST_SORT); @@ -3235,6 +3237,9 @@ void LLPipeline::postSort(LLCamera& camera) std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); } llpushcallstacks ; + + forAllVisibleDrawables(updateParticleActivity); + // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus static const LLCachedControl beacons_visible("BeaconsVisible", false); if (beacons_visible && !sShadowRender) diff --git a/indra/newview/skins/default/textures/avatar_gone.tga b/indra/newview/skins/default/textures/avatar_gone.tga new file mode 100644 index 000000000..e5c2c070b Binary files /dev/null and b/indra/newview/skins/default/textures/avatar_gone.tga differ diff --git a/indra/newview/skins/default/textures/avatar_new.tga b/indra/newview/skins/default/textures/avatar_new.tga new file mode 100644 index 000000000..854b70c32 Binary files /dev/null and b/indra/newview/skins/default/textures/avatar_new.tga differ diff --git a/indra/newview/skins/default/textures/avatar_typing.tga b/indra/newview/skins/default/textures/avatar_typing.tga new file mode 100644 index 000000000..2c549025d Binary files /dev/null and b/indra/newview/skins/default/textures/avatar_typing.tga differ diff --git a/indra/newview/skins/default/textures/particles_scan.tga b/indra/newview/skins/default/textures/particles_scan.tga new file mode 100644 index 000000000..008943981 Binary files /dev/null and b/indra/newview/skins/default/textures/particles_scan.tga differ diff --git a/indra/newview/skins/default/xui/en-us/floater_radar.xml b/indra/newview/skins/default/xui/en-us/floater_radar.xml index 9d99c712d..d0b67529b 100644 --- a/indra/newview/skins/default/xui/en-us/floater_radar.xml +++ b/indra/newview/skins/default/xui/en-us/floater_radar.xml @@ -13,7 +13,8 @@ - + +