summaryrefslogtreecommitdiff
path: root/indra/llui/llflashtimer.cpp
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-21 16:01:54 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-21 16:01:54 -0800
commitf23e0ffdb2ff2ad43a996c489b08c1324d9e5ee1 (patch)
treee5219901b9edc82f78a530219707f5859ccb54fc /indra/llui/llflashtimer.cpp
parentb76123589381a2f59b704e8850792f9dcdc62517 (diff)
parentedeeed95416be2679e1ad3d29bab5396dbcccaa2 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
Diffstat (limited to 'indra/llui/llflashtimer.cpp')
-rw-r--r--indra/llui/llflashtimer.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index c572a83ff5..2ad86b5751 100644
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -33,15 +33,15 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
: LLEventTimer(period)
, mCallback(cb)
, mCurrentTickCount(0)
- , mIsFlashing(false)
+ , mIsFlashingInProgress(false)
{
mEventTimer.stop();
// By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
// Due to Timer is implemented as derived class from EventTimer it is impossible to change period
// in runtime. So, both settings are made as required restart.
- mFlashCount = 2 * ((count>0)? count : gSavedSettings.getS32("FlashCount"));
- if (mPeriod<=0)
+ mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount"));
+ if (mPeriod <= 0)
{
mPeriod = gSavedSettings.getF32("FlashPeriod");
}
@@ -49,15 +49,18 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
BOOL LLFlashTimer::tick()
{
- mIsHighlight = !(mCurrentTickCount % 2);
+ mIsCurrentlyHighlighted = !mIsCurrentlyHighlighted;
+
if (mCallback)
{
- mCallback(mIsHighlight);
+ mCallback(mIsCurrentlyHighlighted);
}
if (++mCurrentTickCount >= mFlashCount)
{
mEventTimer.stop();
+ mCurrentTickCount = 0;
+ mIsFlashingInProgress = false;
}
return FALSE;
@@ -65,15 +68,14 @@ BOOL LLFlashTimer::tick()
void LLFlashTimer::startFlashing()
{
- mCurrentTickCount = 0;
- mIsFlashing = true;
+ mIsFlashingInProgress = true;
mEventTimer.start();
}
void LLFlashTimer::stopFlashing()
{
- mIsFlashing = false;
- mIsHighlight = false;
+ mIsFlashingInProgress = false;
+ mIsCurrentlyHighlighted = false;
mEventTimer.stop();
}