From 25e046594464551d6d66eceee0471f10722c53ce Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 31 Oct 2018 15:57:19 +0200 Subject: SL-9924 [EEP] Environment Settings permissions can be dropped by Save As button --- indra/newview/llfloatereditextdaycycle.cpp | 17 +++++++++++++---- indra/newview/llfloaterfixedenvironment.cpp | 16 +++++++++++++--- indra/newview/llsettingsvo.cpp | 9 +++++++-- indra/newview/llsettingsvo.h | 3 ++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 5a47e02926..11dc9a8280 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1327,11 +1327,20 @@ void LLFloaterEditExtDayCycle::reblendSettings() void LLFloaterEditExtDayCycle::doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day, std::string settings_name) { - // This method knows what sort of settings object to create. - LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); - - LLSettingsVOBase::createInventoryItem(day, parent_id, settings_name, + if (mInventoryItem) + { + LLUUID parent_id = mInventoryItem->getParentUUID(); + U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner(); + LLSettingsVOBase::createInventoryItem(day, next_owner_perm, parent_id, settings_name, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } + else + { + LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + // This method knows what sort of settings object to create. + LLSettingsVOBase::createInventoryItem(day, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } } void LLFloaterEditExtDayCycle::doApplyUpdateInventory(const LLSettingsDay::ptr_t &day) diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d35dd5ec98..b9e23fb245 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -448,10 +448,20 @@ void LLFloaterFixedEnvironment::onButtonLoad() void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name) { - LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); - // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + if (mInventoryItem) + { + LLUUID parent_id = mInventoryItem->getParentUUID(); + U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner(); + LLSettingsVOBase::createInventoryItem(mSettings, next_owner_perm, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } + else + { + LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + // This method knows what sort of settings object to create. + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } } void LLFloaterFixedEnvironment::doApplyUpdateInventory() diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 3925f37703..0def17b32d 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -120,9 +120,14 @@ void LLSettingsVOBase::createNewInventoryItem(LLSettingsType::type_e stype, cons void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback) +{ + U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); + createInventoryItem(settings, nextOwnerPerm, parent_id, settings_name, callback); +} + +void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, U32 next_owner_perm, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback) { LLTransactionID tid; - U32 nextOwnerPerm = LLPermissions::DEFAULT.getMaskNextOwner(); if (!LLEnvironment::instance().isInventoryEnabled()) { @@ -144,7 +149,7 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings create_inventory_settings(gAgent.getID(), gAgent.getSessionID(), parent_id, tid, settings_name, "", - settings->getSettingsTypeValue(), nextOwnerPerm, cb); + settings->getSettingsTypeValue(), next_owner_perm, cb); } void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback) diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 0e8312b849..1ad0091871 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -51,7 +51,8 @@ public: static void createNewInventoryItem(LLSettingsType::type_e stype, const LLUUID &parent_id, inventory_result_fn callback = inventory_result_fn()); static void createInventoryItem(const LLSettingsBase::ptr_t &settings, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback = inventory_result_fn()); - + static void createInventoryItem(const LLSettingsBase::ptr_t &settings, U32 next_owner_perm, const LLUUID &parent_id, std::string settings_name, inventory_result_fn callback = inventory_result_fn()); + static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn(), bool update_name = true); static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn()); -- cgit v1.2.3 From f0afc19bee33a31f9e648e72935f3b7c7dee2fd5 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 5 Dec 2018 15:32:17 +0200 Subject: SL-10166 FIXED Sky editor add/delete frame not enabling disabling correctly --- indra/newview/llfloatereditextdaycycle.cpp | 17 ++++++++++++++++- indra/newview/llfloatereditextdaycycle.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) 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(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(); } } diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index fd5fb67837..6224517aa0 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -173,6 +173,7 @@ private: virtual void clearDirtyFlag(); bool isRemovingFrameAllowed(); + bool isAddingFrameAllowed(); LLSettingsDay::ptr_t mEditDay; // edited copy LLSettingsDay::Seconds mDayLength; -- cgit v1.2.3 From 2f188b36d9b892e48ba72c3485b34036273d755b Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 5 Dec 2018 17:14:06 +0200 Subject: SL-10167 Change wording on Add/Load/Delete buttons in the day editor --- indra/newview/llfloatereditextdaycycle.cpp | 10 ++++++++++ indra/newview/llfloatereditextdaycycle.h | 1 + .../skins/default/xui/en/floater_edit_ext_day_cycle.xml | 8 +++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 95df4206b7..36958a948a 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -903,6 +903,7 @@ void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force ) mSkyTabLayoutContainer->setVisible(!show_water); mWaterTabLayoutContainer->setVisible(show_water); updateSlider(); + updateLabels(); } void LLFloaterEditExtDayCycle::selectFrame(F32 frame, F32 slop_factor) @@ -1010,6 +1011,15 @@ void LLFloaterEditExtDayCycle::updateSkyTabs(const LLSettingsSkyPtr_t &p_sky) } +void LLFloaterEditExtDayCycle::updateLabels() +{ + std::string label_arg = (mCurrentTrack == LLSettingsDay::TRACK_WATER) ? "water_label" : "sky_label"; + + mAddFrameButton->setLabelArg("[FRAME]", getString(label_arg)); + mDeleteFrameButton->setLabelArg("[FRAME]", getString(label_arg)); + mLoadFrame->setLabelArg("[FRAME]", getString(label_arg)); +} + void LLFloaterEditExtDayCycle::updateButtons() { // This logic appears to work in reverse, the add frame button diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index 6224517aa0..a9b5c8a3f0 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -131,6 +131,7 @@ private: void updateWaterTabs(const LLSettingsWaterPtr_t &p_water); void updateSkyTabs(const LLSettingsSkyPtr_t &p_sky); void updateButtons(); + void updateLabels(); void updateSlider(); //generate sliders from current track void updateTimeAndLabel(); void addSliderFrame(const F32 frame, const LLSettingsBase::ptr_t &setting, bool update_ui = true); diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index 9aa7c6f499..cac6f334c7 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -21,6 +21,8 @@ ([HH]:[MM]) Sky [ALT] + Sky + Water @@ -408,7 +410,7 @@ follows="top|left" height="23" width="90" - label="Load Frame" + label="Load [FRAME]" top_pad="0" left_delta="0" name="btn_load_frame" /> @@ -416,7 +418,7 @@ follows="left|top" height="23" width="90" - label="Delete Frame" + label="Delete [FRAME]" top_pad="0" left_delta="0" name="delete_frame" /> -- cgit v1.2.3 From 7650fb53c8f2735c7cdf9178cd5ac1c6902cec8a Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 5 Dec 2018 18:10:08 +0200 Subject: [EEP] NULL gAtmosphere crash fix --- indra/newview/lldrawpoolwlsky.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 9ce7912c45..8904020ab9 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -395,8 +395,11 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const void LLDrawPoolWLSky::renderSkyCloudsAdvanced(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader* cloudshader) const { - if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex()) - { + if (gPipeline.canUseWindLightShaders() + && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) + && gSky.mVOSkyp->getCloudNoiseTex() + && gAtmosphere) + { LLGLSPipelineBlendSkyBox pipeline(true, true); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); -- cgit v1.2.3 From 76071d4fe8f2b88e33d0393fe00dc2ce88f71935 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 5 Dec 2018 22:13:49 +0200 Subject: SL-10091 EEP Filter out dupplicate refreshes and callbacks --- indra/newview/llenvironment.cpp | 61 ++++++++++++++++++------- indra/newview/llenvironment.h | 23 +++++----- indra/newview/llfloaterland.cpp | 16 ++++++- indra/newview/llfloaterregioninfo.cpp | 22 +++++++--- indra/newview/llpanelenvironment.cpp | 83 +++++++++++++++++++---------------- indra/newview/llpanelenvironment.h | 4 +- 6 files changed, 135 insertions(+), 74 deletions(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 3a030bb09d..20021fb075 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -76,6 +76,7 @@ namespace const std::string KEY_DAYNAME("day_name"); const std::string KEY_DAYNAMES("day_names"); const std::string KEY_DAYOFFSET("day_offset"); + const std::string KEY_ENVVERSION("env_version"); const std::string KEY_ISDEFAULT("is_default"); const std::string KEY_PARCELID("parcel_id"); const std::string KEY_REGIONID("region_id"); @@ -329,6 +330,8 @@ const LLUUID LLEnvironment::KNOWN_SKY_SUNSET("95882e1b-7741-f082-d9d6-3a34ec644c const LLUUID LLEnvironment::KNOWN_SKY_MIDNIGHT("d8e50d02-a15b-17a7-3425-523bc20f67b8"); const S32 LLEnvironment::NO_TRACK(-1); +const S32 LLEnvironment::NO_VERSION(-3); // For viewer sided change, like ENV_LOCAL. -3 since -1 and -2 are taken by parcel initial server/viewer version +const S32 LLEnvironment::VERSION_CLEANUP(-4); // for cleanups const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg @@ -360,6 +363,7 @@ void LLEnvironment::initSingleton() gAgent.addParcelChangedCallback([this]() { onParcelChange(); }); //TODO: This frequently results in one more request than we need. It isn't breaking, but should be nicer. + // We need to know new env version to fix this, without it we can only do full re-request LLRegionInfoModel::instance().setUpdateCallback([this]() { requestRegion(); }); gAgent.addRegionChangedCallback([this]() { onRegionChange(); }); @@ -551,7 +555,7 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::getEnvironmentInstance(LLEnviro } -void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) +void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version) { if ((env < ENV_EDIT) || (env >= ENV_DEFAULT)) { @@ -567,11 +571,11 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe environment->animate(); if (!mSignalEnvChanged.empty()) - mSignalEnvChanged(env); + mSignalEnvChanged(env, env_version); } -void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironment::fixedEnvironment_t fixed) +void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironment::fixedEnvironment_t fixed, S32 env_version) { if ((env < ENV_EDIT) || (env >= ENV_DEFAULT)) { @@ -595,12 +599,12 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm if (!mSignalEnvChanged.empty()) - mSignalEnvChanged(env); + mSignalEnvChanged(env, env_version); /*TODO: readjust environment*/ } -void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsBase::ptr_t &settings) +void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version) { DayInstance::ptr_t environment = getEnvironmentInstance(env); @@ -647,22 +651,33 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe } } -void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId) +void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version) { setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); } -void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) +void LLEnvironment::setEnvironment(EnvSelection_t env, + const LLUUID &assetId, + LLSettingsDay::Seconds daylength, + LLSettingsDay::Seconds dayoffset, + S32 env_version) { LLSettingsVOBase::getSettingsAsset(assetId, - [this, env, daylength, dayoffset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) + [this, env, daylength, dayoffset, env_version](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { - onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, TRANSITION_DEFAULT, status); + onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, TRANSITION_DEFAULT, status, env_version); }); } -void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status) +void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, + LLUUID asset_id, + LLSettingsBase::ptr_t settings, + LLSettingsDay::Seconds daylength, + LLSettingsDay::Seconds dayoffset, + LLSettingsBase::Seconds transition, + S32 status, + S32 env_version) { if (!settings || status) { @@ -687,7 +702,7 @@ void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env) mEnvironments[env].reset(); if (!mSignalEnvChanged.empty()) - mSignalEnvChanged(env); + mSignalEnvChanged(env, VERSION_CLEANUP); /*TODO: readjust environment*/ } @@ -1055,7 +1070,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI if (!envinfo->mDayCycle) { clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion); updateEnvironment(); } else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) @@ -1063,13 +1078,13 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI { LL_WARNS("LAPRAS") << "Invalid day cycle for region" << LL_ENDL; clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion); updateEnvironment(); } else { LL_INFOS("LAPRAS") << "Setting Region environment" << LL_ENDL; - setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); + setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset, envinfo->mEnvVersion); mTrackAltitudes = envinfo->mAltitudes; } @@ -1098,7 +1113,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI } else { - setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); + setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset, envinfo->mEnvVersion); } } @@ -1470,7 +1485,8 @@ LLEnvironment::EnvironmentInfo::EnvironmentInfo(): mIsDefault(false), mIsLegacy(false), mDayCycleName(), - mNameList() + mNameList(), + mEnvVersion(INVALID_PARCEL_ENVIRONMENT_VERSION) { } @@ -1526,6 +1542,17 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL } } + if (environment.has(KEY_ENVVERSION)) + { + LLSD version = environment[KEY_ENVVERSION]; + pinfo->mEnvVersion = version.asInteger(); + } + else + { + // can be used for region, but versions should be same + pinfo->mEnvVersion = pinfo->mIsDefault ? UNSET_PARCEL_ENVIRONMENT_VERSION : INVALID_PARCEL_ENVIRONMENT_VERSION; + } + return pinfo; } @@ -1746,7 +1773,7 @@ void LLEnvironment::setExperienceEnvironment(LLUUID experience_id, LLUUID asset_ mPushEnvironmentExpId = experience_id; onSetEnvAssetLoaded(ENV_PUSH, asset_id, settings, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, - LLSettingsBase::Seconds(transition_time), status); + LLSettingsBase::Seconds(transition_time), status, NO_VERSION); }); diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 7e35fdcfac..c5ac43704a 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -64,6 +64,8 @@ public: static const LLUUID KNOWN_SKY_MIDNIGHT; static const S32 NO_TRACK; + static const S32 NO_VERSION; + static const S32 VERSION_CLEANUP; struct EnvironmentInfo { @@ -84,6 +86,7 @@ public: bool mIsLegacy; std::string mDayCycleName; namelist_t mNameList; + S32 mEnvVersion; static ptr_t extract(LLSD); static ptr_t extractLegacy(LLSD); @@ -106,7 +109,7 @@ public: typedef std::pair fixedEnvironment_t; typedef std::function environment_apply_fn; - typedef boost::signals2::signal env_changed_signal_t; + typedef boost::signals2::signal env_changed_signal_t; typedef env_changed_signal_t::slot_type env_changed_fn; typedef std::array altitude_list_t; typedef std::vector altitudes_vect_t; @@ -135,14 +138,14 @@ public: EnvSelection_t getSelectedEnvironment() const { return mSelectedEnvironment; } bool hasEnvironment(EnvSelection_t env); - void setEnvironment(EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); - void setEnvironment(EnvSelection_t env, fixedEnvironment_t fixed); - void setEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &fixed); - void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t())); } - void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed)); } - void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw)); } - void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); - void setEnvironment(EnvSelection_t env, const LLUUID &assetId); + void setEnvironment(EnvSelection_t env, const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version = NO_VERSION); + void setEnvironment(EnvSelection_t env, fixedEnvironment_t fixed, S32 env_version = NO_VERSION); + void setEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &fixed, S32 env_version = NO_VERSION); + void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t()), env_version); } + void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed), env_version); } + void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw, S32 env_version = NO_VERSION) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw), env_version); } + void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 env_version = NO_VERSION); + void setEnvironment(EnvSelection_t env, const LLUUID &assetId, S32 env_version = NO_VERSION); void setSharedEnvironment(); @@ -381,7 +384,7 @@ private: void onAgentPositionHasChanged(const LLVector3 &localpos); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, LLSettingsBase::Seconds transition, S32 status, S32 env_version); void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset, altitudes_vect_t altitudes); void handleEnvironmentPushClear(LLUUID experience_id, LLSD &message, F32 transition); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 25cbf2f576..b20911edc5 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3281,16 +3281,18 @@ void LLPanelLandEnvironment::refresh() setCrossRegion(true); mCurrentEnvironment.reset(); mLastParcelId = INVALID_PARCEL_ID; + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; setControlsEnabled(false); return; } if (mLastParcelId != getParcelId()) { + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; mCurrentEnvironment.reset(); } - if (!mCurrentEnvironment) + if (!mCurrentEnvironment && mCurEnvVersion <= INVALID_PARCEL_ENVIRONMENT_VERSION) { refreshFromSource(); return; @@ -3307,6 +3309,7 @@ void LLPanelLandEnvironment::refreshFromSource() { setNoEnvironmentSupport(true); setControlsEnabled(false); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; return; } setNoEnvironmentSupport(false); @@ -3315,17 +3318,25 @@ void LLPanelLandEnvironment::refreshFromSource() { setNoSelection(true); setControlsEnabled(false); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; return; } setNoSelection(false); if (isSameRegion()) { + LL_DEBUGS("ENVIRONMENT") << "Requesting environment for parcel " << parcel->getLocalID() << ", known version " << mCurEnvVersion << LL_ENDL; setCrossRegion(false); LLHandle that_h = getHandle(); - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; + if (mCurEnvVersion < UNSET_PARCEL_ENVIRONMENT_VERSION) + { + // to mark as requesting + mCurEnvVersion = parcel->getParcelEnvironmentVersion(); + } + mLastParcelId = parcel->getLocalID(); + LLEnvironment::instance().requestParcel(parcel->getLocalID(), [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { @@ -3340,6 +3351,7 @@ void LLPanelLandEnvironment::refreshFromSource() setCrossRegion(true); mCurrentEnvironment.reset(); mLastParcelId = INVALID_PARCEL_ID; + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; } setControlsEnabled(false); } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 671f5aca9d..d7d114ca41 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -300,8 +300,7 @@ void LLFloaterRegionInfo::onOpen(const LLSD& key) disableTabCtrls(); return; } - refreshFromRegion(gAgent.getRegion()); - requestRegionInfo(); + requestRegionInfo(); // will cause refreshFromRegion() requestMeshRezInfo(); } @@ -484,6 +483,8 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->setCtrlsEnabled(allow_modify); + // Note: region info also causes LLRegionInfoModel::instance().update(msg); -> requestRegion(); -> changed message + // we need to know env version here and in update(msg) to know when to request and when not to, when to filter 'changed' floater->refreshFromRegion( gAgent.getRegion() ); } @@ -3410,7 +3411,10 @@ void LLPanelRegionEnvironment::refresh() { if (!mCurrentEnvironment) { - refreshFromSource(); + if (mCurEnvVersion <= INVALID_PARCEL_ENVIRONMENT_VERSION) + { + refreshFromSource(); // will immediately set mCurEnvVersion + } // else - already requesting return; } @@ -3426,15 +3430,17 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region) { setNoSelection(true); setControlsEnabled(false); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; } setNoSelection(false); if (gAgent.getRegion()->getRegionID() != region->getRegionID()) { setCrossRegion(true); + mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; } setCrossRegion(false); - + refreshFromSource(); return true; } @@ -3448,9 +3454,15 @@ void LLPanelRegionEnvironment::refreshFromEstate() void LLPanelRegionEnvironment::refreshFromSource() { + LL_DEBUGS("ENVIRONMENT") << "Requesting environment for region, known version " << mCurEnvVersion << LL_ENDL; LLHandle that_h = getHandle(); - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; + if (mCurEnvVersion < UNSET_PARCEL_ENVIRONMENT_VERSION) + { + // to mark as requesting + mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; + } + LLEnvironment::instance().requestRegion( [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 8c86e3e8e4..04f281a40c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -151,7 +151,7 @@ BOOL LLPanelEnvironmentInfo::postBuild() getChild(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); }); - mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env) { onEnvironmentChanged(env); }); + mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version) { onEnvironmentChanged(env, version); }); getChild(SDT_DROP_TARGET)->setPanel(this); @@ -389,7 +389,7 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) S32 rdo_selection = getChild(RDG_ENVIRONMENT_SELECT)->getSelectedIndex(); - bool can_enable = enabled && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION; + bool can_enable = enabled && mCurrentEnvironment && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION; getChild(RDG_ENVIRONMENT_SELECT)->setEnabled(can_enable); getChild(RDO_USEDEFAULT)->setEnabled(can_enable && !is_legacy); getChild(RDO_USEINV)->setEnabled(false); // these two are selected automatically based on @@ -431,16 +431,16 @@ void LLPanelEnvironmentInfo::setDirtyFlag(U32 flag) { bool can_edit = canEdit(); mDirtyFlag |= flag; - getChildView(BTN_APPLY)->setEnabled((mDirtyFlag != 0) && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION && can_edit); - getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && can_edit); + getChildView(BTN_APPLY)->setEnabled((mDirtyFlag != 0) && mCurrentEnvironment && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION && can_edit); + getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && mCurrentEnvironment && can_edit); } void LLPanelEnvironmentInfo::clearDirtyFlag(U32 flag) { bool can_edit = canEdit(); mDirtyFlag &= ~flag; - getChildView(BTN_APPLY)->setEnabled((mDirtyFlag != 0) && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION && can_edit); - getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && can_edit); + getChildView(BTN_APPLY)->setEnabled((mDirtyFlag != 0) && mCurrentEnvironment && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION && can_edit); + getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && mCurrentEnvironment && can_edit); } void LLPanelEnvironmentInfo::updateAltLabel(const std::string &alt_name, U32 sky_index, F32 alt_value) @@ -663,7 +663,6 @@ void LLPanelEnvironmentInfo::doApply() if (rdo_selection == 0) { - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; LLEnvironment::instance().resetParcel(parcel_id, [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } @@ -675,7 +674,6 @@ void LLPanelEnvironmentInfo::doApply() LL_WARNS("ENVPANEL") << "Failed to apply changes from editor! Dirty state: " << mDirtyFlag << " update state: " << mCurEnvVersion << LL_ENDL; return; } - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; LLEnvironment::instance().updateParcel(parcel_id, mCurrentEnvironment->mDayCycle->getAssetId(), std::string(), mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), alts, @@ -689,7 +687,6 @@ void LLPanelEnvironmentInfo::doApply() LL_WARNS("ENVPANEL") << "Failed to apply changes from editor! Dirty state: " << mDirtyFlag << " update state: " << mCurEnvVersion << LL_ENDL; return; } - mCurEnvVersion = INVALID_PARCEL_ENVIRONMENT_VERSION; LLEnvironment::instance().updateParcel(parcel_id, mCurrentEnvironment->mDayCycle, mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), alts, [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); @@ -780,36 +777,55 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday) } } -void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t env) +void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t env, S32 new_version) { + if (new_version < INVALID_PARCEL_ENVIRONMENT_VERSION) + { + // cleanups and local changes, we are only interested in changes sent by server + return; + } + + LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << new_version << LL_ENDL; + + // Environment comes from different sources, from environment update callbacks, + // from hovers (causes callbacks on version change) and from personal requests + // filter out duplicates and out of order packets by checking parcel environment version. + if (isRegion()) { - // Note: at the moment mCurEnvVersion is only applyable to parcels, we might need separate version control for regions - // but mCurEnvVersion still acts like indicator that update is pending - if (env == LLEnvironment::ENV_REGION) + // Note: region uses same init versions as parcel + if (env == LLEnvironment::ENV_REGION + // version should be always growing, UNSET_PARCEL_ENVIRONMENT_VERSION is backup case + && (mCurEnvVersion < new_version || mCurEnvVersion <= UNSET_PARCEL_ENVIRONMENT_VERSION)) { + if (new_version >= UNSET_PARCEL_ENVIRONMENT_VERSION) + { + // 'pending state' to prevent re-request on following onEnvironmentChanged if there will be any + mCurEnvVersion = new_version; + } mCurrentEnvironment.reset(); refreshFromSource(); } } - else if ((env == LLEnvironment::ENV_PARCEL) && (getParcelId() == LLViewerParcelMgr::instance().getAgentParcelId())) + else if ((env == LLEnvironment::ENV_PARCEL) + && (getParcelId() == LLViewerParcelMgr::instance().getAgentParcelId())) { - // Panel receives environment from different sources, from environment update callbacks, - // from hovers (causes callbacks on version change) and from personal requests - // filter out dupplicates and out of order packets by checking parcel environment version. LLParcel *parcel = getParcel(); if (parcel) { - S32 new_version = parcel->getParcelEnvironmentVersion(); - LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << new_version << LL_ENDL; + // first for parcel own settings, second is for case when parcel uses region settings if (mCurEnvVersion < new_version || (mCurEnvVersion != new_version && new_version == UNSET_PARCEL_ENVIRONMENT_VERSION)) { + // 'pending state' to prevent re-request on following onEnvironmentChanged if there will be any + mCurEnvVersion = new_version; mCurrentEnvironment.reset(); + refreshFromSource(); } - else + else if (mCurrentEnvironment) { + // update controls refresh(); } } @@ -839,30 +855,21 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(S32 parcel_id, LLEnvironment: } mCurrentEnvironment = envifo; clearDirtyFlag(DIRTY_FLAG_MASK); - if (parcel_id == INVALID_PARCEL_ID) + if (mCurrentEnvironment->mEnvVersion > INVALID_PARCEL_ENVIRONMENT_VERSION) { - // region, no version - // -2 for invalid version viewer -1 for invalid version from server - mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; + // Server provided version, use it + mCurEnvVersion = mCurrentEnvironment->mEnvVersion; + LL_DEBUGS("ENVPANEL") << " Setting environment version: " << mCurEnvVersion << " for parcel id: " << parcel_id << LL_ENDL; } + // Backup: Version was not provided for some reason else { - LLParcel* parcel = getParcel(); - if (parcel - && mCurrentEnvironment->mDayCycle - && mCurrentEnvironment->mDayCycle->getAssetId() != LLSettingsDay::GetDefaultAssetId()) - { - // not always up to date, we will get onEnvironmentChanged() update in such case. - mCurEnvVersion = parcel->getParcelEnvironmentVersion(); - } - else - { - // When using 'region' as parcel environment - mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION; - } - LL_DEBUGS("ENVPANEL") << " Setting environment version: " << mCurEnvVersion << LL_ENDL; + LL_WARNS("ENVPANEL") << " Environment version was not provided for " << parcel_id << ", old env version: " << mCurEnvVersion << LL_ENDL; } + refresh(); + + // todo: we have envifo and parcel env version, should we just setEnvironment() and parcel's property to prevent dupplicate requests? } void LLPanelEnvironmentInfo::_onEnvironmentReceived(LLHandle that_h, S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index bca7743145..05f25fa78f 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -142,7 +142,7 @@ protected: LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment; - void onEnvironmentChanged(LLEnvironment::EnvSelection_t env); + void onEnvironmentChanged(LLEnvironment::EnvSelection_t env, S32 version); class AltitudeData { @@ -160,7 +160,7 @@ protected: }; typedef std::map altitudes_data_t; altitudes_data_t mAltitudes; - S32 mCurEnvVersion; + S32 mCurEnvVersion; // used to filter duplicate callbacks/refreshes private: -- cgit v1.2.3 From ff334b6829f225cbd398188abbbf1ab6df6c613d Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 6 Dec 2018 17:41:05 +0200 Subject: SL-10165 Load Frame button on Day Cycle editor is not working when a frame is selected --- indra/newview/llfloatereditextdaycycle.cpp | 37 +++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index d02aa89780..f9b25c1977 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -430,7 +430,6 @@ void LLFloaterEditExtDayCycle::refresh() mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion() && show_apply); mImportButton->setEnabled(mCanMod); - mLoadFrame->setEnabled(mCanMod); LLFloater::refresh(); } @@ -1032,6 +1031,7 @@ void LLFloaterEditExtDayCycle::updateButtons() //mDeleteFrameButton->setEnabled(!can_add); mAddFrameButton->setEnabled(isAddingFrameAllowed() && mCanMod); mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod); + mLoadFrame->setEnabled(!mIsPlaying && mCanMod); } void LLFloaterEditExtDayCycle::updateSlider() @@ -1648,20 +1648,35 @@ void LLFloaterEditExtDayCycle::onAssetLoadedForFrame(LLUUID item_id, LLUUID asse { std::function cb = [this, settings, frame, track]() { - if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) + if (mFramesSlider->getCurSlider().empty()) { - LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL; - return; + if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) + { + LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL; + return; + } + if (!mFramesSlider->canAddSliders()) + { + LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame when slider is full." << LL_ENDL; + return; + } + mEditDay->setSettingsAtKeyframe(settings, frame, track); + addSliderFrame(frame, settings, false); + reblendSettings(); + synchronizeTabs(); } - if (!mFramesSlider->canAddSliders()) + else { - LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame when slider is full." << LL_ENDL; - return; + if (mCurrentTrack == LLSettingsDay::TRACK_WATER) + { + mEditDay->setWaterAtKeyframe(std::static_pointer_cast(settings), frame); + } + else + { + mEditDay->setSkyAtKeyframe(std::static_pointer_cast(settings), frame, track); + } + updateTabs(); } - mEditDay->setSettingsAtKeyframe(settings, frame, track); - addSliderFrame(frame, settings, false); - reblendSettings(); - synchronizeTabs(); }; if (!settings || status) -- cgit v1.2.3