-Fixed idle timer which got fux'd in previous commit.

-Afk now uses LLCachedControl
This commit is contained in:
unknown
2010-10-12 18:04:57 -05:00
parent 3b0bfc40bc
commit 4e854ffd2b
2 changed files with 19 additions and 13 deletions

View File

@@ -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<F32> afk_timeout("AFKTimeout",0.f);
if (gAllowIdleAFK && afk_timeout > 0.f && gAwayTriggerTimer.getElapsedTimeF32() > afk_timeout)
{
gAgent.setAFK();
}

View File

@@ -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<bool> 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<bool> ascent_show_idle_time("AscentShowIdleTime",true);
if(!mIsSelf && ascent_show_idle_time && mIdleTimer.getElapsedTimeF32() > 120 )
if(is_idle)
{
line += "\n";
line += getIdleTime();