diff options
Diffstat (limited to 'indra/newview/llfloaterland.cpp')
-rw-r--r-- | indra/newview/llfloaterland.cpp | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 88b3fb7b96..5d6e8885de 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -78,6 +78,7 @@ #include "lltrans.h" #include "llpanelexperiencelisteditor.h" #include "llpanelexperiencepicker.h" +#include "llpanelenvironment.h" #include "llexperiencecache.h" #include "llgroupactions.h" @@ -138,6 +139,22 @@ protected: LLPanelExperienceListEditor* mBlocked; }; + +class LLPanelLandEnvironment + : public LLPanelEnvironmentInfo +{ +public: + LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp); + + virtual BOOL postBuild(); + void refresh(); + +protected: + + 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] @@ -277,6 +294,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) mFactoryMap["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); mFactoryMap["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); mFactoryMap["land_experiences_panel"] = LLCallbackMap(createPanelLandExperiences, this); + mFactoryMap["land_environment_panel"] = LLCallbackMap(createPanelLandEnvironment, this); sObserver = new LLParcelSelectionObserver(); LLViewerParcelMgr::getInstance()->addObserver( sObserver ); @@ -318,6 +336,7 @@ void LLFloaterLand::refresh() mPanelAccess->refresh(); mPanelCovenant->refresh(); mPanelExperiences->refresh(); + mPanelEnvironment->refresh(); } @@ -386,6 +405,14 @@ void* LLFloaterLand::createPanelLandExperiences(void* data) return self->mPanelExperiences; } +//static +void* LLFloaterLand::createPanelLandEnvironment(void* data) +{ + LLFloaterLand* self = (LLFloaterLand*)data; + self->mPanelEnvironment = new LLPanelLandEnvironment(self->mParcel); + return self->mPanelEnvironment; +} + //--------------------------------------------------------------------------- // LLPanelLandGeneral @@ -3211,3 +3238,64 @@ void LLPanelLandExperiences::refresh() refreshPanel(mAllowed, EXPERIENCE_KEY_TYPE_ALLOWED); refreshPanel(mBlocked, EXPERIENCE_KEY_TYPE_BLOCKED); } + +//========================================================================= + +LLPanelLandEnvironment::LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp): + LLPanelEnvironmentInfo(), + mParcel(parcelp) +{ +} + +BOOL LLPanelLandEnvironment::postBuild() +{ + if (!LLPanelEnvironmentInfo::postBuild()) + return FALSE; + + mAllowOverRide->setVisible(FALSE); + return TRUE; +} + +void LLPanelLandEnvironment::refresh() +{ + LLParcel* parcel = mParcel->getParcel(); + if (!parcel) + { + mRegionSettingsRadioGroup->setEnabled(FALSE); + mDayLengthSlider->setEnabled(FALSE); + mDayOffsetSlider->setEnabled(FALSE); + mAllowOverRide->setEnabled(FALSE); + + return; + } + + //BOOL owner_or_god = gAgent.isGodlike() || (parcel owner or group) + BOOL owner_or_god = true; + //BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); + + F64Hours daylength; + F64Hours dayoffset; + + daylength = parcel->getDayLength(); + dayoffset = parcel->getDayOffset(); + + if (dayoffset.value() > 12.0) + dayoffset = dayoffset - F32Hours(24.0f); + + mDayLengthSlider->setValue(daylength.value()); + mDayOffsetSlider->setValue(dayoffset.value()); + + mRegionSettingsRadioGroup->setSelectedIndex(parcel->getUsesDefaultDayCycle() ? 0 : 1); + + setControlsEnabled(owner_or_god); + + if (!parcel->getUsesDefaultDayCycle()) + mEditingDayCycle = parcel->getParcelDayCycle()->buildClone(); + else + { + LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + if (regionp) + mEditingDayCycle = regionp->getRegionDayCycle()->buildClone(); + } + +} |