diff options
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index ad797c686a..5bf34455bb 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -277,6 +277,11 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) } else { + mInventoryItem = nullptr; + mInventoryId.setNull(); + mCanCopy = true; + mCanMod = true; + mMakeNoTrans = false; setEditDefaultDayCycle(); } @@ -551,6 +556,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 +914,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 +975,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(); + } } } |