summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2018-12-05 15:32:17 +0200
committermaxim_productengine <mnikolenko@productengine.com>2018-12-05 15:32:17 +0200
commitf0afc19bee33a31f9e648e72935f3b7c7dee2fd5 (patch)
treecae744e763dda8fb16ecf32839cfce87bdd3b734 /indra/newview/llfloatereditextdaycycle.cpp
parentb6fa72d3c4d02527f6d118eadc9ba1ac48a297f5 (diff)
SL-10166 FIXED Sky editor add/delete frame not enabling disabling correctly
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index a30e16ab2b..95df4206b7 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -1020,7 +1020,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
//bool can_add = static_cast<bool>(settings);
//mAddFrameButton->setEnabled(can_add);
//mDeleteFrameButton->setEnabled(!can_add);
- mAddFrameButton->setEnabled(mCanMod && mFramesSlider->canAddSliders());
+ mAddFrameButton->setEnabled(isAddingFrameAllowed() && mCanMod);
mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod);
}
@@ -1401,6 +1401,8 @@ void LLFloaterEditExtDayCycle::doApplyCommit(LLSettingsDay::ptr_t day)
bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed()
{
+ if (mFramesSlider->getCurSlider().empty()) return false;
+
if (mCurrentTrack <= LLSettingsDay::TRACK_GROUND_LEVEL)
{
return (mSliderKeyMap.size() > 1);
@@ -1411,6 +1413,18 @@ bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed()
}
}
+bool LLFloaterEditExtDayCycle::isAddingFrameAllowed()
+{
+ if (!mFramesSlider->getCurSlider().empty()) return false;
+
+ LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
+ if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second)
+ {
+ return false;
+ }
+ return mFramesSlider->canAddSliders();
+}
+
void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
{
LL_INFOS("ENVDAYEDIT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL;
@@ -1536,6 +1550,7 @@ void LLFloaterEditExtDayCycle::onIdlePlay(void* user_data)
self->mWaterBlender->setPosition(new_frame);
self->synchronizeTabs();
self->updateTimeAndLabel();
+ self->updateButtons();
}
}