From 714df9c4f7c9f24eae1064f45306dea01803ba09 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 28 Jan 2019 21:24:11 +0200 Subject: SL-10426 Fixed Inventory day cycle doesn't apply to the parcel from About Land --- indra/newview/llfloatereditextdaycycle.cpp | 9 ++++++++- indra/newview/llpanelenvironment.cpp | 2 +- indra/newview/llsettingspicker.cpp | 32 +++++++++++++++--------------- indra/newview/llsettingspicker.h | 13 +++++++++--- 4 files changed, 35 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 42c73d5668..3fac5e2b1f 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1910,7 +1910,14 @@ void LLFloaterEditExtDayCycle::doOpenInventoryFloater(LLSettingsType::type_e typ picker->setSettingsFilter(type); picker->setSettingsItemId(curritem); - picker->setTrackWater(mCurrentTrack == LLSettingsDay::TRACK_WATER); + if (type == LLSettingsType::ST_DAYCYCLE) + { + picker->setTrackMode((mCurrentTrack == LLSettingsDay::TRACK_WATER) ? LLFloaterSettingsPicker::TRACK_WATER : LLFloaterSettingsPicker::TRACK_SKY); + } + else + { + picker->setTrackMode(LLFloaterSettingsPicker::TRACK_NONE); + } picker->openFloater(); picker->setFocus(TRUE); } diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 55b579d0a2..66202982a2 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -338,7 +338,7 @@ LLFloaterSettingsPicker * LLPanelEnvironmentInfo::getSettingsPicker(bool create) mSettingsFloater = picker->getHandle(); - picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitted(data.asUUID()); }); + picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitted(data["ItemId"].asUUID()); }); } return picker; diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp index 5812fc59cd..e2d6d43ae3 100644 --- a/indra/newview/llsettingspicker.cpp +++ b/indra/newview/llsettingspicker.cpp @@ -72,7 +72,7 @@ LLFloaterSettingsPicker::LLFloaterSettingsPicker(LLView * owner, LLUUID initial_ mActive(true), mContextConeOpacity(0.0f), mSettingItemID(initial_item_id), - mTrackWater(true), + mTrackMode(TRACK_NONE), mImmediateFilterPermMask(PERM_NONE) { mOwnerHandle = owner->getHandle(); @@ -132,6 +132,8 @@ BOOL LLFloaterSettingsPicker::postBuild() childSetAction(BTN_CANCEL, [this](LLUICtrl*, const LLSD& param){ onButtonCancel(); }); childSetAction(BTN_SELECT, [this](LLUICtrl*, const LLSD& param){ onButtonSelect(); }); + getChild(PNL_COMBO)->setVisible(mTrackMode != TRACK_NONE); + // update permission filter once UI is fully initialized mSavedFolderState.setApply(FALSE); @@ -169,13 +171,18 @@ void LLFloaterSettingsPicker::setSettingsFilter(LLSettingsType::type_e type) filter = static_cast(0x1) << static_cast(type); } - bool day_cycle = (type != LLSettingsType::ST_WATER) && (type != LLSettingsType::ST_SKY); - getChild(PNL_COMBO)->setVisible(day_cycle); + mInventoryPanel->setFilterSettingsTypes(filter); +} + +void LLFloaterSettingsPicker::setTrackMode(ETrackMode mode) +{ + mTrackMode = mode; + getChild(PNL_COMBO)->setVisible(mode != TRACK_NONE); + std::string prefix = getString(STR_TITLE_PREFIX); std::string label; - if (day_cycle) + if (mode != TRACK_NONE) { - label = getString(STR_TITLE_TRACK); } else @@ -183,8 +190,6 @@ void LLFloaterSettingsPicker::setSettingsFilter(LLSettingsType::type_e type) label = getString(STR_TITLE_SETTINGS); } setTitle(prefix + " " + label); - - mInventoryPanel->setFilterSettingsTypes(filter); } void LLFloaterSettingsPicker::draw() @@ -234,7 +239,6 @@ void LLFloaterSettingsPicker::onFilterEdit(const std::string& search_string) void LLFloaterSettingsPicker::onSelectionChange(const LLFloaterSettingsPicker::itemlist_t &items, bool user_action) { - bool track_picker_enabled = false; bool is_item = false; LLUUID asset_id; if (items.size()) @@ -260,15 +264,11 @@ void LLFloaterSettingsPicker::onSelectionChange(const LLFloaterSettingsPicker::i { mChangeIDSignal(mSettingItemID); } - - if (bridge_model->getSettingsType() == LLSettingsType::ST_DAYCYCLE - && !mNoCopySettingsSelected) - { - track_picker_enabled = true; - } } } } + bool track_picker_enabled = mTrackMode != TRACK_NONE; + getChild(CMB_TRACK_SELECTION)->setEnabled(track_picker_enabled && mSettingAssetID == asset_id); getChild(BTN_SELECT)->setEnabled(is_item && (!track_picker_enabled || mSettingAssetID == asset_id)); if (track_picker_enabled && asset_id.notNull() && mSettingAssetID != asset_id) @@ -304,11 +304,11 @@ void LLFloaterSettingsPicker::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr track_selection->removeall(); LLSettingsDay::ptr_t pday = std::dynamic_pointer_cast(settings); - if (mTrackWater) + if (mTrackMode == TRACK_WATER) { track_selection->add(getString(STR_TRACK_WATER), LLSD::Integer(LLSettingsDay::TRACK_WATER), ADD_TOP, true); } - else + else if (mTrackMode == TRACK_SKY) { // track 1 always present track_selection->add(getString(STR_TRACK_GROUND), LLSD::Integer(LLSettingsDay::TRACK_GROUND_LEVEL), ADD_TOP, true); diff --git a/indra/newview/llsettingspicker.h b/indra/newview/llsettingspicker.h index f5aecf4417..859f92fbe8 100644 --- a/indra/newview/llsettingspicker.h +++ b/indra/newview/llsettingspicker.h @@ -45,6 +45,12 @@ class LLInventoryPanel; class LLFloaterSettingsPicker : public LLFloater { public: + enum ETrackMode + { + TRACK_NONE, + TRACK_WATER, + TRACK_SKY + }; typedef std::function close_callback_t; typedef std::function id_changed_callback_t; @@ -65,8 +71,9 @@ public: LLSettingsType::type_e getSettingsFilter() const { return mSettingsType; } // Only for day cycle - void setTrackWater(bool use_water) { mTrackWater = use_water; } - void setTrackSky(bool use_sky) { mTrackWater = !use_sky; } + void setTrackMode(ETrackMode mode); + void setTrackWater() { mTrackMode = TRACK_WATER; } + void setTrackSky() { mTrackMode = TRACK_SKY; } // Takes a UUID, wraps get/setImageAssetID virtual void setValue(const LLSD& value) override; @@ -108,7 +115,7 @@ private: LLHandle mOwnerHandle; LLUUID mSettingItemID; LLUUID mSettingAssetID; - bool mTrackWater; + ETrackMode mTrackMode; LLFilterEditor * mFilterEdit; LLInventoryPanel * mInventoryPanel; -- cgit v1.2.3