diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-17 14:21:38 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-17 14:21:38 -0700 |
commit | 17fb7d0bf4cc4db1c3f30dbbbdee7610d168336c (patch) | |
tree | b3b48dcbe06af0df45696245bdc4639cdc346a27 /indra/newview/llpanelenvironment.cpp | |
parent | 53a93d3e73892f633b1d79de359924d733489bdb (diff) |
SL-9667, SL-9669: Do not attempt to request environment for non-eep parcels, use handle to panel passed to static for callbacks.
Diffstat (limited to 'indra/newview/llpanelenvironment.cpp')
-rw-r--r-- | indra/newview/llpanelenvironment.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 8d7ec48d63..ecffa34ab9 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -119,6 +119,7 @@ LLPanelEnvironmentInfo::LLPanelEnvironmentInfo(): mDirtyFlag(0), mCrossRegion(false), mNoSelection(false), + mNoEnvironment(false), mSettingsFloater(), mEditFloater() { @@ -330,7 +331,7 @@ bool LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) bool is_unavailable(false); bool is_legacy = (mCurrentEnvironment) ? mCurrentEnvironment->mIsLegacy : true; - if (!LLEnvironment::instance().isExtendedEnvironmentEnabled() && !isRegion()) + if (mNoEnvironment || (!LLEnvironment::instance().isExtendedEnvironmentEnabled() && !isRegion())) { is_unavailable = true; getChild<LLTextBox>(TXT_DISABLED)->setText(getString(STR_LEGACY)); @@ -574,24 +575,26 @@ void LLPanelEnvironmentInfo::doApply() if (getIsDirtyFlag(DIRTY_FLAG_MASK)) { + LLHandle<LLPanel> that_h = getHandle(); + S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex(); if (rdo_selection == 0) { LLEnvironment::instance().resetParcel(parcel_id, - [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {onEnvironmentReceived(parcel_id, envifo); }); + [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } else if (rdo_selection == 1) { LLEnvironment::instance().updateParcel(parcel_id, mCurrentEnvironment->mDayCycle->getAssetId(), mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), - [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {onEnvironmentReceived(parcel_id, envifo); }); + [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } else { LLEnvironment::instance().updateParcel(parcel_id, mCurrentEnvironment->mDayCycle, mCurrentEnvironment->mDayLength.value(), mCurrentEnvironment->mDayOffset.value(), - [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {onEnvironmentReceived(parcel_id, envifo); }); + [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } // Todo: save altitudes once LLEnvironment::setRegionAltitudes() gets implemented @@ -695,3 +698,11 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(S32 parcel_id, LLEnvironment: clearDirtyFlag(DIRTY_FLAG_MASK); refresh(); } + +void LLPanelEnvironmentInfo::_onEnvironmentReceived(LLHandle<LLPanel> that_h, S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) +{ + LLPanelEnvironmentInfo *that = (LLPanelEnvironmentInfo *)that_h.get(); + if (!that) + return; + that->onEnvironmentReceived(parcel_id, envifo); +} |