diff options
author | Rider Linden <rider@lindenlab.com> | 2018-01-24 13:36:59 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-01-24 13:36:59 -0800 |
commit | 2d41de9007ce485e2c7e96c487d609cfe1690c29 (patch) | |
tree | 58cef8662ba8a1419c8f4d0217674df643b90f2a /indra/newview/llfloaterland.cpp | |
parent | 536aeb54a6130f3d1e20405c8f6cbd29201de26d (diff) |
MAINT-8052: Parcel environments. Set, clear and get.
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r-- | indra/newview/llfloaterland.cpp | 45 |
1 files changed, 42 insertions, 3 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()); + } +} |