diff options
author | Rider Linden <rider@lindenlab.com> | 2019-01-07 10:24:55 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-01-07 10:24:55 -0800 |
commit | 1badfb0e96959725fbe2895994607a088f4a808b (patch) | |
tree | 03d8169b2e0762a5e1447c49bcb3165cd9d3130e | |
parent | 64e45b5b6ef8ded7bbea1b376e5bf2cbb0d6f5a4 (diff) |
SL-9883: Hide controls and display message if parcel < 128m
-rw-r--r-- | indra/newview/llfloaterland.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 61 | ||||
-rw-r--r-- | indra/newview/llpanelenvironment.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_region_environment.xml | 1 |
5 files changed, 22 insertions, 54 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 380302b51e..eeb1c17f4b 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -148,6 +148,11 @@ public: LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp); virtual bool isRegion() const override { return false; } + virtual bool isLargeEnough() override + { + LLParcel *parcelp = mParcel->getParcel(); + return ((parcelp) ? (parcelp->getArea() >= MINIMUM_PARCEL_SIZE) : false); + } virtual BOOL postBuild() override; virtual void refresh() override; @@ -3376,7 +3381,7 @@ bool LLPanelLandEnvironment::canEdit() LLParcel *parcel = getParcel(); if (!parcel) return false; - + return LLEnvironment::instance().canAgentUpdateParcelEnvironment(parcel) && mAllowOverride; } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 40e26ba3bd..1e40be5868 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -150,6 +150,7 @@ public: virtual bool isRegion() const override { return true; } virtual LLParcel * getParcel() override { return nullptr; } virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } + virtual bool isLargeEnough() override { return true; } // regions are always large enough. bool refreshFromRegion(LLViewerRegion* region); diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index a150e66085..a324dfb93b 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -89,6 +89,9 @@ 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 std::string LLPanelEnvironmentInfo::STR_TOO_SMALL("str_too_small"); + +const S32 LLPanelEnvironmentInfo::MINIMUM_PARCEL_SIZE(128); const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE(0x01 << 0); const U32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH(0x01 << 1); @@ -169,9 +172,6 @@ BOOL LLPanelEnvironmentInfo::postBuild() mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env, S32 version) { onEnvironmentChanged(env, version); }); - // if we ever allow LLEstateInfoModel to work for non-EMs, uncomment this line. - // mUpdateConnection = LLEstateInfoModel::instance().setUpdateCallback(boost::bind(&LLPanelEnvironmentInfo::refreshFromEstate, this)); - getChild<LLSettingsDropTarget>(SDT_DROP_TARGET)->setPanel(this); return TRUE; @@ -230,32 +230,6 @@ 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); - F32Hours daylength(mCurrentEnvironment->mDayLength); F32Hours dayoffset(mCurrentEnvironment->mDayOffset); @@ -264,8 +238,6 @@ 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); udpateApparentTimeOfDay(); @@ -297,12 +269,9 @@ void LLPanelEnvironmentInfo::refresh() void LLPanelEnvironmentInfo::refreshFromEstate() { - /*TODO: Unfortunately only estate manager may get information from the LLEstateInfoModel. - * The proletariat is not allowed to know what options are set for an estate. We should fix this.*/ LLViewerRegion *pRegion = gAgent.getRegion(); bool oldAO = mAllowOverride; - //mAllowOverride = (!isRegion()) || LLEstateInfoModel::instance().getAllowEnvironmentOverride(); mAllowOverride = (isRegion() && LLEstateInfoModel::instance().getAllowEnvironmentOverride()) || pRegion->getAllowEnvironmentOverride(); if (oldAO != mAllowOverride) refresh(); @@ -415,6 +384,7 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) { bool is_unavailable(false); bool is_legacy = (mCurrentEnvironment) ? mCurrentEnvironment->mIsLegacy : true; + bool is_bigenough = isLargeEnough(); if (mNoEnvironment || (!LLEnvironment::instance().isExtendedEnvironmentEnabled() && !isRegion())) { @@ -436,13 +406,18 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) is_unavailable = true; getChild<LLTextBox>(TXT_DISABLED)->setText(getString(STR_DISALLOWED)); } + else if (!is_bigenough) + { + is_unavailable = true; + getChild<LLTextBox>(TXT_DISABLED)->setText(getString(STR_TOO_SMALL)); + } if (is_unavailable) { getChild<LLUICtrl>(PNL_SETTINGS)->setVisible(false); getChild<LLUICtrl>(PNL_BUTTONS)->setVisible(false); getChild<LLUICtrl>(PNL_DISABLED)->setVisible(true); - getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(FALSE); + getChild<LLUICtrl>(PNL_ENVIRONMENT_ALTITUDES)->setVisible(false); updateEditFloater(mCurrentEnvironment, false); @@ -470,22 +445,6 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) return true; } -void LLPanelEnvironmentInfo::setApplyProgress(bool started) -{ -// LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("progress_indicator"); -// -// indicator->setVisible(started); -// -// if (started) -// { -// indicator->start(); -// } -// else -// { -// indicator->stop(); -// } -} - void LLPanelEnvironmentInfo::setDirtyFlag(U32 flag) { mDirtyFlag |= flag; diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index 6690386b92..dd3a309780 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -89,6 +89,9 @@ protected: static const std::string STR_CROSS_REGION; static const std::string STR_LEGACY; static const std::string STR_DISALLOWED; + static const std::string STR_TOO_SMALL; + + static const S32 MINIMUM_PARCEL_SIZE; static const U32 DIRTY_FLAG_DAYCYCLE; static const U32 DIRTY_FLAG_DAYLENGTH; @@ -98,7 +101,6 @@ protected: static const U32 DIRTY_FLAG_MASK; bool setControlsEnabled(bool enabled); - void setApplyProgress(bool started); void setDirtyFlag(U32 flag); void clearDirtyFlag(U32 flag); bool getIsDirty() const { return (mDirtyFlag != 0); } @@ -126,7 +128,7 @@ protected: 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 bool isLargeEnough() = 0; virtual void refreshFromSource() = 0; std::string getInventoryNameForAssetId(LLUUID asset_id); 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 7b4164268f..eac444c971 100644 --- a/indra/newview/skins/default/xui/en/panel_region_environment.xml +++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml @@ -17,6 +17,7 @@ <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_too_small">The parcel must be at least 128 square meeters to support an environment.</string> <string name="str_empty">(empty)</string> <layout_stack width="530" |