summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-01-24 13:36:59 -0800
committerRider Linden <rider@lindenlab.com>2018-01-24 13:36:59 -0800
commit2d41de9007ce485e2c7e96c487d609cfe1690c29 (patch)
tree58cef8662ba8a1419c8f4d0217674df643b90f2a /indra
parent536aeb54a6130f3d1e20405c8f6cbd29201de26d (diff)
MAINT-8052: Parcel environments. Set, clear and get.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterland.cpp45
-rw-r--r--indra/newview/llpanelenvironment.cpp6
-rw-r--r--indra/newview/llpanelenvironment.h6
-rw-r--r--indra/newview/llsettingsvo.cpp2
-rw-r--r--indra/newview/llwlhandlers.cpp4
5 files changed, 50 insertions, 13 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 5d6e8885de..18bf4a47b3 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -82,6 +82,7 @@
#include "llexperiencecache.h"
#include "llgroupactions.h"
+#include "llenvironment.h"
const F64 COVENANT_REFRESH_TIME_SEC = 60.0f;
@@ -144,17 +145,21 @@ class LLPanelLandEnvironment
: public LLPanelEnvironmentInfo
{
public:
- LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
+ LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
- virtual BOOL postBuild();
- void refresh();
+ virtual BOOL postBuild();
+ virtual void refresh();
protected:
+ virtual void doApply();
+
+
LLSafeHandle<LLParcelSelection>& mParcel;
};
+
// inserts maturity info(icon and text) into target textbox
// names_floater - pointer to floater which contains strings with maturity icons filenames
// str_to_parse is string in format "txt1[MATURITY]txt2" where maturity icon and text will be inserted instead of [MATURITY]
@@ -3258,6 +3263,8 @@ BOOL LLPanelLandEnvironment::postBuild()
void LLPanelLandEnvironment::refresh()
{
+ /*TODO: if legacy don't do any of this.*/
+
LLParcel* parcel = mParcel->getParcel();
if (!parcel)
{
@@ -3299,3 +3306,35 @@ void LLPanelLandEnvironment::refresh()
}
}
+
+void LLPanelLandEnvironment::doApply()
+{
+ LLParcel* parcel = mParcel->getParcel();
+ if (!parcel)
+ {
+ LL_WARNS("PARCEL") << "Could not get parcel." << LL_ENDL;
+ }
+ S32 parcel_id = parcel->getLocalID();
+
+ if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
+ {
+ LLEnvironment::instance().resetParcel(parcel_id);
+ }
+ else
+ {
+ S64Seconds daylength;
+ F32Hours dayoffset_h;
+
+ daylength = F32Hours(mDayLengthSlider->getValueF32());
+ dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
+
+ if (dayoffset_h.value() < 0)
+ {
+ dayoffset_h = F32Hours(24.0f) + dayoffset_h;
+ }
+
+ S64Seconds dayoffset_s = dayoffset_h;
+
+ LLEnvironment::instance().updateParcel(parcel_id, mEditingDayCycle, daylength.value(), dayoffset_s.value());
+ }
+}
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index c9e29e3e79..ab1c7502bb 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -41,7 +41,7 @@
#include "llfloaterreg.h"
#include "llfloatereditextdaycycle.h"
-static LLPanelInjector<LLPanelEnvironmentInfo> register_environment_panel("environment_panel");
+//static LLPanelInjector<LLPanelEnvironmentInfo> register_environment_panel("environment_panel");
LLPanelEnvironmentInfo::LLPanelEnvironmentInfo():
mEnableEditing(false),
@@ -348,10 +348,6 @@ void LLPanelEnvironmentInfo::onBtnApply()
doApply();
}
-void LLPanelEnvironmentInfo::doApply()
-{
-}
-
void LLPanelEnvironmentInfo::onBtnCancel()
{
// Reload last saved region settings.
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index 4f62488f21..7cc7ddae6f 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -37,8 +37,6 @@ class LLViewerRegion;
class LLPanelEnvironmentInfo : public LLPanel
{
- LOG_CLASS(LLPanelEnvironmentInfo);
-
public:
LLPanelEnvironmentInfo();
@@ -53,6 +51,8 @@ public:
virtual void refresh();
protected:
+ LOG_CLASS(LLPanelEnvironmentInfo);
+
void setControlsEnabled(bool enabled);
void setApplyProgress(bool started);
void setDirty(bool dirty);
@@ -65,7 +65,7 @@ protected:
void onEditiCommited(LLSettingsDay::ptr_t newday);
- virtual void doApply(); // = 0;
+ virtual void doApply() = 0;
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
/// New environment settings that are being applied to the region.
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 80cb8c8357..8ba6b2354a 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -520,7 +520,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID &regio
if (!results["success"].asBoolean())
{
LL_WARNS("SETTINGS") << "Day setting validation failed!:" << results << LL_ENDL;
- LLSettingsDay::ptr_t();
+ return LLSettingsDay::ptr_t();
}
LLSettingsDay::ptr_t dayp = boost::make_shared<LLSettingsVODay>(newsettings);
diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp
index cd3310d5cb..acec028489 100644
--- a/indra/newview/llwlhandlers.cpp
+++ b/indra/newview/llwlhandlers.cpp
@@ -104,6 +104,8 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
+ LL_WARNS("WindlightCaps") << "Using legacy Windlight caps." << LL_ENDL;
+
if (requestId != LLEnvironmentRequest::sLastRequest)
{
LL_INFOS("WindlightCaps") << "Got superseded by another responder; ignoring..." << LL_ENDL;
@@ -120,7 +122,7 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
return;
}
result = result["content"];
- LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL;
+ LL_INFOS("WindlightCaps") << "Received region legacy windlight settings" << LL_ENDL;
LLUUID regionId;
if (gAgent.getRegion())