summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-09-13 16:32:41 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-09-13 16:32:41 +0300
commitceb336c5f340c260ac5c1923723dbc8204b98157 (patch)
tree5de27b1199c0a79ce7d531d1512bd09e43fc1237 /indra/newview
parentf31b35cb5cba5cdf4985fa411ff45c43afa695b5 (diff)
SL-1168 EEP Shouldn't be possible to create more than 20 keframes
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index ad797c686a..4ba23493d1 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -551,6 +551,12 @@ void LLFloaterEditExtDayCycle::onAddTrack()
LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL;
return;
}
+ if (!mFramesSlider->canAddSliders())
+ {
+ // Shouldn't happen, button should be disabled
+ LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame when slider is full." << LL_ENDL;
+ return;
+ }
if (mCurrentTrack == LLSettingsDay::TRACK_WATER)
{
@@ -903,7 +909,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
//bool can_add = static_cast<bool>(settings);
//mAddFrameButton->setEnabled(can_add);
//mDeleteFrameButton->setEnabled(!can_add);
- mAddFrameButton->setEnabled(true && mCanMod);
+ mAddFrameButton->setEnabled(mCanMod && mFramesSlider->canAddSliders());
mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod);
}
@@ -964,13 +970,16 @@ void LLFloaterEditExtDayCycle::addSliderFrame(const F32 frame, LLSettingsBase::p
// multi slider distinguishes elements by key/name in string format
// store names to map to be able to recall dependencies
std::string new_slider = mFramesSlider->addSlider(frame);
- mSliderKeyMap[new_slider] = FrameData(frame, setting);
-
- if (update_ui)
+ if (!new_slider.empty())
{
- mLastFrameSlider = new_slider;
- mTimeSlider->setCurSliderValue(frame);
- updateTabs();
+ mSliderKeyMap[new_slider] = FrameData(frame, setting);
+
+ if (update_ui)
+ {
+ mLastFrameSlider = new_slider;
+ mTimeSlider->setCurSliderValue(frame);
+ updateTabs();
+ }
}
}