diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-09-10 17:31:31 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-09-10 17:31:31 +0300 |
commit | 598cd8a30fe31b2af5e9bd23db72101afae45870 (patch) | |
tree | 1ed01959e7602816cfdcf54d6e27f41b46c4187b | |
parent | 8c9d758e3a5de9e11b2e33753e61a5359dbff8de (diff) |
MAINT-9066 EEP should not be able to delete all Keyframes from Ground Level or Water
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 1 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.h | 2 |
4 files changed, 17 insertions, 1 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 25cd99b997..c911ef23c0 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -115,6 +115,7 @@ const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 ho const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0 +const S32 LLSettingsDay::TRACK_GROUND_LEVEL(1); const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water const S32 LLSettingsDay::FRAME_MAX(56); diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h index 46dc0cec74..8776f6725d 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -60,6 +60,7 @@ public: static const Seconds MAXIMUM_DAYOFFSET; static const S32 TRACK_WATER; + static const S32 TRACK_GROUND_LEVEL; static const S32 TRACK_MAX; static const S32 FRAME_MAX; diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index f1dbb32016..2295e4f10b 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -842,7 +842,7 @@ void LLFloaterEditExtDayCycle::updateButtons() //mAddFrameButton->setEnabled(can_add); //mDeleteFrameButton->setEnabled(!can_add); mAddFrameButton->setEnabled(true && mCanMod); - mDeleteFrameButton->setEnabled(true && mCanMod); + mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod); } void LLFloaterEditExtDayCycle::updateSlider() @@ -1198,6 +1198,18 @@ void LLFloaterEditExtDayCycle::doApplyCommit() } } +bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed() +{ + if (mCurrentTrack <= LLSettingsDay::TRACK_GROUND_LEVEL) + { + return (mSliderKeyMap.size() > 1); + } + else + { + return (mSliderKeyMap.size() > 0); + } +} + 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; diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index c64ed3ff5a..d808dc60c5 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -166,6 +166,8 @@ private: void setDirtyFlag() { mIsDirty = true; } virtual void clearDirtyFlag(); + bool isRemovingFrameAllowed(); + LLSettingsDay::ptr_t mEditDay; // edited copy LLSettingsDay::Seconds mDayLength; U32 mCurrentTrack; |