summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-08-06 15:37:09 -0700
committerRider Linden <rider@lindenlab.com>2018-08-06 15:37:09 -0700
commitcd5f7b2c03e87cc5d236eaa5b8c025530571376a (patch)
treecb44c4ccbd71fc71265cbbc86eeb94207507f799 /indra
parent21c6e6063f52398802fd63a81914eb42b76f3ff3 (diff)
MAINT-7703: Estate and region flags for parcel environmests (not written to DB yet)
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/llregionflags.h3
-rw-r--r--indra/newview/llestateinfomodel.cpp4
-rw-r--r--indra/newview/llestateinfomodel.h2
-rw-r--r--indra/newview/llfloaterregioninfo.cpp48
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_environment.xml1
5 files changed, 51 insertions, 7 deletions
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index d3791ef4d1..a0c87b65cc 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -54,6 +54,9 @@ const U64 REGION_FLAGS_BLOCK_LAND_RESELL = (1 << 7);
// All content wiped once per night
const U64 REGION_FLAGS_SANDBOX = (1 << 8);
+
+const U64 REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE = (1 << 9);
+
const U64 REGION_FLAGS_SKIP_COLLISIONS = (1 << 12); // Pin all non agent rigid bodies
const U64 REGION_FLAGS_SKIP_SCRIPTS = (1 << 13);
const U64 REGION_FLAGS_SKIP_PHYSICS = (1 << 14); // Skip all physics
diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp
index e56a67f8d1..4ac9c974c1 100644
--- a/indra/newview/llestateinfomodel.cpp
+++ b/indra/newview/llestateinfomodel.cpp
@@ -73,6 +73,7 @@ bool LLEstateInfoModel::getDenyAnonymous() const { return getFlag(REGION_FLAGS
bool LLEstateInfoModel::getDenyAgeUnverified() const { return getFlag(REGION_FLAGS_DENY_AGEUNVERIFIED); }
bool LLEstateInfoModel::getAllowVoiceChat() const { return getFlag(REGION_FLAGS_ALLOW_VOICE); }
bool LLEstateInfoModel::getAllowAccessOverride() const { return getFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE); }
+bool LLEstateInfoModel::getAllowEnvironmentOverride() const { return getFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE); }
void LLEstateInfoModel::setUseFixedSun(bool val) { setFlag(REGION_FLAGS_SUN_FIXED, val); }
void LLEstateInfoModel::setIsExternallyVisible(bool val) { setFlag(REGION_FLAGS_EXTERNALLY_VISIBLE, val); }
@@ -81,6 +82,7 @@ void LLEstateInfoModel::setDenyAnonymous(bool val) { setFlag(REGION_FLAGS_DENY
void LLEstateInfoModel::setDenyAgeUnverified(bool val) { setFlag(REGION_FLAGS_DENY_AGEUNVERIFIED, val); }
void LLEstateInfoModel::setAllowVoiceChat(bool val) { setFlag(REGION_FLAGS_ALLOW_VOICE, val); }
void LLEstateInfoModel::setAllowAccessOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ACCESS_OVERRIDE, val); }
+void LLEstateInfoModel::setAllowEnvironmentOverride(bool val) { setFlag(REGION_FLAGS_ALLOW_ENVIRONMENT_OVERRIDE, val); }
void LLEstateInfoModel::update(const strings_t& strings)
{
@@ -148,6 +150,7 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url)
body["deny_age_unverified"] = getDenyAgeUnverified();
body["allow_voice_chat"] = getAllowVoiceChat();
body["override_public_access"] = getAllowAccessOverride();
+ body["override_environment"] = getAllowEnvironmentOverride();
body["invoice"] = LLFloaterRegionInfo::getLastInvoice();
@@ -222,6 +225,7 @@ std::string LLEstateInfoModel::getInfoDump()
dump["deny_age_unverified" ] = getDenyAgeUnverified();
dump["allow_voice_chat" ] = getAllowVoiceChat();
dump["override_public_access"] = getAllowAccessOverride();
+ dump["override_environment"] = getAllowEnvironmentOverride();
std::stringstream dump_str;
dump_str << dump;
diff --git a/indra/newview/llestateinfomodel.h b/indra/newview/llestateinfomodel.h
index 0082b5b1f4..d6f00c573c 100644
--- a/indra/newview/llestateinfomodel.h
+++ b/indra/newview/llestateinfomodel.h
@@ -56,6 +56,7 @@ public:
bool getDenyAgeUnverified() const;
bool getAllowVoiceChat() const;
bool getAllowAccessOverride() const;
+ bool getAllowEnvironmentOverride() const;
const std::string& getName() const { return mName; }
const LLUUID& getOwnerID() const { return mOwnerID; }
@@ -70,6 +71,7 @@ public:
void setDenyAgeUnverified(bool val);
void setAllowVoiceChat(bool val);
void setAllowAccessOverride(bool val);
+ void setAllowEnvironmentOverride(bool val);
void setSunHour(F32 sun_hour) { mSunHour = sun_hour; }
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 6719e6ed3b..5112ff11bf 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -184,6 +184,7 @@ public:
void refresh();
bool refreshFromRegion(LLViewerRegion* region);
+ void refreshFromEstate();
virtual BOOL postBuild();
@@ -191,6 +192,7 @@ protected:
virtual void doApply();
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
+ BOOL sendUpdate();
private:
LLViewerRegion * mLastRegion;
@@ -2388,8 +2390,6 @@ bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, con
estate_info.setDenyAgeUnverified(getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean());
estate_info.setAllowVoiceChat(getChild<LLUICtrl>("voice_chat_check")->getValue().asBoolean());
estate_info.setAllowAccessOverride(getChild<LLUICtrl>("parcel_access_override")->getValue().asBoolean());
- // JIGGLYPUFF
- //estate_info.setAllowAccessOverride(getChild<LLUICtrl>("")->getValue().asBoolean());
// send the update to sim
estate_info.sendEstateInfo();
}
@@ -3370,6 +3370,9 @@ LLPanelRegionEnvironment::LLPanelRegionEnvironment():
LLPanelEnvironmentInfo(),
mLastRegion(NULL)
{
+ LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
+ estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this));
+ estate_info.setUpdateCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this));
}
@@ -3385,6 +3388,7 @@ BOOL LLPanelRegionEnvironment::postBuild()
void LLPanelRegionEnvironment::refresh()
{
refreshFromRegion(mLastRegion);
+ refreshFromEstate();
}
bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
@@ -3403,9 +3407,6 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
mDayLengthSlider->setValue(daylength.value());
mDayOffsetSlider->setValue(dayoffset.value());
-
- //mRegionSettingsRadioGroup->setSelectedIndex(region->getIsDefaultDayCycle() ? 0 : 1);
- mRegionSettingsRadioGroup->setSelectedIndex(1);
setControlsEnabled(owner_or_god_or_manager);
mLastRegion = region;
@@ -3413,11 +3414,26 @@ bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION);
if (pday)
- mEditingDayCycle = pday->buildClone();
+ {
+ mRegionSettingsRadioGroup->setSelectedIndex((pday->getAssetId() == LLSettingsDay::GetDefaultAssetId()) ? 0 : 1);
+ mEditingDayCycle = std::static_pointer_cast<LLSettingsDay>(pday->buildDerivedClone());
+ }
+ else
+ {
+ mRegionSettingsRadioGroup->setSelectedIndex(1);
+ }
return true;
}
+void LLPanelRegionEnvironment::refreshFromEstate()
+{
+ const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
+
+ getChild<LLUICtrl>("allow_override_chk")->setValue(estate_info.getAllowEnvironmentOverride());
+
+}
+
void LLPanelRegionEnvironment::doApply()
{
if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
@@ -3447,3 +3463,23 @@ void LLPanelRegionEnvironment::doEditCommited(LLSettingsDay::ptr_t &newday)
{
mEditingDayCycle = newday;
}
+
+BOOL LLPanelRegionEnvironment::sendUpdate()
+{
+// LL_INFOS() << "LLPanelEsateInfo::sendUpdate()" << LL_ENDL;
+//
+// LLNotification::Params params("ChangeLindenEstate");
+// params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
+//
+// if (isLindenEstate())
+// {
+// // trying to change reserved estate, warn
+// LLNotifications::instance().add(params);
+// }
+// else
+// {
+// // for normal estates, just make the change
+// LLNotifications::instance().forceResponse(params, 0);
+// }
+ return TRUE;
+}
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 e469143e41..41f58eef01 100644
--- a/indra/newview/skins/default/xui/en/panel_region_environment.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml
@@ -150,7 +150,6 @@
min_height="0"
background_visible="false">
<check_box
- control_name="may_override_chk"
height="16"
label="Parcel Owners May Override"
layout="topleft"