summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp4
-rw-r--r--indra/newview/llfloaterland.cpp18
-rw-r--r--indra/newview/llfloaterregioninfo.cpp4
-rw-r--r--indra/newview/llpanelenvironment.cpp19
-rw-r--r--indra/newview/llpanelenvironment.h4
5 files changed, 40 insertions, 9 deletions
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 45662cb37b..9831a5fa84 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -586,7 +586,7 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk()
void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector<std::string>& filenames)
{
- if (filenames.size() < 1) return;
+ if (filenames.size() < 1) return;
std::string filename = filenames[0];
LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL;
LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename);
@@ -673,7 +673,7 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk()
void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector<std::string>& filenames)
{
- if (filenames.size() < 1) return;
+ if (filenames.size() < 1) return;
std::string filename = filenames[0];
LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL;
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 38ced18edf..453c9f1138 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -3304,6 +3304,14 @@ void LLPanelLandEnvironment::refreshFromSource()
{
LLParcel *parcel = getParcel();
+ if (!LLEnvironment::instance().isExtendedEnvironmentEnabled())
+ {
+ setNoEnvironmentSupport(true);
+ setControlsEnabled(false);
+ return;
+ }
+ setNoEnvironmentSupport(false);
+
if (!parcel)
{
setNoSelection(true);
@@ -3316,8 +3324,16 @@ void LLPanelLandEnvironment::refreshFromSource()
{
setCrossRegion(false);
+ LLHandle<LLPanel> that_h = getHandle();
+
LLEnvironment::instance().requestParcel(parcel->getLocalID(),
- [this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { mLastParcelId = parcel_id; onEnvironmentReceived(parcel_id, envifo); });
+ [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo)
+ {
+ LLPanelLandEnvironment *that = (LLPanelLandEnvironment*)that_h.get();
+ if (!that) return;
+ that->mLastParcelId = parcel_id;
+ that->onEnvironmentReceived(parcel_id, envifo);
+ });
}
else
{
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 6aa35b40b6..96ca7c1ac4 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -3447,8 +3447,10 @@ void LLPanelRegionEnvironment::refreshFromEstate()
void LLPanelRegionEnvironment::refreshFromSource()
{
+ LLHandle<LLPanel> that_h = getHandle();
+
LLEnvironment::instance().requestRegion(
- [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); });
}
void LLPanelRegionEnvironment::doApply()
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);
+}
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index fdf0fe46a7..a632acfd03 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -121,6 +121,7 @@ protected:
void onEditCommitted(LLSettingsDay::ptr_t newday);
void onPickerAssetDownloaded(LLSettingsBase::ptr_t settings);
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 void refreshFromSource() = 0;
@@ -132,6 +133,7 @@ protected:
void setCrossRegion(bool val) { mCrossRegion = val; }
void setNoSelection(bool val) { mNoSelection = val; }
+ void setNoEnvironmentSupport(bool val) { mNoEnvironment = val; }
LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment;
@@ -165,6 +167,6 @@ private:
S32 mDirtyFlag;
bool mCrossRegion;
bool mNoSelection;
-
+ bool mNoEnvironment;
};
#endif // LL_LLPANELEXPERIENCES_H