summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditsky.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-07-16 17:07:41 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-07-16 17:07:41 +0300
commitbba3cc598785539c477e817ada18d9e7a4692286 (patch)
tree314a4e5cb9cdd5fd574c8fded59852cab539b148 /indra/newview/llpaneleditsky.cpp
parente96356ce60a77401c531cb36f0e51eaa5fa72cd0 (diff)
SL-11599 Crash on closing floater with uncommited changes
Diffstat (limited to 'indra/newview/llpaneleditsky.cpp')
-rw-r--r--indra/newview/llpaneleditsky.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index aaa54ed2e9..8bcc546133 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -208,6 +208,7 @@ void LLPanelSettingsSkyAtmosTab::refresh()
//-------------------------------------------------------------------------
void LLPanelSettingsSkyAtmosTab::onAmbientLightChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setAmbientColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->get() * SLIDER_SCALE_SUN_AMBIENT));
mSkySettings->update();
setIsDirty();
@@ -215,6 +216,7 @@ void LLPanelSettingsSkyAtmosTab::onAmbientLightChanged()
void LLPanelSettingsSkyAtmosTab::onBlueHorizonChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setBlueHorizon(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY));
mSkySettings->update();
setIsDirty();
@@ -222,6 +224,7 @@ void LLPanelSettingsSkyAtmosTab::onBlueHorizonChanged()
void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setBlueDensity(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY));
mSkySettings->update();
setIsDirty();
@@ -229,6 +232,7 @@ void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged()
void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -236,6 +240,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged()
void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -243,6 +248,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged()
void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -250,6 +256,7 @@ void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged()
void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged()
{
+ if (!mSkySettings) return;
F32 density_mult = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->getValue().asReal();
density_mult *= SLIDER_SCALE_DENSITY_MULTIPLIER;
mSkySettings->setDensityMultiplier(density_mult);
@@ -259,6 +266,7 @@ void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged()
void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setDistanceMultiplier(getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -266,6 +274,7 @@ void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged()
void LLPanelSettingsSkyAtmosTab::onMaxAltChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setMaxY(getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -273,6 +282,7 @@ void LLPanelSettingsSkyAtmosTab::onMaxAltChanged()
void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged()
{
+ if (!mSkySettings) return;
F32 moisture_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->getValue().asReal();
mSkySettings->setSkyMoistureLevel(moisture_level);
mSkySettings->update();
@@ -280,7 +290,8 @@ void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged()
}
void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged()
-{
+{
+ if (!mSkySettings) return;
F32 droplet_radius = getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->getValue().asReal();
mSkySettings->setSkyDropletRadius(droplet_radius);
mSkySettings->update();
@@ -289,6 +300,7 @@ void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged()
void LLPanelSettingsSkyAtmosTab::onIceLevelChanged()
{
+ if (!mSkySettings) return;
F32 ice_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->getValue().asReal();
mSkySettings->setSkyIceLevel(ice_level);
mSkySettings->update();
@@ -381,6 +393,7 @@ void LLPanelSettingsSkyCloudTab::refresh()
//-------------------------------------------------------------------------
void LLPanelSettingsSkyCloudTab::onCloudColorChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setCloudColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->get()));
mSkySettings->update();
setIsDirty();
@@ -388,6 +401,7 @@ void LLPanelSettingsSkyCloudTab::onCloudColorChanged()
void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -395,18 +409,21 @@ void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged()
void LLPanelSettingsSkyCloudTab::onCloudScaleChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal());
setIsDirty();
}
void LLPanelSettingsSkyCloudTab::onCloudVarianceChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setCloudVariance(getChild<LLUICtrl>(FIELD_SKY_CLOUD_VARIANCE)->getValue().asReal());
setIsDirty();
}
void LLPanelSettingsSkyCloudTab::onCloudScrollChanged()
{
+ if (!mSkySettings) return;
LLVector2 scroll(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_XY)->getValue());
mSkySettings->setCloudScrollRate(scroll);
setIsDirty();
@@ -414,6 +431,7 @@ void LLPanelSettingsSkyCloudTab::onCloudScrollChanged()
void LLPanelSettingsSkyCloudTab::onCloudMapChanged()
{
+ if (!mSkySettings) return;
LLTextureCtrl* ctrl = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP);
mSkySettings->setCloudNoiseTextureId(ctrl->getValue().asUUID());
setIsDirty();
@@ -421,6 +439,7 @@ void LLPanelSettingsSkyCloudTab::onCloudMapChanged()
void LLPanelSettingsSkyCloudTab::onCloudDensityChanged()
{
+ if (!mSkySettings) return;
LLColor3 density(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->getValue().asReal(),
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->getValue().asReal(),
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->getValue().asReal());
@@ -431,6 +450,7 @@ void LLPanelSettingsSkyCloudTab::onCloudDensityChanged()
void LLPanelSettingsSkyCloudTab::onCloudDetailChanged()
{
+ if (!mSkySettings) return;
LLColor3 detail(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->getValue().asReal(),
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->getValue().asReal(),
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->getValue().asReal());
@@ -525,6 +545,7 @@ void LLPanelSettingsSkySunMoonTab::refresh()
//-------------------------------------------------------------------------
void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged()
{
+ if (!mSkySettings) return;
LLColor3 color(getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_MOON_COLOR)->get());
color *= SLIDER_SCALE_SUN_AMBIENT;
@@ -536,6 +557,7 @@ void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged()
void LLPanelSettingsSkySunMoonTab::onGlowChanged()
{
+ if (!mSkySettings) return;
LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal());
// takes 0 - 1.99 UI range -> 40 -> 0.2 range
@@ -549,6 +571,7 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged()
void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal());
mSkySettings->update();
setIsDirty();
@@ -556,6 +579,7 @@ void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged()
void LLPanelSettingsSkySunMoonTab::onSunRotationChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setSunRotation(getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->getRotation());
mSkySettings->update();
setIsDirty();
@@ -563,6 +587,7 @@ void LLPanelSettingsSkySunMoonTab::onSunRotationChanged()
void LLPanelSettingsSkySunMoonTab::onSunScaleChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setSunScale((getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal()));
mSkySettings->update();
setIsDirty();
@@ -570,6 +595,7 @@ void LLPanelSettingsSkySunMoonTab::onSunScaleChanged()
void LLPanelSettingsSkySunMoonTab::onSunImageChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setSunTextureId(getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->getValue().asUUID());
mSkySettings->update();
setIsDirty();
@@ -577,6 +603,7 @@ void LLPanelSettingsSkySunMoonTab::onSunImageChanged()
void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setMoonRotation(getChild<LLVirtualTrackball>(FIELD_SKY_MOON_ROTATION)->getRotation());
mSkySettings->update();
setIsDirty();
@@ -584,6 +611,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged()
void LLPanelSettingsSkySunMoonTab::onMoonImageChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setMoonTextureId(getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->getValue().asUUID());
mSkySettings->update();
setIsDirty();
@@ -591,6 +619,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonImageChanged()
void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setMoonScale((getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->getValue().asReal()));
mSkySettings->update();
setIsDirty();
@@ -598,6 +627,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged()
void LLPanelSettingsSkySunMoonTab::onMoonBrightnessChanged()
{
+ if (!mSkySettings) return;
mSkySettings->setMoonBrightness((getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->getValue().asReal()));
mSkySettings->update();
setIsDirty();