summaryrefslogtreecommitdiff
path: root/indra/newview/lltoast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoast.cpp')
-rw-r--r--indra/newview/lltoast.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 2e00b2c382..5fc0ea855e 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -43,34 +43,21 @@ LLToastLifeTimer::LLToastLifeTimer(LLToast* toast, F32 period)
{
}
-/*virtual*/
-BOOL LLToastLifeTimer::tick()
-{
- if (mEventTimer.hasExpired())
- {
- mToast->expire();
- }
- return FALSE;
-}
-
-void LLToastLifeTimer::stop()
+bool LLToastLifeTimer::tick()
{
- mEventTimer.stop();
-}
-
-void LLToastLifeTimer::start()
-{
- mEventTimer.start();
+ mToast->expire();
+ return false;
}
void LLToastLifeTimer::restart()
{
- mEventTimer.reset();
+ // start() discards any previously-running mTimer
+ start();
}
-BOOL LLToastLifeTimer::getStarted()
+bool LLToastLifeTimer::getStarted()
{
- return mEventTimer.getStarted();
+ return isRunning();
}
void LLToastLifeTimer::setPeriod(F32 period)
@@ -78,12 +65,14 @@ void LLToastLifeTimer::setPeriod(F32 period)
mPeriod = period;
}
+/*==========================================================================*|
F32 LLToastLifeTimer::getRemainingTimeF32()
{
F32 et = mEventTimer.getElapsedTimeF32();
if (!getStarted() || et > mPeriod) return 0.0f;
return mPeriod - et;
}
+|*==========================================================================*/
//--------------------------------------------------------------------------
LLToast::Params::Params()
@@ -337,7 +326,7 @@ void LLToast::setFading(bool transparent)
F32 LLToast::getTimeLeftToLive()
{
- F32 time_to_live = mTimer->getRemainingTimeF32();
+ F32 time_to_live = mTimer->getRemaining();
if (!mIsFading)
{