summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-29 20:13:07 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-08 21:51:32 +0200
commit1f3d744fdfe2781bac1dc3829318809eef3c6309 (patch)
tree721650dc7325bd9d7c058a7d9904c394d23e7fd1 /indra/newview/llfloatereditextdaycycle.cpp
parent85250265f4b1727d6bfaf5bc68bd96d867228af9 (diff)
SL-16105 Crash at LLTrackBlenderLoopingManual's setPosition
User opened editor, pressed play, according to logs environment wasn't loaded yet, asset had yet to arrive.
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp33
1 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 281d4f68f5..eb0cd28190 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -98,6 +98,11 @@ namespace {
const std::string TABS_SKYS("sky_tabs");
const std::string TABS_WATER("water_tabs");
+ // 'Play' buttons
+ const std::string BTN_PLAY("play_btn");
+ const std::string BTN_SKIP_BACK("skip_back_btn");
+ const std::string BTN_SKIP_FORWARD("skip_forward_btn");
+
const std::string EVNT_DAYTRACK("DayCycle.Track");
const std::string EVNT_PLAY("DayCycle.PlayActions");
@@ -1205,6 +1210,11 @@ void LLFloaterEditExtDayCycle::updateButtons()
mDeleteFrameButton->setEnabled(can_manipulate && isRemovingFrameAllowed());
mLoadFrame->setEnabled(can_manipulate);
+ BOOL enable_play = mEditDay ? TRUE : FALSE;
+ childSetEnabled(BTN_PLAY, enable_play);
+ childSetEnabled(BTN_SKIP_BACK, enable_play);
+ childSetEnabled(BTN_SKIP_FORWARD, enable_play);
+
// update track buttons
bool extended_env = LLEnvironment::instance().isExtendedEnvironmentEnabled();
for (S32 track = 0; track < LLSettingsDay::TRACK_MAX; ++track)
@@ -1575,15 +1585,22 @@ void LLFloaterEditExtDayCycle::onIdlePlay(void* user_data)
{
LLFloaterEditExtDayCycle* self = (LLFloaterEditExtDayCycle*)user_data;
- F32 prcnt_played = self->mPlayTimer.getElapsedTimeF32() / DAY_CYCLE_PLAY_TIME_SECONDS;
- F32 new_frame = fmod(self->mPlayStartFrame + prcnt_played, 1.f);
+ if (self->mSkyBlender == nullptr || self->mWaterBlender == nullptr)
+ {
+ self->stopPlay();
+ }
+ else
+ {
+
+ F32 prcnt_played = self->mPlayTimer.getElapsedTimeF32() / DAY_CYCLE_PLAY_TIME_SECONDS;
+ F32 new_frame = fmod(self->mPlayStartFrame + prcnt_played, 1.f);
- self->mTimeSlider->setCurSliderValue(new_frame); // will do the rounding
- self->mSkyBlender->setPosition(new_frame);
- self->mWaterBlender->setPosition(new_frame);
- self->synchronizeTabs();
- self->updateTimeAndLabel();
- self->updateButtons();
+ self->mTimeSlider->setCurSliderValue(new_frame); // will do the rounding
+
+ self->synchronizeTabs();
+ self->updateTimeAndLabel();
+ self->updateButtons();
+ }
}
}