From 4e854ffd2b7a914e9d3dae96e209bcb4b5276846 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2010 18:04:57 -0500 Subject: [PATCH] -Fixed idle timer which got fux'd in previous commit. -Afk now uses LLCachedControl --- indra/newview/llappviewer.cpp | 3 ++- indra/newview/llvoavatar.cpp | 29 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 46418270c..00810cddd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -347,7 +347,8 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; void idle_afk_check() { // check idle timers - if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout")) && (gSavedSettings.getF32("AFKTimeout") > 0)) + static const LLCachedControl afk_timeout("AFKTimeout",0.f); + if (gAllowIdleAFK && afk_timeout > 0.f && gAwayTriggerTimer.getElapsedTimeF32() > afk_timeout) { gAgent.setAFK(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e02b1fdb5..f3c5677a3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3825,22 +3825,28 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (mNameText.notNull() && firstname && lastname) { BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); - if(mNameAway && ! is_away) mIdleTimer.reset(); BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); - if(mNameBusy && ! is_busy) mIdleTimer.reset(); BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); - if(mNameAppearance && ! is_appearance) mIdleTimer.reset(); BOOL is_muted = !mIsSelf && LLMuteList::getInstance()->isMuted(getID()); - + BOOL is_idle = FALSE; + BOOL idle_reset = (mNameAppearance && ! is_appearance) || (mNameAway && ! is_away) || (mNameBusy && ! is_busy); + if(idle_reset) + mIdleTimer.reset(); + else + { + static const LLCachedControl ascent_show_idle_time("AscentShowIdleTime",true); + is_idle = !mIsSelf && ascent_show_idle_time && mIdleTimer.getElapsedTimeF32() > 120; + } //Is client-tagging enabled for this av? BOOL render_tag = (((mIsSelf && ascent_show_self_tag) || (!mIsSelf && ascent_show_others_tag))); - if (mNameString.empty() || - new_name || - (!title && !mTitle.empty()) || - (title && mTitle != title->getString()) || - (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) - || is_appearance != mNameAppearance + if (mNameString.empty() + || new_name + || (!title && !mTitle.empty()) + || (title && mTitle != title->getString()) + || is_muted != mNameMute //Mute setting changed + || idle_reset //Idle time was reset. + || is_idle //Agent is indeed idle || tag_changed //mClientTag was just set. || (mRenderTag != render_tag) //tag setting is dirty. Need to update mNameString. ) @@ -3915,8 +3921,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += "(Editing Appearance)"; } - static const LLCachedControl ascent_show_idle_time("AscentShowIdleTime",true); - if(!mIsSelf && ascent_show_idle_time && mIdleTimer.getElapsedTimeF32() > 120 ) + if(is_idle) { line += "\n"; line += getIdleTime();