summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-01-03 08:47:03 -0800
committerGraham Linden <graham@lindenlab.com>2019-01-03 08:47:03 -0800
commitcccb3a541c655c15c7578bb50dd762b68ccbfcac (patch)
tree724f8a16f9edbaaf461ca034a0ba413384d7c7e0 /indra/newview
parent744e22e3645e205fa3f37ff3532bca607057887f (diff)
parentd607d81dba25dfe7dd1ecdf123af656ca939924f (diff)
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp11
-rw-r--r--indra/newview/llenvironment.h5
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp19
-rw-r--r--indra/newview/llfloatereditextdaycycle.h2
-rw-r--r--indra/newview/llfloaterland.cpp8
-rw-r--r--indra/newview/llfloaterregioninfo.cpp69
-rw-r--r--indra/newview/llinventorypanel.cpp28
-rw-r--r--indra/newview/llinventorypanel.h3
-rw-r--r--indra/newview/llpanelenvironment.cpp334
-rw-r--r--indra/newview/llpanelenvironment.h33
-rw-r--r--indra/newview/llsettingspicker.cpp19
-rw-r--r--indra/newview/llsettingspicker.h1
-rw-r--r--indra/newview/llsettingsvo.cpp21
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml3
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml6
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_environment.xml528
16 files changed, 803 insertions, 287 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index a8a386edee..3541eb40fa 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -1600,6 +1600,7 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL
LLSD daynames = environment[KEY_DAYNAMES];
if (daynames.isArray())
{
+ pinfo->mDayCycleName.clear();
for (S32 index = 0; index < pinfo->mNameList.size(); ++index)
{
pinfo->mNameList[index] = daynames[index].asString();
@@ -1607,9 +1608,19 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL
}
else if (daynames.isString())
{
+ for (std::string &name: pinfo->mNameList)
+ {
+ name.clear();
+ }
+
pinfo->mDayCycleName = daynames.asString();
}
}
+ else if (pinfo->mDayCycle)
+ {
+ pinfo->mDayCycleName = pinfo->mDayCycle->getName();
+ }
+
if (environment.has(KEY_ENVVERSION))
{
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h
index 47e0f0208b..1dd7496b02 100644
--- a/indra/newview/llenvironment.h
+++ b/indra/newview/llenvironment.h
@@ -380,7 +380,10 @@ private:
mDayOffset(day_offset),
mAltitudes(altitudes),
mDayName()
- {}
+ {
+ if (mDayp)
+ mDayName = mDayp->getName();
+ }
UpdateInfo(LLUUID settings_asset, std::string name, S32 day_length, S32 day_offset, altitudes_vect_t altitudes) :
mDayp(),
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 7184d07ee3..41582ffcc3 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -495,6 +495,20 @@ void LLFloaterEditExtDayCycle::setEditDefaultDayCycle()
[this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); });
}
+std::string LLFloaterEditExtDayCycle::getEditName() const
+{
+ if (mEditDay)
+ return mEditDay->getName();
+ return "new";
+}
+
+void LLFloaterEditExtDayCycle::setEditName(const std::string &name)
+{
+ if (mEditDay)
+ mEditDay->setName(name);
+ getChild<LLLineEditor>(TXT_DAY_NAME)->setText(name);
+}
+
/* virtual */
BOOL LLFloaterEditExtDayCycle::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent)
{
@@ -951,6 +965,11 @@ void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force )
bool show_water = (mCurrentTrack == LLSettingsDay::TRACK_WATER);
mSkyTabLayoutContainer->setVisible(!show_water);
mWaterTabLayoutContainer->setVisible(show_water);
+
+ std::string iconname = (show_water) ? "Inv_SettingsWater" : "Inv_SettingsSky";
+
+ mFramesSlider->setSliderThumbImage(iconname);
+
updateSlider();
updateLabels();
}
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index 1dea77571f..1967f5a470 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -92,6 +92,8 @@ public:
void setEditDayCycle(const LLSettingsDay::ptr_t &pday);
void setEditDefaultDayCycle();
+ std::string getEditName() const;
+ void setEditName(const std::string &name);
LLUUID getEditingAssetId() { return mEditDay ? mEditDay->getAssetId() : LLUUID::null; }
LLUUID getEditingInventoryId() { return mInventoryId; }
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index b20911edc5..380302b51e 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -3265,9 +3265,10 @@ BOOL LLPanelLandEnvironment::postBuild()
if (!LLPanelEnvironmentInfo::postBuild())
return FALSE;
- getChild<LLUICtrl>(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION));
+ getChild<LLUICtrl>(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION));
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(FALSE);
- getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(FALSE);
+ getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE);
+
return TRUE;
}
@@ -3375,7 +3376,8 @@ bool LLPanelLandEnvironment::canEdit()
LLParcel *parcel = getParcel();
if (!parcel)
return false;
- return LLEnvironment::instance().canAgentUpdateParcelEnvironment(parcel);
+
+ return LLEnvironment::instance().canAgentUpdateParcelEnvironment(parcel) && mAllowOverride;
}
S32 LLPanelLandEnvironment::getParcelId()
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index fcaa7d2bf9..3e07c4abc7 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -188,7 +188,6 @@ public:
virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); }
bool refreshFromRegion(LLViewerRegion* region);
- void refreshFromEstate();
virtual BOOL postBuild() override;
virtual void onOpen(const LLSD& key) override {};
@@ -198,16 +197,14 @@ public:
protected:
static const U32 DIRTY_FLAG_OVERRIDE;
- virtual void doApply() override;
-
virtual void refreshFromSource() override;
- bool doUpdateEstate(const LLSD& notification, const LLSD& response);
+ bool confirmUpdateEstateEnvironment(const LLSD& notification, const LLSD& response);
void onChkAllowOverride(bool value);
private:
- bool mAllowOverride;
+ bool mAllowOverrideRestore;
};
@@ -3403,7 +3400,7 @@ const U32 LLPanelRegionEnvironment::DIRTY_FLAG_OVERRIDE(0x01 << 4);
LLPanelRegionEnvironment::LLPanelRegionEnvironment():
LLPanelEnvironmentInfo(),
- mAllowOverride(false)
+ mAllowOverrideRestore(false)
{
LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this));
@@ -3416,7 +3413,7 @@ BOOL LLPanelRegionEnvironment::postBuild()
if (!LLPanelEnvironmentInfo::postBuild())
return FALSE;
- getChild<LLUICtrl>(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT));
+ getChild<LLUICtrl>(BTN_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT));
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(TRUE);
getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(TRUE);
@@ -3436,7 +3433,6 @@ void LLPanelRegionEnvironment::refresh()
return;
}
- refreshFromEstate();
LLPanelEnvironmentInfo::refresh();
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride);
@@ -3463,13 +3459,6 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
return true;
}
-void LLPanelRegionEnvironment::refreshFromEstate()
-{
- const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
-
- mAllowOverride = estate_info.getAllowEnvironmentOverride();
-}
-
void LLPanelRegionEnvironment::refreshFromSource()
{
LL_DEBUGS("ENVIRONMENT") << "Requesting environment for region, known version " << mCurEnvVersion << LL_ENDL;
@@ -3487,31 +3476,7 @@ void LLPanelRegionEnvironment::refreshFromSource()
setControlsEnabled(false);
}
-void LLPanelRegionEnvironment::doApply()
-{
- LLPanelEnvironmentInfo::doApply();
-
- if (getIsDirtyFlag(DIRTY_FLAG_OVERRIDE))
- {
- LLNotification::Params params("ChangeLindenEstate");
- //params.functor.function(boost::bind(&LLPanelEstateInfo::doUpdateEstate, this, _1, _2));
- params.functor.function([this](const LLSD& notification, const LLSD& response) { doUpdateEstate(notification, response); });
-
- if (LLPanelEstateInfo::isLindenEstate())
- {
- // trying to change reserved estate, warn
- LLNotifications::instance().add(params);
- }
- else
- {
- // for normal estates, just make the change
- LLNotifications::instance().forceResponse(params, 0);
- }
-
- }
-}
-
-bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LLSD& response)
+bool LLPanelRegionEnvironment::confirmUpdateEstateEnvironment(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -3530,6 +3495,9 @@ bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LL
break;
case 1:
+ mAllowOverride = mAllowOverrideRestore;
+ getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(mAllowOverride);
+ break;
default:
break;
}
@@ -3538,11 +3506,24 @@ bool LLPanelRegionEnvironment::doUpdateEstate(const LLSD& notification, const LL
void LLPanelRegionEnvironment::onChkAllowOverride(bool value)
{
- if (!value)
+ setDirtyFlag(DIRTY_FLAG_OVERRIDE);
+ mAllowOverrideRestore = mAllowOverride;
+ mAllowOverride = value;
+
+ LLNotification::Params params("ChangeLindenEstate");
+ params.functor.function([this](const LLSD& notification, const LLSD& response) { confirmUpdateEstateEnvironment(notification, response); });
+
+ std::string notification("EstateParcelEnvironmentOverride");
+ if (LLPanelEstateInfo::isLindenEstate())
+ notification = "ChangeLindenEstate";
+
+ if (!value || LLPanelEstateInfo::isLindenEstate())
+ { // warn if turning off or a Linden Estate
+ LLNotifications::instance().add(params);
+ }
+ else
{
- LLNotificationsUtil::add("EstateParcelEnvironmentOverride");
+ LLNotifications::instance().forceResponse(params, 0);
}
- setDirtyFlag(DIRTY_FLAG_OVERRIDE);
- mAllowOverride = value;
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 7fea502c0f..5f244ec6a2 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -152,6 +152,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mShowItemLinkOverlays(p.show_item_link_overlays),
mShowEmptyMessage(p.show_empty_message),
mSuppressFolderMenu(p.suppress_folder_menu),
+ mSuppressOpenItemAction(false),
mViewsInitialized(false),
mInvFVBridgeBuilder(NULL),
mInventoryViewModel(p.name),
@@ -1658,21 +1659,18 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
// Open selected items if enter key hit on the inventory panel
if (mask == MASK_NONE)
{
-
-// @TODO$: Rider: This code is dead with Outbox, however should something similar be
-// done for VMM?
-//
-// //Don't allow attaching or opening items from Merchant Outbox
-// LLFolderViewItem* folder_item = mFolderRoot.get()->getCurSelectedItem();
-// if(folder_item)
-// {
-// LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
-// if(bridge && bridge->is() && (bridge->getInventoryType() != LLInventoryType::IT_CATEGORY))
-// {
-// return handled;
-// }
-// }
-
+ if (mSuppressOpenItemAction)
+ {
+ LLFolderViewItem* folder_item = mFolderRoot.get()->getCurSelectedItem();
+ if(folder_item)
+ {
+ LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
+ if(bridge && (bridge->getInventoryType() != LLInventoryType::IT_CATEGORY))
+ {
+ return handled;
+ }
+ }
+ }
LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), "open");
handled = TRUE;
}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 97e1c37a31..b2a60543af 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -243,6 +243,8 @@ public:
void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
void updateSelection();
+ void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; }
+
LLFolderViewModelInventory* getFolderViewModel() { return &mInventoryViewModel; }
const LLFolderViewModelInventory* getFolderViewModel() const { return &mInventoryViewModel; }
@@ -264,6 +266,7 @@ protected:
bool mShowItemLinkOverlays; // Shows link graphic over inventory item icons
bool mShowEmptyMessage;
bool mSuppressFolderMenu;
+ bool mSuppressOpenItemAction;
LLHandle<LLFolderView> mFolderRoot;
LLScrollContainer* mScroller;
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index e3be46f1af..b4007cfdf0 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -54,23 +54,25 @@
namespace
{
const std::string FLOATER_DAY_CYCLE_EDIT("env_edit_extdaycycle");
+
+ inline bool ends_with(std::string const & value, std::string const & ending)
+ {
+ if (ending.size() > value.size())
+ return false;
+ return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
+ }
+
}
//=========================================================================
-const std::string LLPanelEnvironmentInfo::RDG_ENVIRONMENT_SELECT("rdg_environment_select");
-const std::string LLPanelEnvironmentInfo::RDO_USEDEFAULT("rdo_use_xxx_setting");
-const std::string LLPanelEnvironmentInfo::RDO_USEINV("rdo_use_inv_setting");
-const std::string LLPanelEnvironmentInfo::RDO_USECUSTOM("rdo_use_custom_setting");
-const std::string LLPanelEnvironmentInfo::EDT_INVNAME("edt_inventory_name");
const std::string LLPanelEnvironmentInfo::BTN_SELECTINV("btn_select_inventory");
const std::string LLPanelEnvironmentInfo::BTN_EDIT("btn_edit");
+const std::string LLPanelEnvironmentInfo::BTN_USEDEFAULT("btn_usedefault");
const std::string LLPanelEnvironmentInfo::SLD_DAYLENGTH("sld_day_length");
const std::string LLPanelEnvironmentInfo::SLD_DAYOFFSET("sld_day_offset");
const std::string LLPanelEnvironmentInfo::SLD_ALTITUDES("sld_altitudes");
const std::string LLPanelEnvironmentInfo::ICN_GROUND("icon_ground");
const std::string LLPanelEnvironmentInfo::CHK_ALLOWOVERRIDE("chk_allow_override");
-const std::string LLPanelEnvironmentInfo::BTN_APPLY("btn_apply");
-const std::string LLPanelEnvironmentInfo::BTN_CANCEL("btn_cancel");
const std::string LLPanelEnvironmentInfo::LBL_TIMEOFDAY("lbl_apparent_time");
const std::string LLPanelEnvironmentInfo::PNL_SETTINGS("pnl_environment_config");
const std::string LLPanelEnvironmentInfo::PNL_ENVIRONMENT_ALTITUDES("pnl_environment_altitudes");
@@ -86,6 +88,7 @@ const std::string LLPanelEnvironmentInfo::STR_ALTITUDE_DESCRIPTION("str_altitude
const std::string LLPanelEnvironmentInfo::STR_NO_PARCEL("str_no_parcel");
const std::string LLPanelEnvironmentInfo::STR_CROSS_REGION("str_cross_region");
const std::string LLPanelEnvironmentInfo::STR_LEGACY("str_legacy");
+const std::string LLPanelEnvironmentInfo::STR_DISALLOWED("str_disallowed");
const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE(0x01 << 0);
const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH(0x01 << 1);
@@ -111,9 +114,9 @@ const std::string alt_labels[] = {
"alt2",
"alt3",
"ground",
+ "water",
};
-
static LLDefaultChildRegistry::Register<LLSettingsDropTarget> r("settings_drop_target");
//=========================================================================
@@ -126,7 +129,8 @@ LLPanelEnvironmentInfo::LLPanelEnvironmentInfo():
mNoEnvironment(false),
mCurEnvVersion(INVALID_PARCEL_ENVIRONMENT_VERSION),
mSettingsFloater(),
- mEditFloater()
+ mEditFloater(),
+ mAllowOverride(true)
{
}
@@ -140,16 +144,17 @@ LLPanelEnvironmentInfo::~LLPanelEnvironmentInfo()
BOOL LLPanelEnvironmentInfo::postBuild()
{
- getChild<LLUICtrl>(RDG_ENVIRONMENT_SELECT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onSwitchDefaultSelection(); });
+ getChild<LLUICtrl>(BTN_USEDEFAULT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnDefault(); });
getChild<LLUICtrl>(BTN_SELECTINV)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnSelect(); });
getChild<LLUICtrl>(BTN_EDIT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnEdit(); });
- getChild<LLUICtrl>(BTN_APPLY)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnApply(); });
- getChild<LLUICtrl>(BTN_CANCEL)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnReset(); });
getChild<LLUICtrl>(SLD_DAYLENGTH)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayLengthChanged(value.asReal()); });
+ getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); });
getChild<LLUICtrl>(SLD_DAYOFFSET)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayOffsetChanged(value.asReal()); });
+ getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); });
getChild<LLMultiSliderCtrl>(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); });
+ getChild<LLMultiSliderCtrl>(SLD_ALTITUDES)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onAltSliderMouseUp(); });
mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version) { onEnvironmentChanged(env, version); });
@@ -211,31 +216,31 @@ void LLPanelEnvironmentInfo::refresh()
return;
}
- S32 rdo_selection = 0;
- if ((!mCurrentEnvironment->mDayCycle) ||
- ((mCurrentEnvironment->mParcelId == INVALID_PARCEL_ID) && (mCurrentEnvironment->mDayCycle->getAssetId() == LLSettingsDay::GetDefaultAssetId() )))
- {
- getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
- }
- else if (!mCurrentEnvironment->mDayCycle->getAssetId().isNull())
- {
- rdo_selection = 1;
-
- LLUUID asset_id = mCurrentEnvironment->mDayCycle->getAssetId();
-
- std::string inventoryname = getInventoryNameForAssetId(asset_id);
-
- if (inventoryname.empty())
- inventoryname = "(" + mCurrentEnvironment->mDayCycle->getName() + ")";
-
- getChild<LLUICtrl>(EDT_INVNAME)->setValue(inventoryname);
- }
- else
- { // asset id is null so this is a custom environment
- rdo_selection = 2;
- getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
- }
- getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->setSelectedIndex(rdo_selection);
+// S32 rdo_selection = 0;
+// if ((!mCurrentEnvironment->mDayCycle) ||
+// ((mCurrentEnvironment->mParcelId == INVALID_PARCEL_ID) && (mCurrentEnvironment->mDayCycle->getAssetId() == LLSettingsDay::GetDefaultAssetId() )))
+// {
+// getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
+// }
+// else if (!mCurrentEnvironment->mDayCycle->getAssetId().isNull())
+// {
+// rdo_selection = 1;
+//
+// LLUUID asset_id = mCurrentEnvironment->mDayCycle->getAssetId();
+//
+// std::string inventoryname = getInventoryNameForAssetId(asset_id);
+//
+// if (inventoryname.empty())
+// inventoryname = "(" + mCurrentEnvironment->mDayCycle->getName() + ")";
+//
+// getChild<LLUICtrl>(EDT_INVNAME)->setValue(inventoryname);
+// }
+// else
+// { // asset id is null so this is a custom environment
+// rdo_selection = 2;
+// getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
+// }
+// getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->setSelectedIndex(rdo_selection);
F32Hours daylength(mCurrentEnvironment->mDayLength);
F32Hours dayoffset(mCurrentEnvironment->mDayOffset);
@@ -245,8 +250,8 @@ void LLPanelEnvironmentInfo::refresh()
getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setValue(daylength.value());
getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setValue(dayoffset.value());
- getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setEnabled(canEdit() && (rdo_selection != 0) && !mCurrentEnvironment->mIsLegacy);
- getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setEnabled(canEdit() && (rdo_selection != 0) && !mCurrentEnvironment->mIsLegacy);
+// getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setEnabled(canEdit() && (rdo_selection != 0) && !mCurrentEnvironment->mIsLegacy);
+// getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setEnabled(canEdit() && (rdo_selection != 0) && !mCurrentEnvironment->mIsLegacy);
udpateApparentTimeOfDay();
@@ -271,6 +276,28 @@ void LLPanelEnvironmentInfo::refresh()
readjustAltLabels();
}
+ updateAltLabel(alt_labels[3], 1, 0); // ground
+ updateAltLabel(alt_labels[4], 0, 0); // water
+
+}
+
+void LLPanelEnvironmentInfo::refreshFromEstate()
+{
+ /*TODO: Bug!! estate_info seems stale if regain floater has not been opened.*/
+ const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
+
+ if (isRegion())
+ { // this should always work... but estate_info gives back false when it shouldn't for parcels
+ bool oldAO = mAllowOverride;
+ mAllowOverride = estate_info.getAllowEnvironmentOverride();
+ if (oldAO != mAllowOverride)
+ refresh();
+ }
+ else
+ {
+ // Get rid of this when I solve the above.
+ mAllowOverride = true;
+ }
}
std::string LLPanelEnvironmentInfo::getInventoryNameForAssetId(LLUUID asset_id)
@@ -282,6 +309,27 @@ std::string LLPanelEnvironmentInfo::getInventoryNameForAssetId(LLUUID asset_id)
return name;
}
+
+std::string LLPanelEnvironmentInfo::getNameForTrackIndex(S32 index)
+{
+ std::string invname;
+
+ LL_WARNS("LAPRAS") << "mDayCycleName='" << mCurrentEnvironment->mDayCycleName << "'" << LL_ENDL;
+ if (mCurrentEnvironment->mDayCycleName.empty())
+ {
+ invname = mCurrentEnvironment->mNameList[index];
+ }
+ else if (!mCurrentEnvironment->mDayCycle->isTrackEmpty(index))
+ {
+ invname = mCurrentEnvironment->mDayCycleName;
+ }
+
+ if (invname.empty())
+ invname = getString("str_empty");
+
+ return invname;
+}
+
LLFloaterSettingsPicker * LLPanelEnvironmentInfo::getSettingsPicker(bool create)
{
LLFloaterSettingsPicker *picker = static_cast<LLFloaterSettingsPicker *>(mSettingsFloater.get());
@@ -375,6 +423,11 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
is_unavailable = true;
getChild<LLTextBox>(TXT_DISABLED)->setText(getString(STR_CROSS_REGION));
}
+ else if (!isRegion() && !mAllowOverride)
+ {
+ is_unavailable = true;
+ getChild<LLTextBox>(TXT_DISABLED)->setText(getString(STR_DISALLOWED));
+ }
if (is_unavailable)
{
@@ -391,26 +444,18 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
getChild<LLUICtrl>(PNL_BUTTONS)->setVisible(true);
getChild<LLUICtrl>(PNL_DISABLED)->setVisible(false);
- getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(isRegion() && LLEnvironment::instance().isExtendedEnvironmentEnabled());
-
- S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex();
+ getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(LLEnvironment::instance().isExtendedEnvironmentEnabled());
- bool can_enable = enabled && mCurrentEnvironment && mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION;
- getChild<LLUICtrl>(RDG_ENVIRONMENT_SELECT)->setEnabled(can_enable);
- getChild<LLUICtrl>(RDO_USEDEFAULT)->setEnabled(can_enable && !is_legacy);
- getChild<LLUICtrl>(RDO_USEINV)->setEnabled(false); // these two are selected automatically based on
- getChild<LLUICtrl>(RDO_USECUSTOM)->setEnabled(false);
- getChild<LLUICtrl>(EDT_INVNAME)->setEnabled(FALSE);
+ bool can_enable = enabled && mCurrentEnvironment && (mCurEnvVersion != INVALID_PARCEL_ENVIRONMENT_VERSION);
getChild<LLUICtrl>(BTN_SELECTINV)->setEnabled(can_enable && !is_legacy);
+ getChild<LLUICtrl>(BTN_USEDEFAULT)->setEnabled(can_enable && !is_legacy);
getChild<LLUICtrl>(BTN_EDIT)->setEnabled(can_enable);
- getChild<LLUICtrl>(SLD_DAYLENGTH)->setEnabled(can_enable && (rdo_selection != 0) && !is_legacy);
- getChild<LLUICtrl>(SLD_DAYOFFSET)->setEnabled(can_enable && (rdo_selection != 0) && !is_legacy);
+ getChild<LLUICtrl>(SLD_DAYLENGTH)->setEnabled(can_enable && !is_legacy);
+ getChild<LLUICtrl>(SLD_DAYOFFSET)->setEnabled(can_enable && !is_legacy);
getChild<LLUICtrl>(SLD_ALTITUDES)->setEnabled(can_enable && isRegion() && !is_legacy);
getChild<LLUICtrl>(ICN_GROUND)->setColor((can_enable && isRegion() && !is_legacy) ? LLColor4::white : LLColor4::grey % 0.8f);
getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setEnabled(can_enable && isRegion() && !is_legacy);
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setEnabled(can_enable && isRegion() && !is_legacy);
- getChild<LLUICtrl>(BTN_APPLY)->setEnabled(can_enable && (mDirtyFlag != 0));
- getChild<LLUICtrl>(BTN_CANCEL)->setEnabled(enabled && (mDirtyFlag != 0));
getChild<LLSettingsDropTarget>(SDT_DROP_TARGET)->setDndEnabled(enabled && !is_legacy);
@@ -435,18 +480,12 @@ void LLPanelEnvironmentInfo::setApplyProgress(bool started)
void LLPanelEnvironmentInfo::setDirtyFlag(U32 flag)
{
- bool can_edit = canEdit();
mDirtyFlag |= flag;
- 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) && 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)
@@ -460,7 +499,10 @@ void LLPanelEnvironmentInfo::updateAltLabel(const std::string &alt_name, U32 sky
// get related text box
LLTextBox* text = getChild<LLTextBox>(alt_name);
- if (text)
+ LLLineEditor *field = getChild<LLLineEditor>("edt_invname_" + alt_name);
+ LLSettingsDropTarget *dt = getChild<LLSettingsDropTarget>("sdt_" + alt_name);
+
+ if (text && (sky_index > 1))
{
// move related text box
LLRect rect = text->getRect();
@@ -468,7 +510,6 @@ void LLPanelEnvironmentInfo::updateAltLabel(const std::string &alt_name, U32 sky
rect.mBottom = sld_bottom + (sld_offset / 2 + 1) + pos - (height / 2);
rect.mTop = rect.mBottom + height;
text->setRect(rect);
-
// update text
std::ostringstream convert;
convert << alt_value;
@@ -477,7 +518,26 @@ void LLPanelEnvironmentInfo::updateAltLabel(const std::string &alt_name, U32 sky
convert.clear();
convert << sky_index;
text->setTextArg("[INDEX]", convert.str());
+
+ if (field)
+ {
+ LLRect rect_name = field->getRect();
+ S32 name_height = rect_name.getHeight();
+ S32 center = rect.mBottom + (height / 2);
+ rect_name.mBottom = center - (name_height / 2);
+ rect_name.mTop = rect_name.mBottom + name_height;
+
+ field->setRect(rect_name);
+ if (dt)
+ dt->setRect(rect_name);
+ }
+ }
+
+ if (field)
+ {
+ field->setText(getNameForTrackIndex(sky_index));
}
+
}
void LLPanelEnvironmentInfo::readjustAltLabels()
@@ -492,10 +552,22 @@ void LLPanelEnvironmentInfo::readjustAltLabels()
ground_text_rect.mTop = ground_text_rect.mBottom + height;
text->setRect(ground_text_rect);
+// LLMultiSliderCtrl *sld = getChild<LLMultiSliderCtrl>(SLD_ALTITUDES);
+// for (U32 idx = 0; idx < ALTITUDE_SLIDER_COUNT; ++idx)
+// {
+// LLRect rect_sld = sld->getSliderThumbRect(alt_sliders[idx]);
+// LLTextBox* text_cmp = getChild<LLTextBox>(alt_labels[i]);
+//
+// LLRect rect_text = text_cmp->getRect();
+//
+// LL_WARNS("LAPRAS") << "slider[" << alt_sliders[idx] << "] -> " << rect_sld << " value=" << sld->getSliderValue(alt_sliders[idx]) LL_ENDL;
+// }
+
+
+#if 0
// Re-adjust all labels
// Very simple "adjust after the fact" method
// Note: labels are unordered, labels are 1 above sliders due to 'ground'
-
for (U32 i = 0; i < ALTITUDE_SLIDER_COUNT; i++)
{
LLTextBox* text_cmp = getChild<LLTextBox>(alt_labels[i]);
@@ -531,16 +603,7 @@ void LLPanelEnvironmentInfo::readjustAltLabels()
}
}
}
-}
-
-void LLPanelEnvironmentInfo::onSwitchDefaultSelection()
-{
- bool can_edit = canEdit();
- setDirtyFlag(DIRTY_FLAG_DAYCYCLE);
-
- S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex();
- getChild<LLUICtrl>(SLD_DAYLENGTH)->setEnabled(can_edit && (rdo_selection != 0));
- getChild<LLUICtrl>(SLD_DAYOFFSET)->setEnabled(can_edit && (rdo_selection != 0));
+#endif
}
void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)
@@ -566,6 +629,22 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
udpateApparentTimeOfDay();
}
+void LLPanelEnvironmentInfo::onDayLenOffsetMouseUp()
+{
+ if (getDirtyFlag() & (DIRTY_FLAG_DAYLENGTH | DIRTY_FLAG_DAYOFFSET))
+ {
+ clearDirtyFlag(DIRTY_FLAG_DAYOFFSET);
+ clearDirtyFlag(DIRTY_FLAG_DAYLENGTH);
+
+ LLHandle<LLPanel> that_h = getHandle();
+
+ LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(),
+ mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), LLEnvironment::altitudes_vect_t(),
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
+
+ }
+}
+
void LLPanelEnvironmentInfo::onAltSliderCallback(LLUICtrl *cntrl, const LLSD &data)
{
LLMultiSliderCtrl *sld = (LLMultiSliderCtrl *)cntrl;
@@ -593,6 +672,7 @@ void LLPanelEnvironmentInfo::onAltSliderCallback(LLUICtrl *cntrl, const LLSD &da
iter2++;
}
iter->second.mAltitudeIndex = new_index;
+
updateAltLabel(alt_labels[iter->second.mLabelIndex], iter->second.mAltitudeIndex + 1, iter->second.mAltitude);
iter++;
}
@@ -601,15 +681,33 @@ void LLPanelEnvironmentInfo::onAltSliderCallback(LLUICtrl *cntrl, const LLSD &da
setDirtyFlag(DIRTY_FLAG_ALTITUDES);
}
-void LLPanelEnvironmentInfo::onBtnApply()
+void LLPanelEnvironmentInfo::onAltSliderMouseUp()
{
- doApply();
+ if (isRegion() && (getDirtyFlag() & DIRTY_FLAG_ALTITUDES))
+ {
+ clearDirtyFlag(DIRTY_FLAG_ALTITUDES);
+
+ LLHandle<LLPanel> that_h = getHandle();
+ LLEnvironment::altitudes_vect_t alts;
+
+ for (auto alt : mAltitudes)
+ {
+ alts.push_back(alt.second.mAltitude);
+ }
+
+ LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(),
+ -1, -1, alts,
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
+
+ }
}
-void LLPanelEnvironmentInfo::onBtnReset()
+void LLPanelEnvironmentInfo::onBtnDefault()
{
- mCurrentEnvironment.reset();
- refreshFromSource();
+ LLHandle<LLPanel> that_h = getHandle();
+
+ LLEnvironment::instance().resetParcel(getParcelId(),
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
}
void LLPanelEnvironmentInfo::onBtnEdit()
@@ -624,7 +722,13 @@ void LLPanelEnvironmentInfo::onBtnEdit()
dayeditor->openFloater(params);
if (mCurrentEnvironment && mCurrentEnvironment->mDayCycle)
+ {
dayeditor->setEditDayCycle(mCurrentEnvironment->mDayCycle);
+ if (!ends_with(mCurrentEnvironment->mDayCycle->getName(), "(customized)"))
+ {
+ dayeditor->setEditName(mCurrentEnvironment->mDayCycle->getName() + "(customized)");
+ }
+ }
else
dayeditor->setEditDefaultDayCycle();
}
@@ -647,62 +751,6 @@ void LLPanelEnvironmentInfo::onBtnSelect()
}
-void LLPanelEnvironmentInfo::doApply()
-{
- S32 parcel_id = getParcelId();
-
- if (getIsDirtyFlag(DIRTY_FLAG_MASK))
- {
- LLHandle<LLPanel> that_h = getHandle();
- LLEnvironment::altitudes_vect_t alts;
-
- S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex();
-
- if (isRegion() && getIsDirtyFlag(DIRTY_FLAG_ALTITUDES))
- {
- altitudes_data_t::iterator it;
- for (auto alt : mAltitudes)
- {
- alts.push_back(alt.second.mAltitude);
- }
- }
-
- if (rdo_selection == 0)
- {
- LLEnvironment::instance().resetParcel(parcel_id,
- [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
- }
- else if (rdo_selection == 1)
- {
- if (!mCurrentEnvironment)
- {
- // Attempting to save mid update?
- LL_WARNS("ENVPANEL") << "Failed to apply changes from editor! Dirty state: " << mDirtyFlag << " update state: " << mCurEnvVersion << LL_ENDL;
- return;
- }
- LLEnvironment::instance().updateParcel(parcel_id,
- mCurrentEnvironment->mDayCycle->getAssetId(), std::string(), mCurrentEnvironment->mDayLength.value(),
- mCurrentEnvironment->mDayOffset.value(), alts,
- [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
- }
- else
- {
- if (!mCurrentEnvironment)
- {
- // Attempting to save mid update?
- LL_WARNS("ENVPANEL") << "Failed to apply changes from editor! Dirty state: " << mDirtyFlag << " update state: " << mCurEnvVersion << LL_ENDL;
- return;
- }
- 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); });
- }
-
- setControlsEnabled(false);
- }
-}
-
-
void LLPanelEnvironmentInfo::udpateApparentTimeOfDay()
{
static const F32 SECONDSINDAY(24.0 * 60.0 * 60.0);
@@ -751,16 +799,19 @@ void LLPanelEnvironmentInfo::onPickerCommitted(LLUUID item_id)
LLInventoryItem *itemp = gInventory.getItem(item_id);
if (itemp)
{
- LLSettingsVOBase::getSettingsAsset(itemp->getAssetUUID(), [this](LLUUID, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) {
- if (status)
- return;
- onPickerAssetDownloaded(settings);
- });
+ LLHandle<LLPanel> that_h = getHandle();
+
+ LLEnvironment::instance().updateParcel(getParcelId(), itemp->getAssetUUID(),
+ itemp->getName(),
+ -1, -1, LLEnvironment::altitudes_vect_t(),
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
}
}
void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday)
{
+ LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
+ LLEnvironment::instance().updateEnvironment();
if (!newday)
{
LL_WARNS("ENVPANEL") << "Editor committed an empty day. Do nothing." << LL_ENDL;
@@ -777,9 +828,11 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday)
if (newhash != oldhash)
{
- mCurrentEnvironment->mDayCycle = newday;
- setDirtyFlag(DIRTY_FLAG_DAYCYCLE);
- refresh();
+ LLHandle<LLPanel> that_h = getHandle();
+
+ LLEnvironment::instance().updateParcel(getParcelId(), newday,
+ -1, -1, LLEnvironment::altitudes_vect_t(),
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); });
}
}
@@ -873,6 +926,7 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(S32 parcel_id, LLEnvironment:
LL_WARNS("ENVPANEL") << " Environment version was not provided for " << parcel_id << ", old env version: " << mCurEnvVersion << LL_ENDL;
}
+ refreshFromEstate();
refresh();
// todo: we have envifo and parcel env version, should we just setEnvironment() and parcel's property to prevent dupplicate requests?
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index 05f25fa78f..3649abe939 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -36,6 +36,7 @@
#include "llparcel.h"
#include "llsettingspicker.h"
#include "llfloatereditextdaycycle.h"
+#include "llestateinfomodel.h"
class LLViewerRegion;
@@ -62,13 +63,9 @@ public:
protected:
LOG_CLASS(LLPanelEnvironmentInfo);
- static const std::string RDG_ENVIRONMENT_SELECT;
- static const std::string RDO_USEDEFAULT;
- static const std::string RDO_USEINV;
- static const std::string RDO_USECUSTOM;
- static const std::string EDT_INVNAME;
static const std::string BTN_SELECTINV;
static const std::string BTN_EDIT;
+ static const std::string BTN_USEDEFAULT;
static const std::string SLD_DAYLENGTH;
static const std::string SLD_DAYOFFSET;
static const std::string SLD_ALTITUDES;
@@ -91,6 +88,7 @@ protected:
static const std::string STR_NO_PARCEL;
static const std::string STR_CROSS_REGION;
static const std::string STR_LEGACY;
+ static const std::string STR_DISALLOWED;
static const U32 DIRTY_FLAG_DAYCYCLE;
static const U32 DIRTY_FLAG_DAYLENGTH;
@@ -106,32 +104,35 @@ protected:
bool getIsDirty() const { return (mDirtyFlag != 0); }
bool getIsDirtyFlag(U32 flag) const { return ((mDirtyFlag & flag) != 0); }
U32 getDirtyFlag() const { return mDirtyFlag; }
- void updateAltLabel(const std::string &alt_name, U32 sky_index, F32 alt_value);
+ void updateAltLabel(const std::string &alt_name, U32 sky_index, F32 alt_value);
void readjustAltLabels();
- void onSwitchDefaultSelection();
void onSldDayLengthChanged(F32 value);
void onSldDayOffsetChanged(F32 value);
void onAltSliderCallback(LLUICtrl *cntrl, const LLSD &data);
- void onBtnApply();
- void onBtnReset();
+ void onAltSliderMouseUp();
+
void onBtnEdit();
void onBtnSelect();
-
- virtual void doApply();
+ void onBtnDefault();
void udpateApparentTimeOfDay();
void onPickerCommitted(LLUUID item_id);
void onEditCommitted(LLSettingsDay::ptr_t newday);
+ void onDayLenOffsetMouseUp();
+
void onPickerAssetDownloaded(LLSettingsBase::ptr_t settings);
void onEnvironmentReceived(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo);
static void _onEnvironmentReceived(LLHandle<LLPanel> that_h, S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo);
+
virtual void refreshFromSource() = 0;
std::string getInventoryNameForAssetId(LLUUID asset_id);
+ std::string getNameForTrackIndex(S32 index);
+
LLFloaterSettingsPicker * getSettingsPicker(bool create = true);
LLFloaterEditExtDayCycle * getEditFloater(bool create = true);
void updateEditFloater(const LLEnvironment::EnvironmentInfo::ptr_t &nextenv, bool enable);
@@ -159,12 +160,15 @@ protected:
F32 mAltitude;
};
typedef std::map<std::string, AltitudeData> altitudes_data_t;
- altitudes_data_t mAltitudes;
- S32 mCurEnvVersion; // used to filter duplicate callbacks/refreshes
+ altitudes_data_t mAltitudes;
+ S32 mCurEnvVersion; // used to filter duplicate callbacks/refreshes
+protected:
+ void refreshFromEstate();
+ bool mAllowOverride;
private:
- static void onIdlePlay(void *);
+ static void onIdlePlay(void *);
typedef boost::signals2::connection connection_t;
@@ -178,6 +182,7 @@ private:
bool mCrossRegion;
bool mNoSelection;
bool mNoEnvironment;
+
};
class LLSettingsDropTarget : public LLView
diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp
index b82be3a23e..d115f6fa4f 100644
--- a/indra/newview/llsettingspicker.cpp
+++ b/indra/newview/llsettingspicker.cpp
@@ -105,6 +105,7 @@ BOOL LLFloaterSettingsPicker::postBuild()
mInventoryPanel->setSelectCallback([this](const LLFloaterSettingsPicker::itemlist_t &items, bool useraction){ onSelectionChange(items, useraction); });
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ mInventoryPanel->setSuppressOpenItemAction(true);
// Disable auto selecting first filtered item because it takes away
// selection from the item set by LLTextureCtrl owning this floater.
@@ -336,6 +337,24 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
return result;
}
+BOOL LLFloaterSettingsPicker::handleKeyHere(KEY key, MASK mask)
+{
+ if ((key == KEY_RETURN) && (mask == MASK_NONE))
+ {
+ LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID);
+ if (item_viewp && item_viewp->getIsCurSelection())
+ {
+ // Quick-apply
+ if (mCommitSignal)
+ (*mCommitSignal)(this, LLSD(mSettingItemID));
+ closeFloater();
+ return TRUE;
+ }
+ }
+
+ return LLFloater::handleKeyHere(key, mask);
+}
+
//=========================================================================
void LLFloaterSettingsPicker::setActive(bool active)
{
diff --git a/indra/newview/llsettingspicker.h b/indra/newview/llsettingspicker.h
index 434eb04c61..5acc562fe5 100644
--- a/indra/newview/llsettingspicker.h
+++ b/indra/newview/llsettingspicker.h
@@ -94,6 +94,7 @@ private:
void onButtonCancel();
void onButtonSelect();
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override;
+ BOOL handleKeyHere(KEY key, MASK mask) override;
LLHandle<LLView> mOwnerHandle;
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 0def17b32d..6b1a0a2b77 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -154,23 +154,24 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback)
{
+ LLViewerInventoryItem *pitem = gInventory.getItem(inventoryId);
+ if (pitem)
+ {
+ LLPermissions perm = pitem->getPermissions();
+ if (perm.getMaskEveryone() != PERM_COPY)
+ {
+ perm.setMaskEveryone(PERM_COPY);
+ pitem->setPermissions(perm);
+ pitem->updateServer(FALSE);
+ }
+ }
if (!settings)
{ // The item was created as new with no settings passed in. Simulator should have given it the default for the type... check ID,
// no need to upload asset.
LLUUID asset_id;
- LLViewerInventoryItem *pitem = gInventory.getItem(inventoryId);
-
if (pitem)
{
asset_id = pitem->getAssetUUID();
-
- LLPermissions perm = pitem->getPermissions();
- if (perm.getMaskEveryone() != PERM_COPY)
- {
- perm.setMaskEveryone(PERM_COPY);
- pitem->setPermissions(perm);
- pitem->updateServer(FALSE);
- }
}
if (callback)
callback(asset_id, inventoryId, LLUUID::null, LLSD());
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 cac6f334c7..a3dbab2509 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
@@ -241,7 +241,7 @@
<multi_slider
decimal_digits="0"
follows="bottom"
- height="10"
+ height="12"
increment="0.005"
overlap_threshold="0.026"
loop_overlap="true"
@@ -252,6 +252,7 @@
max_val="1"
name="WLDayCycleFrames"
show_text="false"
+ thumb_width="12"
top_pad="15"
width="525" />
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 5c08bf50f6..b4cfe9d1b5 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4811,10 +4811,12 @@ Unchecking this option may remove restrictions that parcel owners have added to
icon="alertmodal.tga"
name="EstateParcelEnvironmentOverride"
type="alertmodal">
-Unchecking this option may remove any custom environments that parcel owners have added to their parcels. Please discuss with your parcel owners as needed.
+Unchecking this option will remove any custom environments that parcel owners have added to their parcels. Please discuss with your parcel owners as needed.
+Do you wish to proceed?
<tag>confirm</tag>
<usetemplate
- name="okbutton"
+ name="okcancelbuttons"
+ notext="Cancel"
yestext="OK"/>
</notification>
diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml
index 2f91252d9b..7c08262d50 100644
--- a/indra/newview/skins/default/xui/en/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml
@@ -16,6 +16,8 @@
<string name="str_no_parcel">No parcel is selected. Environmental settings are disabled.</string>
<string name="str_cross_region">Environmental settings are not available across region boundries.</string>
<string name="str_legacy">Environmental settings are not available on this region.</string>
+ <string name="str_disallowed">The estate manager does not allow changing parcel environments in this region.</string>
+ <string name="str_empty">(empty)</string>
<layout_stack
width="530"
height="367"
@@ -29,14 +31,422 @@
name="pnl_environment_disabled"
visible="false">
<text follows="top|left|bottom|right"
- halign="center"
- valign="top"
- top_pad="40"
- name="txt_environment_disabled"
- text_color="white">
- ...
+ halign="center"
+ valign="top"
+ top_pad="40"
+ name="txt_environment_disabled"
+ text_color="white">
+ ...
</text>
</layout_panel>
+ <layout_panel
+ auto_resize="true"
+ user_resize="false"
+ min_height="0"
+ name="pnl_environment_config"
+ visible="true">
+ <layout_stack
+ xxxwidth="530"
+ xxxheight="367"
+ follows="all"
+ layout="topleft"
+ animate="false"
+ orientation="horizontal">
+ <layout_panel
+ auto_resize="true"
+ user_resize="false"
+ min_height="0"
+ top="5"
+ name="pnl_environment_altitudes"
+ visible="true">
+ <text follows="top|left"
+ font="SansSerif"
+ halign="left"
+ text_color="white"
+ left="5"
+ top="2">Sky Altitudes</text>
+ <multi_slider
+ height="270"
+ follows="top|left"
+ orientation="vertical"
+ increment="25"
+ min_val="100"
+ max_val="4000"
+ thumb_image="Inv_SettingsSky"
+ thumb_width="17"
+ thumb_highlight_color="white"
+ decimal_digits="0"
+ draw_track="true"
+ overlap_threshold="100"
+ initial_value="0"
+ layout="topleft"
+ left="10"
+ max_sliders="3"
+ name="sld_altitudes"
+ show_text="false"
+ top_pad="20"
+ use_triangle="false"
+ width="17">
+ <slider name="sld1"
+ value="1000"/>
+ <slider name="sld2"
+ value="2000"/>
+ <slider name="sld3"
+ value="3000"/>
+ </multi_slider>
+ <icon
+ follows="top|left"
+ height="17"
+ width="17"
+ image_name="Inv_SettingsSky"
+ layout="topleft"
+ name="icon_ground"
+ mouse_opaque="false"
+ visible="true"
+ left="10"
+ xxxleft_delta="0"
+ top_pad="10"/>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_pad="8"
+ top_delta="2"
+ width="50"
+ name="ground_name">
+ Ground
+ </text>
+ <line_editor
+ follows="top|right"
+ enabled="false"
+ top_delta="-3"
+ right="-5"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_ground"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_ground"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as the ground level sky."
+ width="155" />
+
+ <icon
+ follows="left|top"
+ height="17"
+ width="17"
+ image_name="Inv_SettingsWater"
+ layout="topleft"
+ name="icon_water"
+ mouse_opaque="false"
+ visible="true"
+ left="10"
+ top_pad="10"/>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_pad="8"
+ top_delta="2"
+ width="200"
+ name="water_name">
+ Water
+ </text>
+ <line_editor
+ follows="top|right"
+ enabled="false"
+ top_delta="-3"
+ right="-5"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_water"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_water"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
+ width="155" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left"
+ height="12"
+ layout="topleft"
+ left="35"
+ top="30"
+ width="200"
+ name="alt1">
+ Sky [INDEX]([ALTITUDE]m)
+ </text>
+ <line_editor
+ follows="top|right"
+ enabled="false"
+ top_delta="-3"
+ right="-5"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt1"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt2"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
+ width="155" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="35"
+ top="40"
+ width="200"
+ name="alt2">
+ Sky [INDEX]([ALTITUDE]m)
+ </text>
+ <line_editor
+ follows="top|right"
+ enabled="false"
+ top_delta="-3"
+ right="-5"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt2"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt2"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
+ width="155" />
+
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left="35"
+ top="50"
+ width="200"
+ name="alt3">
+ Sky [INDEX]([ALTITUDE]m)
+ </text>
+ <line_editor
+ follows="top|right"
+ enabled="false"
+ top_delta="-3"
+ right="-5"
+ xxxleft="-160"
+ height="20"
+ layout="topleft"
+ name="edt_invname_alt3"
+ width="155">
+ Unknown
+ </line_editor>
+ <settings_drop_target
+ height="20"
+ top_delta="0"
+ left_delta="0"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_alt3"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current water."
+ width="155" />
+
+ </layout_panel>
+ <layout_panel
+ auto_resize="true"
+ user_resize="false"
+ min_height="0"
+ top="5"
+ name="pnl_environment_config"
+ visible="true">
+ <layout_stack
+ follows="all"
+ layout="topleft"
+ animate="false"
+ orientation="vertical">
+ <layout_panel
+ min_height="140"
+ follows="all"
+ border="true"
+ bevel_style="in"
+ name="pnl_environment_current">
+ <text follows="top|left"
+ font="SansSerif"
+ halign="left"
+ text_color="white"
+ top="2">Select Environment</text>
+ <button
+ follows="top|left"
+ top_pad="20"
+ left_delta="10"
+ layout="topleft"
+ height="23"
+ label="[USEDEFAULT]"
+ width="120"
+ name="btn_usedefault"/>
+ <button
+ follows="top|left"
+ top_pad="5"
+ left_delta="0"
+ layout="topleft"
+ height="23"
+ label="Use Inventory"
+ width="120"
+ name="btn_select_inventory"/>
+ <button
+ follows="top|left"
+ top_pad="5"
+ left_delta="0"
+ layout="topleft"
+ height="23"
+ label="Customize"
+ width="120"
+ name="btn_edit"/>
+ <check_box
+ height="20"
+ label="Parcel Owners May Override Environment"
+ layout="topleft"
+ left_delta="0"
+ top_pad="10"
+ name="chk_allow_override"
+ width="200" />
+ </layout_panel>
+ <layout_panel
+ min_height="130"
+ follows="all"
+ border="true"
+ bevel_style="in"
+ name="pnl_environment_length">
+ <text
+ font="SansSerif"
+ follows="top|left|right"
+ halign="left"
+ text_color="white"
+ top="2">Day Settings</text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="10"
+ top_pad="16"
+ width="200">
+ Day Length (hours)
+ </text>
+ <slider
+ can_edit_text="true"
+ decimal_digits="1"
+ follows="left|top"
+ height="20"
+ increment="0.5"
+ initial_value="4"
+ layout="topleft"
+ left_delta="0"
+ xxxright="-10"
+ top_pad="0"
+ name="sld_day_length"
+ min_val="4"
+ max_val="168"
+ width="237" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ width="200">
+ Day Offset (hours)
+ </text>
+ <slider
+ can_edit_text="true"
+ decimal_digits="1"
+ follows="left|top"
+ height="20"
+ increment="0.5"
+ initial_value="-8"
+ layout="topleft"
+ left_delta="0"
+ top_pad="0"
+ name="sld_day_offset"
+ min_val="-11.5"
+ max_val="12"
+ width="237" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ width="200">
+ Apparent Time of Day:
+ </text>
+ <text
+ name="lbl_apparent_time"
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="10"
+ top_pad="5"
+ width="200">
+ [HH]:[MM][AP] ([PRC]%)
+ </text>
+ </layout_panel>
+ <layout_panel
+ follows="bottom"
+ border="true"
+ bevel_style="in"
+ name="pnl_environment_buttons">
+<!-- used to be buttons, but now spacer.
+-->
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
+ <!--
<layout_panel
auto_resize="false"
user_resize="false"
@@ -103,13 +513,13 @@
Unknown
</line_editor>
<settings_drop_target
- height="20"
- top_pad="-20"
- follows="top|left"
- layout="topleft"
- name="sdt_drop_target"
- tool_tip="Drag a setting from Inventory onto this target box to select it as current evironment."
- width="200" />
+ height="20"
+ top_pad="-20"
+ follows="top|left"
+ layout="topleft"
+ name="sdt_drop_target"
+ tool_tip="Drag a setting from Inventory onto this target box to select it as current evironment."
+ width="200" />
<button
name="btn_select_inventory"
follows="top|left"
@@ -231,54 +641,57 @@
name="pnl_environment_altitudes"
visible="true">
<panel
- left="5"
- top="0"
- bottom="-1"
- width="260"
- follows="left|top|bottom"
- background_visible="true"
- border="true"
- bevel_style="in"
- name="cnt_panel">
+ left="5"
+ top="0"
+ bottom="-1"
+ width="260"
+ follows="left|top|bottom"
+ background_visible="true"
+ border="true"
+ bevel_style="in"
+ name="cnt_panel">
<text follows="top|left"
- font="SansSerif"
- halign="left"
- text_color="white"
- top="2">Sky Altitudes</text>
+ font="SansSerif"
+ halign="left"
+ text_color="white"
+ top="2">Sky Altitudes</text>
<multi_slider
- decimal_digits="0"
- follows="bottom"
- height="123"
- width="17"
- orientation="vertical"
- increment="10"
- overlap_threshold="100"
- min_val="100"
- max_val="4000"
- layout="topleft"
- left="15"
- top="20"
- max_sliders="20"
- name="sld_altitudes"
- show_text="false"
- thumb_image="Inv_SettingsSky"
- thumb_width="17"
- thumb_highlight_color="white">
- <slider name="sld1" value="200"/>
- <slider name="sld2" value="400"/>
- <slider name="sld3" value="600"/>
+ decimal_digits="0"
+ follows="bottom"
+ height="123"
+ width="17"
+ orientation="vertical"
+ increment="10"
+ overlap_threshold="100"
+ min_val="100"
+ max_val="4000"
+ layout="topleft"
+ left="15"
+ top="20"
+ max_sliders="20"
+ name="sld_altitudes"
+ show_text="false"
+ thumb_image="Inv_SettingsSky"
+ thumb_width="17"
+ thumb_highlight_color="white">
+ <slider name="sld1"
+ value="200"/>
+ <slider name="sld2"
+ value="400"/>
+ <slider name="sld3"
+ value="600"/>
</multi_slider>
<icon
- follows="left|top"
- height="17"
- width="17"
- image_name="Inv_SettingsSky"
- layout="topleft"
- name="icon_ground"
- mouse_opaque="false"
- visible="true"
- left_delta="0"
- top_pad="-9"/>
+ follows="left|top"
+ height="17"
+ width="17"
+ image_name="Inv_SettingsSky"
+ layout="topleft"
+ name="icon_ground"
+ mouse_opaque="false"
+ visible="true"
+ left_delta="0"
+ top_pad="-9"/>
<text
type="string"
length="1"
@@ -368,5 +781,6 @@
width="100" />
</layout_panel>
+-->
</layout_stack>
</panel>