summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/CMakeLists.txt6
-rw-r--r--indra/newview/llenvadapters.cpp77
-rw-r--r--indra/newview/llenvadapters.h470
-rw-r--r--indra/newview/llfloatereditsky.cpp740
-rw-r--r--indra/newview/llfloatereditsky.h125
-rw-r--r--indra/newview/llfloatereditwater.cpp526
-rw-r--r--indra/newview/llfloatereditwater.h116
-rw-r--r--indra/newview/llviewerfloaterreg.cpp4
-rw-r--r--indra/newview/llviewermenu.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml980
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_water_preset.xml448
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml5
12 files changed, 5 insertions, 3493 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 1a08bb6d74..4de304ff66 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -181,7 +181,6 @@ set(viewer_SOURCE_FILES
lldrawpoolwlsky.cpp
lldynamictexture.cpp
llemote.cpp
- llenvadapters.cpp
llenvironment.cpp
llestateinfomodel.cpp
lleventnotifier.cpp
@@ -226,8 +225,6 @@ set(viewer_SOURCE_FILES
llfloaterdestinations.cpp
llfloatereditdaycycle.cpp
llfloatereditextdaycycle.cpp
- llfloatereditsky.cpp
- llfloatereditwater.cpp
llfloaterenvironmentsettings.cpp
llfloaterevent.cpp
llfloaterexperiencepicker.cpp
@@ -801,7 +798,6 @@ set(viewer_HEADER_FILES
lldrawpoolwlsky.h
lldynamictexture.h
llemote.h
- llenvadapters.h
llenvironment.h
llestateinfomodel.h
lleventnotifier.h
@@ -845,8 +841,6 @@ set(viewer_HEADER_FILES
llfloaterdeleteprefpreset.h
llfloaterdestinations.h
llfloatereditextdaycycle.h
- llfloatereditsky.h
- llfloatereditwater.h
llfloaterenvironmentsettings.h
llfloaterevent.h
llfloaterexperiencepicker.h
diff --git a/indra/newview/llenvadapters.cpp b/indra/newview/llenvadapters.cpp
deleted file mode 100644
index 57c7a75d52..0000000000
--- a/indra/newview/llenvadapters.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file llenvadapters.cpp
- * @brief Declaration of classes managing WindLight and water settings.
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-#include "llenvadapters.h"
-
-#include "llsettingssky.h"
-#include "llsettingswater.h"
-//=========================================================================
-
-LLSkySettingsAdapter::LLSkySettingsAdapter():
- mWLGamma(1.0f, LLSettingsSky::SETTING_GAMMA),
-
-// LEGACY_ATMOSPHERICS
- mAmbient(LLColor4(0.5f, 0.75f, 1.0f, 1.19f), LLSettingsSky::SETTING_AMBIENT, "WLAmbient"),
- mBlueHorizon(LLColor4(0.25f, 0.25f, 1.0f, 1.0f), LLSettingsSky::SETTING_BLUE_HORIZON, "WLBlueHorizon"),
- mBlueDensity(LLColor4(0.25f, 0.25f, 0.25f, 1.0f), LLSettingsSky::SETTING_BLUE_DENSITY, "WLBlueDensity"),
- mHazeDensity(1.0f, LLSettingsSky::SETTING_HAZE_DENSITY),
- mHazeHorizon(1.0f, LLSettingsSky::SETTING_HAZE_HORIZON),
- mDensityMult(1.0f, LLSettingsSky::SETTING_DENSITY_MULTIPLIER, 1000),
- mDistanceMult(1.0f, LLSettingsSky::SETTING_DISTANCE_MULTIPLIER),
- mMaxAlt(4000.0f, LLSettingsSky::SETTING_MAX_Y),
-
- // Lighting
- mLightnorm(LLColor4(0.f, 0.707f, -0.707f, 1.f), LLSettingsSky::SETTING_LIGHT_NORMAL),
- mSunlight(LLColor4(0.5f, 0.5f, 0.5f, 1.0f), LLSettingsSky::SETTING_SUNLIGHT_COLOR, "WLSunlight"),
-
- mGlow(LLColor4(18.0f, 0.0f, -0.01f, 1.0f), LLSettingsSky::SETTING_GLOW),
- // Clouds
- mCloudColor(LLColor4(0.5f, 0.5f, 0.5f, 1.0f), LLSettingsSky::SETTING_CLOUD_COLOR, "WLCloudColor"),
- mCloudMain(LLColor4(0.5f, 0.5f, 0.125f, 1.0f), LLSettingsSky::SETTING_CLOUD_POS_DENSITY1),
- mCloudCoverage(0.0f, LLSettingsSky::SETTING_CLOUD_SHADOW),
- mCloudDetail(LLColor4(0.0f, 0.0f, 0.0f, 1.0f), LLSettingsSky::SETTING_CLOUD_POS_DENSITY2),
- mCloudScale(0.42f, LLSettingsSky::SETTING_CLOUD_SCALE)
-{
-
-}
-
-LLWatterSettingsAdapter::LLWatterSettingsAdapter():
- mFogColor(LLColor4((22.f / 255.f), (43.f / 255.f), (54.f / 255.f), (0.0f)), LLSettingsWater::SETTING_FOG_COLOR, "WaterFogColor"),
- mFogDensity(4, LLSettingsWater::SETTING_FOG_DENSITY, 2),
- mUnderWaterFogMod(0.25, LLSettingsWater::SETTING_FOG_MOD),
- mNormalScale(LLVector3(2.f, 2.f, 2.f), LLSettingsWater::SETTING_NORMAL_SCALE),
- mFresnelScale(0.5f, LLSettingsWater::SETTING_FRESNEL_SCALE),
- mFresnelOffset(0.4f, LLSettingsWater::SETTING_FRESNEL_OFFSET),
- mScaleAbove(0.025f, LLSettingsWater::SETTING_SCALE_ABOVE),
- mScaleBelow(0.2f, LLSettingsWater::SETTING_SCALE_BELOW),
- mBlurMultiplier(0.1f, LLSettingsWater::SETTING_BLUR_MULTIPILER),
- mWave1Dir(LLVector2(0.5f, 0.5f), LLSettingsWater::SETTING_WAVE1_DIR),
- mWave2Dir(LLVector2(0.5f, 0.5f), LLSettingsWater::SETTING_WAVE2_DIR)
-
-{
-
-}
diff --git a/indra/newview/llenvadapters.h b/indra/newview/llenvadapters.h
deleted file mode 100644
index c53423c5ae..0000000000
--- a/indra/newview/llenvadapters.h
+++ /dev/null
@@ -1,470 +0,0 @@
-/**
- * @file llenvadapters.h
- * @brief Declaration of classes managing WindLight and water settings.
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_ENVADAPTERS_H
-#define LL_ENVADAPTERS_H
-
-#include "v3math.h"
-#include "v3color.h"
-#include "v4math.h"
-#include "llsettingsbase.h"
-#include "llsettingssky.h"
-
-class WLColorControl
-{
-public:
- inline WLColorControl(LLColor4 color, const std::string& n, const std::string& slider_name = std::string()):
- mColor(color),
- mName(n),
- mSliderName(slider_name),
- mHasSliderName(false),
- mIsSunOrAmbientColor(false),
- mIsBlueHorizonOrDensity(false)
- {
- // if there's a slider name, say we have one
- mHasSliderName = !mSliderName.empty();
-
- // if it's the sun controller
- mIsSunOrAmbientColor = (mSliderName == "WLSunlight" || mSliderName == "WLAmbient");
- mIsBlueHorizonOrDensity = (mSliderName == "WLBlueHorizon" || mSliderName == "WLBlueDensity");
- }
-
- inline void setColor4(const LLColor4 & val)
- {
- mColor = val;
- }
-
- inline void setColor3(const LLColor3 & val)
- {
- mColor = val;
- }
-
- inline LLColor4 getColor4() const
- {
- return mColor;
- }
-
- inline LLColor3 getColor3(void) const
- {
- return vec4to3(mColor);
- }
-
- inline void update(const LLSettingsBase::ptr_t &psetting) const
- {
- psetting->setValue(mName, mColor);
- }
-
- inline bool getHasSliderName() const
- {
- return mHasSliderName;
- }
-
- inline std::string getSliderName() const
- {
- return mSliderName;
- }
-
- inline bool getIsSunOrAmbientColor() const
- {
- return mIsSunOrAmbientColor;
- }
-
- inline bool getIsBlueHorizonOrDensity() const
- {
- return mIsBlueHorizonOrDensity;
- }
-
- inline F32 getRed() const
- {
- return mColor[0];
- }
-
- inline F32 getGreen() const
- {
- return mColor[1];
- }
-
- inline F32 getBlue() const
- {
- return mColor[2];
- }
-
- inline F32 getIntensity() const
- {
- return mColor[3];
- }
-
- inline void setRed(F32 red)
- {
- mColor[0] = red;
- }
-
- inline void setGreen(F32 green)
- {
- mColor[1] = green;
- }
-
- inline void setBlue(F32 blue)
- {
- mColor[2] = blue;
- }
-
- inline void setIntensity(F32 intensity)
- {
- mColor[3] = intensity;
- }
-
-private:
- LLColor4 mColor; /// [3] is intensity, not alpha
- std::string mName; /// name to use to dereference params
- std::string mSliderName; /// name of the slider in menu
- bool mHasSliderName; /// only set slider name for true color types
- bool mIsSunOrAmbientColor; /// flag for if it's the sun or ambient color controller
- bool mIsBlueHorizonOrDensity; /// flag for if it's the Blue Horizon or Density color controller
-
-};
-
-// float slider control
-class WLFloatControl
-{
-public:
- inline WLFloatControl(F32 val, const std::string& n, F32 m = 1.0f):
- x(val),
- mName(n),
- mult(m)
- {
- }
-
- inline WLFloatControl &operator = (F32 val)
- {
- x = val;
- return *this;
- }
-
- inline operator F32 (void) const
- {
- return x;
- }
-
- inline void update(const LLSettingsBase::ptr_t &psetting) const
- {
- psetting->setValue(mName, x);
- }
-
- inline F32 getMult() const
- {
- return mult;
- }
-
- inline void setValue(F32 val)
- {
- x = val;
- }
-
-private:
- F32 x;
- std::string mName;
- F32 mult;
-};
-
-class WLXFloatControl
-{
-public:
- inline WLXFloatControl(F32 val, const std::string& n, F32 b):
- mExp(val),
- mBase(b),
- mName(n)
- {
- }
-
- inline WLXFloatControl & operator = (F32 val)
- {
- mExp = log(val) / log(mBase);
-
- return *this;
- }
-
- inline operator F32 (void) const
- {
- return pow(mBase, mExp);
- }
-
- inline void update(const LLSettingsBase::ptr_t &psetting) const
- {
- psetting->setValue(mName, pow(mBase, mExp));
- }
-
- inline F32 getExp() const
- {
- return mExp;
- }
-
- inline void setExp(F32 val)
- {
- mExp = val;
- }
-
- inline F32 getBase() const
- {
- return mBase;
- }
-
- inline void setBase(F32 val)
- {
- mBase = val;
- }
-
-private:
- F32 mExp;
- F32 mBase;
- std::string mName;
-};
-
-class WLVect2Control
-{
-public:
- inline WLVect2Control(LLVector2 val, const std::string& n):
- mU(val.mV[0]),
- mV(val.mV[1]),
- mName(n)
- {
- }
-
- inline WLVect2Control & operator = (const LLVector2 & val)
- {
- mU = val.mV[0];
- mV = val.mV[1];
-
- return *this;
- }
-
- inline void update(const LLSettingsBase::ptr_t &psetting) const
- {
- psetting->setValue(mName, LLVector2(mU, mV));
- }
-
- inline F32 getU() const
- {
- return mU;
- }
-
- inline void setU(F32 val)
- {
- mU = val;
- }
-
- inline F32 getV() const
- {
- return mV;
- }
-
- inline void setV(F32 val)
- {
- mV = val;
- }
-
-private:
- F32 mU;
- F32 mV;
- std::string mName;
-};
-
-class WLVect3Control
-{
-public:
- inline WLVect3Control(LLVector3 val, const std::string& n):
- mX(val.mV[0]),
- mY(val.mV[1]),
- mZ(val.mV[2]),
- mName(n)
- {
- }
-
- inline WLVect3Control & operator = (const LLVector3 & val)
- {
- mX = val.mV[0];
- mY = val.mV[1];
- mZ = val.mV[2];
-
- return *this;
- }
-
- inline void update(const LLSettingsBase::ptr_t &psetting) const
- {
- psetting->setValue(mName, LLVector3(mX, mY, mZ));
- }
-
- inline F32 getX() const
- {
- return mX;
- }
-
- inline void setX(F32 val)
- {
- mX = val;
- }
-
- inline F32 getY() const
- {
- return mY;
- }
-
- inline void setY(F32 val)
- {
- mY = val;
- }
-
- inline F32 getZ() const
- {
- return mZ;
- }
-
- inline void setZ(F32 val)
- {
- mZ = val;
- }
-
-private:
- F32 mX;
- F32 mY;
- F32 mZ;
- std::string mName;
-};
-
-class LLDensityProfileSettingsAdapter
-{
-public:
- LLDensityProfileSettingsAdapter(const std::string& config, int layerIndex = 0)
- : mConfig(config)
- , mLayerIndex(layerIndex)
- , mLayerWidth(1.0f, LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH)
- , mExpTerm(1.0f, LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM)
- , mExpScale(1.0f, LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR)
- , mLinTerm(1.0f, LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM)
- , mConstantTerm(1.0f, LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM)
- {}
-
-protected:
- std::string mConfig;
- int mLayerIndex;
- WLFloatControl mLayerWidth; // 0.0 -> to top of atmosphere, however big that may be.
- WLFloatControl mExpTerm;
- WLFloatControl mExpScale;
- WLFloatControl mLinTerm;
- WLFloatControl mConstantTerm;
-};
-
-class LLRayleighDensityProfileSettingsAdapter : public LLDensityProfileSettingsAdapter
-{
-public:
- LLRayleighDensityProfileSettingsAdapter(int layerIndex = 0)
- : LLDensityProfileSettingsAdapter(LLSettingsSky::SETTING_RAYLEIGH_CONFIG, layerIndex)
- {
- }
-};
-
-class LLMieDensityProfileSettingsAdapter : public LLDensityProfileSettingsAdapter
-{
-public:
- LLMieDensityProfileSettingsAdapter(int layerIndex = 0)
- : LLDensityProfileSettingsAdapter(LLSettingsSky::SETTING_MIE_CONFIG, layerIndex)
- , mAnisotropy(0.8f, LLSettingsSky::SETTING_MIE_ANISOTROPY_FACTOR)
- {
- }
-
-protected:
- WLFloatControl mAnisotropy;
-};
-
-class LLAbsorptionDensityProfileSettingsAdapter : public LLDensityProfileSettingsAdapter
-{
-public:
- LLAbsorptionDensityProfileSettingsAdapter(int layerIndex = 0)
- : LLDensityProfileSettingsAdapter(LLSettingsSky::SETTING_ABSORPTION_CONFIG, layerIndex)
- {
- }
-};
-
-//-------------------------------------------------------------------------
-class LLSkySettingsAdapter
-{
-public:
- typedef std::shared_ptr<LLSkySettingsAdapter> ptr_t;
-
- LLSkySettingsAdapter();
-
- WLFloatControl mWLGamma;
-
- /// Atmospherics
-// LEGACY_ATMOSPHERICS
- WLColorControl mAmbient;
- WLColorControl mBlueHorizon;
- WLFloatControl mHazeDensity;
- WLColorControl mBlueDensity;
- WLFloatControl mDensityMult;
- WLFloatControl mDistanceMult;
- WLFloatControl mHazeHorizon;
- WLFloatControl mMaxAlt;
-
- /// Lighting
- WLColorControl mLightnorm;
- WLColorControl mSunlight;
- WLColorControl mGlow;
-
- /// Clouds
- WLColorControl mCloudColor;
- WLColorControl mCloudMain;
- WLFloatControl mCloudCoverage;
- WLColorControl mCloudDetail;
- WLFloatControl mCloudScale;
-};
-
-class LLWatterSettingsAdapter
-{
-public:
- typedef std::shared_ptr<LLWatterSettingsAdapter> ptr_t;
-
- LLWatterSettingsAdapter();
-
- WLColorControl mFogColor;
- WLXFloatControl mFogDensity;
- WLFloatControl mUnderWaterFogMod;
-
- /// wavelet scales and directions
- WLVect3Control mNormalScale;
- WLVect2Control mWave1Dir;
- WLVect2Control mWave2Dir;
-
- // controls how water is reflected and refracted
- WLFloatControl mFresnelScale;
- WLFloatControl mFresnelOffset;
- WLFloatControl mScaleAbove;
- WLFloatControl mScaleBelow;
- WLFloatControl mBlurMultiplier;
-
-};
-
-#endif // LL_ENVIRONMENT_H
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp
deleted file mode 100644
index 763f9e4d5a..0000000000
--- a/indra/newview/llfloatereditsky.cpp
+++ /dev/null
@@ -1,740 +0,0 @@
-/**
- * @file llfloatereditsky.cpp
- * @brief Floater to create or edit a sky preset
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloatereditsky.h"
-
-#include <boost/make_shared.hpp>
-
-// libs
-#include "llbutton.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
-#include "llmultisliderctrl.h"
-#include "llnotifications.h"
-#include "llnotificationsutil.h"
-#include "llsliderctrl.h"
-#include "lltabcontainer.h"
-#include "lltimectrl.h"
-#include "lljoystickbutton.h"
-
-// newview
-#include "llagent.h"
-#include "llcolorswatch.h"
-#include "llregioninfomodel.h"
-#include "llviewerregion.h"
-
-#include "v3colorutil.h"
-#include "llenvironment.h"
-#include "llenvadapters.h"
-
-namespace
-{
- const F32 WL_SUN_AMBIENT_SLIDER_SCALE(3.0f);
- const F32 WL_BLUE_HORIZON_DENSITY_SCALE(2.0f);
- const F32 WL_CLOUD_SLIDER_SCALE(1.0f);
-}
-
-
-static F32 time24_to_sun_pos(F32 time24)
-{
- F32 sun_pos = fmodf((time24 - 6) / 24.0f, 1.0f);
- if (sun_pos < 0) ++sun_pos;
- return sun_pos;
-}
-
-LLFloaterEditSky::LLFloaterEditSky(const LLSD &key):
- LLFloater(key),
- mSkyPresetNameEditor(NULL),
- mSkyPresetCombo(NULL),
- mMakeDefaultCheckBox(NULL),
- mSaveButton(NULL),
- mSkyAdapter()
-{
-}
-
-// virtual
-BOOL LLFloaterEditSky::postBuild()
-{
- mSkyPresetNameEditor = getChild<LLLineEditor>("sky_preset_name");
- mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo");
- mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");
- mSaveButton = getChild<LLButton>("save");
- mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>();
-
- LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this));
-
- initCallbacks();
-
-// // Create the sun position scrubber on the slider.
-// getChild<LLMultiSliderCtrl>("WLSunPos")->addSlider(12.f);
-
- return TRUE;
-}
-
-// virtual
-void LLFloaterEditSky::onOpen(const LLSD& key)
-{
- bool new_preset = isNewPreset();
- std::string param = key.asString();
- std::string floater_title = getString(std::string("title_") + param);
- std::string hint = getString(std::string("hint_" + param));
-
- // Update floater title.
- setTitle(floater_title);
-
- // Update the hint at the top.
- getChild<LLUICtrl>("hint")->setValue(hint);
-
- // Hide the hint to the right of the combo if we're invoked to create a new preset.
- getChildView("note")->setVisible(!new_preset);
-
- // Switch between the sky presets combobox and preset name input field.
- mSkyPresetCombo->setVisible(!new_preset);
- mSkyPresetNameEditor->setVisible(new_preset);
-
- reset();
-}
-
-// virtual
-void LLFloaterEditSky::onClose(bool app_quitting)
-{
- if (!app_quitting) // there's no point to change environment if we're quitting
- {
- LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
- }
-}
-
-// virtual
-void LLFloaterEditSky::draw()
-{
- syncControls();
- LLFloater::draw();
-}
-
-void LLFloaterEditSky::initCallbacks(void)
-{
- // *TODO: warn user if a region environment update comes while we're editing a region sky preset.
-
- mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), NULL);
- mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditSky::onSkyPresetSelected, this));
- mSkyPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this));
-
- mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnSave, this));
- getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this));
-
- // Connect to region info updates.
- LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this));
-
- //-------------------------------------------------------------------------
-// LEGACY_ATMOSPHERICS
- // ambient
- getChild<LLUICtrl>("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mAmbient));
-
- // blue horizon/density
- getChild<LLUICtrl>("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueHorizon));
- getChild<LLUICtrl>("WLBlueDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueDensity));
-
- // haze density, horizon, mult, and altitude
- getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeDensity));
- getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeHorizon));
- getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDensityMult));
- getChild<LLUICtrl>("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDistanceMult));
- getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mMaxAlt));
-
- // sunlight
- getChild<LLUICtrl>("WLSunlight")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mSunlight));
-
- // glow
- getChild<LLUICtrl>("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowRMoved, this, _1, &mSkyAdapter->mGlow));
- getChild<LLUICtrl>("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowBMoved, this, _1, &mSkyAdapter->mGlow));
-
- // time of day
-// getChild<LLUICtrl>("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); // multi-slider
-// getChild<LLTimeCtrl>("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this)); // time ctrl
-// getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm));
- getChild<LLJoystickQuaternion>("WLSunRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunRotationChanged, this));
- getChild<LLJoystickQuaternion>("WLMoonRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onMoonRotationChanged, this));
-
- // Clouds
-
- // Cloud Color
- getChild<LLUICtrl>("WLCloudColor")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mCloudColor));
-
- // Cloud
- getChild<LLUICtrl>("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudMain));
- getChild<LLUICtrl>("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudMain));
- getChild<LLUICtrl>("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudMain));
-
- // Cloud Detail
- getChild<LLUICtrl>("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudDetail));
- getChild<LLUICtrl>("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudDetail));
- getChild<LLUICtrl>("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudDetail));
-
- // Cloud extras
- getChild<LLUICtrl>("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudCoverage));
- getChild<LLUICtrl>("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudScale));
- getChild<LLUICtrl>("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXMoved, this, _1));
- getChild<LLUICtrl>("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYMoved, this, _1));
-
-
- // Dome
- getChild<LLUICtrl>("WLGamma")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mWLGamma));
- getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1));
-}
-
-//=================================================================================================
-
-void LLFloaterEditSky::syncControls()
-{
- LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
- mEditSettings = psky;
-
- std::string name = psky->getName();
-
- mSkyPresetNameEditor->setText(name);
- mSkyPresetCombo->setValue(name);
-
-// LEGACY_ATMOSPHERICS
- // ambient
- mSkyAdapter->mAmbient.setColor3( psky->getAmbientColor() );
- setColorSwatch("WLAmbient", mSkyAdapter->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE);
-
- // blue horizon / density
- mSkyAdapter->mBlueHorizon.setColor3( psky->getBlueHorizon() );
- setColorSwatch("WLBlueHorizon", mSkyAdapter->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE);
- mSkyAdapter->mBlueDensity.setColor3( psky->getBlueDensity() );
- setColorSwatch("WLBlueDensity", mSkyAdapter->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE);
-
- // haze density, horizon, mult, and altitude
- mSkyAdapter->mHazeDensity = psky->getHazeDensity();
- childSetValue("WLHazeDensity", (F32) mSkyAdapter->mHazeDensity);
- mSkyAdapter->mHazeHorizon = psky->getHazeHorizon();
- childSetValue("WLHazeHorizon", (F32) mSkyAdapter->mHazeHorizon);
- mSkyAdapter->mDensityMult = psky->getDensityMultiplier();
- childSetValue("WLDensityMult", ((F32) mSkyAdapter->mDensityMult) * mSkyAdapter->mDensityMult.getMult());
- mSkyAdapter->mMaxAlt = psky->getMaxY();
- mSkyAdapter->mDistanceMult = psky->getDistanceMultiplier();
- childSetValue("WLDistanceMult", (F32) mSkyAdapter->mDistanceMult);
- childSetValue("WLMaxAltitude", (F32) mSkyAdapter->mMaxAlt);
-
- // Lighting
-
- // sunlight
- mSkyAdapter->mSunlight.setColor3( psky->getSunlightColor() );
- setColorSwatch("WLSunlight", mSkyAdapter->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE);
-
- // glow
- mSkyAdapter->mGlow.setColor3( psky->getGlow() );
- childSetValue("WLGlowR", 2 - mSkyAdapter->mGlow.getRed() / 20.0f);
- childSetValue("WLGlowB", -mSkyAdapter->mGlow.getBlue() / 5.0f);
-
-
-
-// LLSettingsSky::azimalt_t azal = psky->getSunRotationAzAl();
-//
-// F32 time24 = sun_pos_to_time24(azal.second / F_TWO_PI);
-// getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE);
-// getChild<LLTimeCtrl>("WLDayTime")->setTime24(time24);
-// childSetValue("WLEastAngle", azal.first / F_TWO_PI);
- getChild<LLJoystickQuaternion>("WLSunRotation")->setRotation(psky->getSunRotation());
- getChild<LLJoystickQuaternion>("WLMoonRotation")->setRotation(psky->getMoonRotation());
-
- // Clouds
-
- // Cloud Color
- mSkyAdapter->mCloudColor.setColor3( psky->getCloudColor() );
- setColorSwatch("WLCloudColor", mSkyAdapter->mCloudColor, WL_CLOUD_SLIDER_SCALE);
-
- // Cloud
- mSkyAdapter->mCloudMain.setColor3( psky->getCloudPosDensity1() );
- childSetValue("WLCloudX", mSkyAdapter->mCloudMain.getRed());
- childSetValue("WLCloudY", mSkyAdapter->mCloudMain.getGreen());
- childSetValue("WLCloudDensity", mSkyAdapter->mCloudMain.getBlue());
-
- // Cloud Detail
- mSkyAdapter->mCloudDetail.setColor3( psky->getCloudPosDensity2() );
- childSetValue("WLCloudDetailX", mSkyAdapter->mCloudDetail.getRed());
- childSetValue("WLCloudDetailY", mSkyAdapter->mCloudDetail.getGreen());
- childSetValue("WLCloudDetailDensity", mSkyAdapter->mCloudDetail.getBlue());
-
- // Cloud extras
- mSkyAdapter->mCloudCoverage = psky->getCloudShadow();
- mSkyAdapter->mCloudScale = psky->getCloudScale();
- childSetValue("WLCloudCoverage", (F32) mSkyAdapter->mCloudCoverage);
- childSetValue("WLCloudScale", (F32) mSkyAdapter->mCloudScale);
-
- // cloud scrolling
- LLVector2 scroll_rate = psky->getCloudScrollRate();
-
- // LAPRAS: These should go away...
- childDisable("WLCloudLockX");
- childDisable("WLCloudLockY");
-
- // disable if locked, enable if not
- childEnable("WLCloudScrollX");
- childEnable("WLCloudScrollY");
-
- // *HACK cloud scrolling is off my an additive of 10
- childSetValue("WLCloudScrollX", scroll_rate[0] - 10.0f);
- childSetValue("WLCloudScrollY", scroll_rate[1] - 10.0f);
-
- // Tweak extras
-
- mSkyAdapter->mWLGamma = psky->getGamma();
- childSetValue("WLGamma", (F32) mSkyAdapter->mWLGamma);
-
- childSetValue("WLStarAlpha", psky->getStarBrightness());
-}
-
-void LLFloaterEditSky::setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k)
-{
- // Set the value, dividing it by <k> first.
- LLColor4 color = from_ctrl.getColor4();
- getChild<LLColorSwatchCtrl>(name)->set(color / k);
-}
-
-// color control callbacks
-void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl)
-{
- LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
- LLColor4 color_vec(swatch->get().mV);
-
- // Multiply RGB values by the appropriate factor.
- F32 k = WL_CLOUD_SLIDER_SCALE;
- if (color_ctrl->getIsSunOrAmbientColor())
- {
- k = WL_SUN_AMBIENT_SLIDER_SCALE;
- }
- else if (color_ctrl->getIsBlueHorizonOrDensity())
- {
- k = WL_BLUE_HORIZON_DENSITY_SCALE;
- }
-
- color_vec *= k; // intensity isn't affected by the multiplication
-
- // Set intensity to maximum of the RGB values.
- color_vec.mV[3] = color_max(color_vec);
-
- // Apply the new RGBI value.
- color_ctrl->setColor4(color_vec);
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::onColorControlRMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- F32 red_value = sldr_ctrl->getValueF32();
- F32 k = 1.0f;
-
- if (color_ctrl->getIsSunOrAmbientColor())
- {
- k = WL_SUN_AMBIENT_SLIDER_SCALE;
- }
- if (color_ctrl->getIsBlueHorizonOrDensity())
- {
- k = WL_BLUE_HORIZON_DENSITY_SCALE;
- }
- color_ctrl->setRed(red_value * k);
-
- adjustIntensity(color_ctrl, red_value, k);
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::onColorControlGMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- F32 green_value = sldr_ctrl->getValueF32();
- F32 k = 1.0f;
-
- if (color_ctrl->getIsSunOrAmbientColor())
- {
- k = WL_SUN_AMBIENT_SLIDER_SCALE;
- }
- if (color_ctrl->getIsBlueHorizonOrDensity())
- {
- k = WL_BLUE_HORIZON_DENSITY_SCALE;
- }
- color_ctrl->setGreen(green_value * k);
-
- adjustIntensity(color_ctrl, green_value, k);
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::onColorControlBMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- F32 blue_value = sldr_ctrl->getValueF32();
- F32 k = 1.0f;
-
- if (color_ctrl->getIsSunOrAmbientColor())
- {
- k = WL_SUN_AMBIENT_SLIDER_SCALE;
- }
- if (color_ctrl->getIsBlueHorizonOrDensity())
- {
- k = WL_BLUE_HORIZON_DENSITY_SCALE;
- }
- color_ctrl->setBlue(blue_value * k);
-
- adjustIntensity(color_ctrl, blue_value, k);
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::adjustIntensity(WLColorControl *ctrl, F32 val, F32 scale)
-{
- if (ctrl->getHasSliderName())
- {
- LLColor4 color = ctrl->getColor4();
- F32 i = color_max(color) / scale;
- ctrl->setIntensity(i);
- std::string name = ctrl->getSliderName();
- name.append("I");
-
- childSetValue(name, i);
- }
-}
-
-
-/// GLOW SPECIFIC CODE
-void LLFloaterEditSky::onGlowRMoved(LLUICtrl* ctrl, void* userdata)
-{
-
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- // scaled by 20
- color_ctrl->setRed((2 - sldr_ctrl->getValueF32()) * 20);
-
- color_ctrl->update(mEditSettings);
-}
-
-/// \NOTE that we want NEGATIVE (-) B
-void LLFloaterEditSky::onGlowBMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big
- color_ctrl->setBlue(-sldr_ctrl->getValueF32() * 5);
-
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::onFloatControlMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- WLFloatControl * floatControl = static_cast<WLFloatControl *>(userdata);
-
- floatControl->setValue(sldr_ctrl->getValueF32() / floatControl->getMult());
-
- floatControl->update(mEditSettings);
-}
-
-
-// Lighting callbacks
-
-// time of day
-void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata)
-{
- LLMultiSliderCtrl* sun_msldr = getChild<LLMultiSliderCtrl>("WLSunPos");
- LLSliderCtrl* east_sldr = getChild<LLSliderCtrl>("WLEastAngle");
- LLTimeCtrl* time_ctrl = getChild<LLTimeCtrl>("WLDayTime");
- WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata);
-
- F32 time24 = sun_msldr->getCurSliderValue();
- time_ctrl->setTime24(time24); // sync the time ctrl with the new sun position
-
- // get the two angles
- F32 azimuth = F_TWO_PI * east_sldr->getValueF32();
- F32 altitude = F_TWO_PI * time24_to_sun_pos(time24);
- mEditSettings->setSunRotation(azimuth, altitude);
- mEditSettings->setMoonRotation(azimuth + F_PI, -altitude);
-
- LLVector4 sunnorm( mEditSettings->getSunDirection(), 1.f );
-
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditSky::onTimeChanged()
-{
- F32 time24 = getChild<LLTimeCtrl>("WLDayTime")->getTime24();
- getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE);
- onSunMoved(getChild<LLUICtrl>("WLSunPos"), &(mSkyAdapter->mLightnorm));
-}
-
-void LLFloaterEditSky::onSunRotationChanged()
-{
- LLJoystickQuaternion* sun_spinner = getChild<LLJoystickQuaternion>("WLSunRotation");
- LLQuaternion sunrot(sun_spinner->getRotation());
-
- mEditSettings->setSunRotation(sunrot);
-}
-
-void LLFloaterEditSky::onMoonRotationChanged()
-{
- LLJoystickQuaternion* moon_spinner = getChild<LLJoystickQuaternion>("WLMoonRotation");
- LLQuaternion moonrot(moon_spinner->getRotation());
-
- mEditSettings->setMoonRotation(moonrot);
-}
-
-void LLFloaterEditSky::onStarAlphaMoved(LLUICtrl* ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- mEditSettings->setStarBrightness(sldr_ctrl->getValueF32());
-}
-
-// Clouds
-void LLFloaterEditSky::onCloudScrollXMoved(LLUICtrl* ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
- // *HACK all cloud scrolling is off by an additive of 10.
- mEditSettings->setCloudScrollRateX(sldr_ctrl->getValueF32() + 10.0f);
-}
-
-void LLFloaterEditSky::onCloudScrollYMoved(LLUICtrl* ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- // *HACK all cloud scrolling is off by an additive of 10.
- mEditSettings->setCloudScrollRateY(sldr_ctrl->getValueF32() + 10.0f);
-}
-
-//=================================================================================================
-
-void LLFloaterEditSky::reset()
-{
- if (isNewPreset())
- {
- mSkyPresetNameEditor->setValue(LLSD());
- mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name
- }
- else
- {
- refreshSkyPresetsList();
-
- // Disable controls until a sky preset to edit is selected.
- enableEditing(false);
- }
-}
-
-bool LLFloaterEditSky::isNewPreset() const
-{
- return mKey.asString() == "new";
-}
-
-void LLFloaterEditSky::refreshSkyPresetsList()
-{
- mSkyPresetCombo->removeall();
-
- LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList();
-
- for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it)
- {
- mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second));
- }
-
- mSkyPresetCombo->setLabel(getString("combo_label"));
-}
-
-void LLFloaterEditSky::enableEditing(bool enable)
-{
- // Enable/disable the tab and their contents.
- LLTabContainer* tab_container = getChild<LLTabContainer>("WindLight Tabs");
- tab_container->setEnabled(enable);
- for (S32 i = 0; i < tab_container->getTabCount(); ++i)
- {
- tab_container->enableTabButton(i, enable);
- tab_container->getPanelByIndex(i)->setCtrlsEnabled(enable);
- }
-
- // Enable/disable saving.
- mSaveButton->setEnabled(enable);
- mMakeDefaultCheckBox->setEnabled(enable);
-}
-
-void LLFloaterEditSky::saveRegionSky()
-{
-#if 0
- LLWLParamKey key(getSelectedSkyPreset());
- llassert(key.scope == LLEnvKey::SCOPE_REGION);
-
- LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << LL_ENDL;
- LLWLParamManager& wl_mgr = LLWLParamManager::instance();
- wl_mgr.mCurParams.mName = key.name;
- wl_mgr.setParamSet(key, wl_mgr.mCurParams);
-
- // *TODO: save to cached region settings.
- LL_WARNS("Windlight") << "Saving region sky is not fully implemented yet" << LL_ENDL;
-#endif
-}
-
-std::string LLFloaterEditSky::getSelectedPresetName() const
-{
- std::string name;
- if (mSkyPresetNameEditor->getVisible())
- {
- name = mSkyPresetNameEditor->getText();
- }
- else
- {
- LLSD combo_val = mSkyPresetCombo->getValue();
- name = combo_val[0].asString();
- }
-
- return name;
-}
-
-void LLFloaterEditSky::onSkyPresetNameEdited()
-{
- std::string name = mSkyPresetNameEditor->getText();
- LLSettingsWater::ptr_t psky = LLEnvironment::instance().getCurrentWater();
-
- psky->setName(name);
-}
-
-void LLFloaterEditSky::onSkyPresetSelected()
-{
- std::string name;
-
- name = getSelectedPresetName();
-
- LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(name);
-
- if (!psky)
- {
- LL_WARNS("WATEREDIT") << "Could not find water preset" << LL_ENDL;
- enableEditing(false);
- return;
- }
-
- psky = psky->buildClone();
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, psky);
- mEditSettings = psky;
-
- syncControls();
- enableEditing(true);
-
-}
-
-bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-
- // If they choose save, do it. Otherwise, don't do anything
- if (option == 0)
- {
- onSaveConfirmed();
- }
-
- return false;
-}
-
-void LLFloaterEditSky::onSaveConfirmed()
-{
- // Save currently displayed water params to the selected preset.
- std::string name = mEditSettings->getName();
-
- LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL;
-
- LLEnvironment::instance().addSky(mEditSettings);
-
- // Change preference if requested.
- if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue())
- {
- LL_DEBUGS("Windlight") << name << " is now the new preferred sky preset" << LL_ENDL;
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings);
- }
-
- closeFloater();
-}
-
-void LLFloaterEditSky::onBtnSave()
-{
- LLEnvironment::instance().addSky(mEditSettings);
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings);
-
- closeFloater();
-}
-
-void LLFloaterEditSky::onBtnCancel()
-{
- closeFloater();
-}
-
-void LLFloaterEditSky::onSkyPresetListChange()
-{
- refreshSkyPresetsList();
-}
-
-void LLFloaterEditSky::onRegionSettingsChange()
-{
-#if 0
- // If creating a new sky, don't bother.
- if (isNewPreset())
- {
- return;
- }
-
- if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) // if editing a region sky
- {
- // reset the floater to its initial state
- reset();
-
- // *TODO: Notify user?
- }
- else // editing a local sky
- {
- refreshSkyPresetsList();
- }
-#endif
-}
-
-void LLFloaterEditSky::onRegionInfoUpdate()
-{
-#if 0
- bool can_edit = true;
-
- // If we've selected a region sky preset for editing.
- if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION)
- {
- // check whether we have the access
- can_edit = LLEnvManagerNew::canEditRegionSettings();
- }
-
- enableEditing(can_edit);
-#endif
-}
diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h
deleted file mode 100644
index 36438becce..0000000000
--- a/indra/newview/llfloatereditsky.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file llfloatereditsky.h
- * @brief Floater to create or edit a sky preset
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATEREDITSKY_H
-#define LL_LLFLOATEREDITSKY_H
-
-#include "llfloater.h"
-#include "llsettingssky.h"
-
-class LLButton;
-class LLCheckBoxCtrl;
-class LLComboBox;
-class LLLineEditor;
-class WLColorControl;
-class LLSkySettingsAdapter;
-
-typedef boost::shared_ptr<LLSkySettingsAdapter> LLSkySettingsAdapterPtr;
-
-
-/**
- * Floater for creating or editing a sky preset.
- */
-class LLFloaterEditSky : public LLFloater
-{
- LOG_CLASS(LLFloaterEditSky);
-
-public:
- LLFloaterEditSky(const LLSD &key);
-
- /*virtual*/ BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
- /*virtual*/ void onClose(bool app_quitting);
- /*virtual*/ void draw();
-
-private:
- void initCallbacks(void);
-
- //-- WL stuff begins ------------------------------------------------------
-
- void syncControls(); /// sync up sliders with parameters
-
- void setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k);
-
- // general purpose callbacks for dealing with color controllers
- void onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl);
- void onColorControlRMoved(LLUICtrl* ctrl, void* userdata);
- void onColorControlGMoved(LLUICtrl* ctrl, void* userdata);
- void onColorControlBMoved(LLUICtrl* ctrl, void* userdata);
- void onFloatControlMoved(LLUICtrl* ctrl, void* userdata);
-
- void adjustIntensity(WLColorControl *ctrl, F32 color, F32 scale);
-
- // lighting callbacks for glow
- void onGlowRMoved(LLUICtrl* ctrl, void* userdata);
- void onGlowBMoved(LLUICtrl* ctrl, void* userdata);
-
- // lighting callbacks for sun
- void onSunMoved(LLUICtrl* ctrl, void* userdata);
- void onTimeChanged();
-
- void onSunRotationChanged();
- void onMoonRotationChanged();
-
- // for handling when the star slider is moved to adjust the alpha
- void onStarAlphaMoved(LLUICtrl* ctrl);
-
- // handle cloud scrolling
- void onCloudScrollXMoved(LLUICtrl* ctrl);
- void onCloudScrollYMoved(LLUICtrl* ctrl);
-
- //-- WL stuff ends --------------------------------------------------------
-
- void reset(); /// reset the floater to its initial state
- bool isNewPreset() const;
- void refreshSkyPresetsList();
- void enableEditing(bool enable);
- void saveRegionSky();
- std::string getSelectedPresetName() const;
-
- void onSkyPresetNameEdited();
- void onSkyPresetSelected();
- bool onSaveAnswer(const LLSD& notification, const LLSD& response);
- void onSaveConfirmed();
-
- void onBtnSave();
- void onBtnCancel();
-
- void onSkyPresetListChange();
- void onRegionSettingsChange();
- void onRegionInfoUpdate();
-
- LLSettingsSky::ptr_t mEditSettings;
-
- LLLineEditor* mSkyPresetNameEditor;
- LLComboBox* mSkyPresetCombo;
- LLCheckBoxCtrl* mMakeDefaultCheckBox;
- LLButton* mSaveButton;
- LLSkySettingsAdapterPtr mSkyAdapter;
-
-};
-
-#endif // LL_LLFLOATEREDITSKY_H
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp
deleted file mode 100644
index 4d8ffdef21..0000000000
--- a/indra/newview/llfloatereditwater.cpp
+++ /dev/null
@@ -1,526 +0,0 @@
-/**
- * @file llfloatereditwater.cpp
- * @brief Floater to create or edit a water preset
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloatereditwater.h"
-
-#include <boost/make_shared.hpp>
-
-// libs
-#include "llbutton.h"
-#include "llcheckboxctrl.h"
-#include "llcolorswatch.h"
-#include "llcombobox.h"
-//#include "llnotifications.h"
-#include "llnotificationsutil.h"
-#include "llsliderctrl.h"
-#include "lltexturectrl.h"
-
-// newview
-#include "llagent.h"
-#include "llregioninfomodel.h"
-#include "llviewerregion.h"
-
-#include "llenvironment.h"
-#include "llsettingswater.h"
-#include "llenvadapters.h"
-
-#include "v3colorutil.h"
-
-#undef max // Fixes a Windows compiler error
-
-LLFloaterEditWater::LLFloaterEditWater(const LLSD &key):
- LLFloater(key),
- mWaterPresetNameEditor(NULL),
- mWaterPresetCombo(NULL),
- mMakeDefaultCheckBox(NULL),
- mSaveButton(NULL),
- mWaterAdapter()
-{
-}
-
-// virtual
-BOOL LLFloaterEditWater::postBuild()
-{
- mWaterPresetNameEditor = getChild<LLLineEditor>("water_preset_name");
- mWaterPresetCombo = getChild<LLComboBox>("water_preset_combo");
- mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");
- mSaveButton = getChild<LLButton>("save");
-
- mWaterAdapter = boost::make_shared<LLWatterSettingsAdapter>();
-
- LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this));
-
- initCallbacks();
- refreshWaterPresetsList();
- syncControls();
-
- return TRUE;
-}
-
-// virtual
-void LLFloaterEditWater::onOpen(const LLSD& key)
-{
- bool new_preset = isNewPreset();
- std::string param = key.asString();
- std::string floater_title = getString(std::string("title_") + param);
- std::string hint = getString(std::string("hint_" + param));
-
- // Update floater title.
- setTitle(floater_title);
-
- // Update the hint at the top.
- getChild<LLUICtrl>("hint")->setValue(hint);
-
- // Hide the hint to the right of the combo if we're invoked to create a new preset.
- getChildView("note")->setVisible(!new_preset);
-
- // Switch between the water presets combobox and preset name input field.
- mWaterPresetCombo->setVisible(!new_preset);
- mWaterPresetNameEditor->setVisible(new_preset);
-
- reset();
-}
-
-// virtual
-void LLFloaterEditWater::onClose(bool app_quitting)
-{
- if (!app_quitting) // there's no point to change environment if we're quitting
- {
- LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT);
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
- }
-}
-
-// virtual
-void LLFloaterEditWater::draw()
-{
- syncControls();
- LLFloater::draw();
-}
-
-void LLFloaterEditWater::initCallbacks(void)
-{
- mWaterPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this), NULL);
- mWaterPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditWater::onWaterPresetSelected, this));
- mWaterPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this));
-
- mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnSave, this));
- getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnCancel, this));
-
- // Connect to region info updates.
- LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditWater::onRegionInfoUpdate, this));
-
- //-------------------------------------------------------------------------
-
- getChild<LLUICtrl>("WaterFogColor")->setCommitCallback(boost::bind(&LLFloaterEditWater::onColorControlMoved, this, _1, &mWaterAdapter->mFogColor));
-
- // fog density
- getChild<LLUICtrl>("WaterFogDensity")->setCommitCallback(boost::bind(&LLFloaterEditWater::onExpFloatControlMoved, this, _1, &mWaterAdapter->mFogDensity));
- getChild<LLUICtrl>("WaterUnderWaterFogMod")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mUnderWaterFogMod));
-
- // blue density
- getChild<LLUICtrl>("WaterNormalScaleX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlXMoved, this, _1, &mWaterAdapter->mNormalScale));
- getChild<LLUICtrl>("WaterNormalScaleY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlYMoved, this, _1, &mWaterAdapter->mNormalScale));
- getChild<LLUICtrl>("WaterNormalScaleZ")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlZMoved, this, _1, &mWaterAdapter->mNormalScale));
-
- // fresnel
- getChild<LLUICtrl>("WaterFresnelScale")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mFresnelScale));
- getChild<LLUICtrl>("WaterFresnelOffset")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mFresnelOffset));
-
- // scale above/below
- getChild<LLUICtrl>("WaterScaleAbove")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mScaleAbove));
- getChild<LLUICtrl>("WaterScaleBelow")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mScaleBelow));
-
- // blur mult
- getChild<LLUICtrl>("WaterBlurMult")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &mWaterAdapter->mBlurMultiplier));
-
- // wave direction
- getChild<LLUICtrl>("WaterWave1DirX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlXMoved, this, _1, &mWaterAdapter->mWave1Dir));
- getChild<LLUICtrl>("WaterWave1DirY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlYMoved, this, _1, &mWaterAdapter->mWave1Dir));
- getChild<LLUICtrl>("WaterWave2DirX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlXMoved, this, _1, &mWaterAdapter->mWave2Dir));
- getChild<LLUICtrl>("WaterWave2DirY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlYMoved, this, _1, &mWaterAdapter->mWave2Dir));
-
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("WaterNormalMap");
- texture_ctrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL);
- texture_ctrl->setCommitCallback(boost::bind(&LLFloaterEditWater::onNormalMapPicked, this, _1));
-}
-
-//=============================================================================
-
-void LLFloaterEditWater::syncControls()
-{
- // *TODO: Eliminate slow getChild() calls.
-
- LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater();
- mEditSettings = pwater;
-
- std::string name = pwater->getName();
- mWaterPresetNameEditor->setText(name);
- mWaterPresetCombo->setValue(name);
-
- //getChild<LLUICtrl>("WaterGlow")->setValue(col.mV[3]);
- getChild<LLColorSwatchCtrl>("WaterFogColor")->set(LLColor4(pwater->getFogColor()));
-
- // fog and wavelets
- mWaterAdapter->mFogDensity = pwater->getFogDensity();
- getChild<LLUICtrl>("WaterFogDensity")->setValue(mWaterAdapter->mFogDensity.getExp());
-
- mWaterAdapter->mUnderWaterFogMod = pwater->getFogMod();
- getChild<LLUICtrl>("WaterUnderWaterFogMod")->setValue(static_cast<F32>(mWaterAdapter->mUnderWaterFogMod));
-
- mWaterAdapter->mNormalScale = pwater->getNormalScale();
- getChild<LLUICtrl>("WaterNormalScaleX")->setValue(mWaterAdapter->mNormalScale.getX());
- getChild<LLUICtrl>("WaterNormalScaleY")->setValue(mWaterAdapter->mNormalScale.getY());
- getChild<LLUICtrl>("WaterNormalScaleZ")->setValue(mWaterAdapter->mNormalScale.getZ());
-
- // Fresnel
- mWaterAdapter->mFresnelScale = pwater->getFresnelScale();
- getChild<LLUICtrl>("WaterFresnelScale")->setValue(static_cast<F32>(mWaterAdapter->mFresnelScale));
- mWaterAdapter->mFresnelOffset = pwater->getFresnelOffset();
- getChild<LLUICtrl>("WaterFresnelOffset")->setValue(static_cast<F32>(mWaterAdapter->mFresnelOffset));
-
- // Scale Above/Below
- mWaterAdapter->mScaleAbove = pwater->getScaleAbove();
- getChild<LLUICtrl>("WaterScaleAbove")->setValue(static_cast<F32>(mWaterAdapter->mScaleAbove));
- mWaterAdapter->mScaleBelow = pwater->getScaleBelow();
- getChild<LLUICtrl>("WaterScaleBelow")->setValue(static_cast<F32>(mWaterAdapter->mScaleBelow));
-
- // blur mult
- mWaterAdapter->mBlurMultiplier = pwater->getBlurMultiplier();
- getChild<LLUICtrl>("WaterBlurMult")->setValue(static_cast<F32>(mWaterAdapter->mBlurMultiplier));
-
- // wave directions
- mWaterAdapter->mWave1Dir = pwater->getWave1Dir();
- getChild<LLUICtrl>("WaterWave1DirX")->setValue(mWaterAdapter->mWave1Dir.getU());
- getChild<LLUICtrl>("WaterWave1DirY")->setValue(mWaterAdapter->mWave1Dir.getV());
-
- mWaterAdapter->mWave2Dir = pwater->getWave2Dir();
- getChild<LLUICtrl>("WaterWave2DirX")->setValue(mWaterAdapter->mWave2Dir.getU());
- getChild<LLUICtrl>("WaterWave2DirY")->setValue(mWaterAdapter->mWave2Dir.getV());
-
- LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap");
- textCtrl->setImageAssetID(pwater->getNormalMapID());
-}
-
-
-// vector control callbacks
-void LLFloaterEditWater::onVector3ControlXMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- vector_ctrl->setX( sldr_ctrl->getValueF32() );
- vector_ctrl->update(mEditSettings);
-}
-
-// vector control callbacks
-void LLFloaterEditWater::onVector3ControlYMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- vector_ctrl->setY(sldr_ctrl->getValueF32());
- vector_ctrl->update(mEditSettings);
-}
-
-// vector control callbacks
-void LLFloaterEditWater::onVector3ControlZMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- vector_ctrl->setZ(sldr_ctrl->getValueF32());
- vector_ctrl->update(mEditSettings);
-}
-
-
-// vector control callbacks
-void LLFloaterEditWater::onVector2ControlXMoved(LLUICtrl* ctrl, WLVect2Control* vector_ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- vector_ctrl->setU(sldr_ctrl->getValueF32());
- vector_ctrl->update(mEditSettings);
-}
-
-// vector control callbacks
-void LLFloaterEditWater::onVector2ControlYMoved(LLUICtrl* ctrl, WLVect2Control* vector_ctrl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- vector_ctrl->setV(sldr_ctrl->getValueF32());
- vector_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditWater::onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* floatControl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- floatControl->setValue(sldr_ctrl->getValueF32());
- floatControl->update(mEditSettings);
-}
-
-void LLFloaterEditWater::onExpFloatControlMoved(LLUICtrl* ctrl, WLXFloatControl* expFloatControl)
-{
- LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl);
-
- expFloatControl->setExp(sldr_ctrl->getValueF32());
- expFloatControl->update(mEditSettings);
-}
-
-void LLFloaterEditWater::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl)
-{
- LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
- color_ctrl->setColor4( swatch->get() );
- color_ctrl->update(mEditSettings);
-}
-
-void LLFloaterEditWater::onNormalMapPicked(LLUICtrl* ctrl)
-{
- LLTextureCtrl* textCtrl = static_cast<LLTextureCtrl*>(ctrl);
- LLUUID textID = textCtrl->getImageAssetID();
- mEditSettings->setNormalMapID(textID);
-}
-
-//=============================================================================
-
-void LLFloaterEditWater::reset()
-{
- if (isNewPreset())
- {
- mWaterPresetNameEditor->setValue(LLSD());
- mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name
- }
- else
- {
- refreshWaterPresetsList();
-
- // Disable controls until a water preset to edit is selected.
- enableEditing(false);
- }
-}
-
-bool LLFloaterEditWater::isNewPreset() const
-{
- return mKey.asString() == "new";
-}
-
-void LLFloaterEditWater::refreshWaterPresetsList()
-{
- mWaterPresetCombo->removeall();
-
- LLEnvironment::list_name_id_t list = LLEnvironment::instance().getWaterList();
-
- for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it)
- {
- mWaterPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second));
- }
-
- mWaterPresetCombo->setLabel(getString("combo_label"));
-}
-
-void LLFloaterEditWater::enableEditing(bool enable)
-{
- // Enable/disable water controls.
- getChild<LLPanel>("panel_water_preset")->setCtrlsEnabled(enable);
-
- // Enable/disable saving.
- mSaveButton->setEnabled(enable);
- mMakeDefaultCheckBox->setEnabled(enable);
-}
-
-void LLFloaterEditWater::saveRegionWater()
-{
-#if 0
- llassert(getCurrentScope() == LLEnvKey::SCOPE_REGION); // make sure we're editing region water
-
- LL_DEBUGS("Windlight") << "Saving region water preset" << LL_ENDL;
-
- //LLWaterParamSet region_water = water_mgr.mCurParams;
-
- // *TODO: save to cached region settings.
- LL_WARNS("Windlight") << "Saving region water is not fully implemented yet" << LL_ENDL;
-#endif
-}
-
-#if 0
-std::string LLFloaterEditWater::getCurrentPresetName() const
-{
- std::string name;
- LLEnvKey::EScope scope;
- getSelectedPreset(name, scope);
- return name;
-}
-#endif
-
-#if 0
-LLEnvKey::EScope LLFloaterEditWater::getCurrentScope() const
-{
- std::string name;
- LLEnvKey::EScope scope;
- getSelectedPreset(name, scope);
- return scope;
-}
-#endif
-
-std::string LLFloaterEditWater::getSelectedPresetName() const
-{
- std::string name;
- if (mWaterPresetNameEditor->getVisible())
- {
- name = mWaterPresetNameEditor->getText();
- }
- else
- {
- LLSD combo_val = mWaterPresetCombo->getValue();
- name = combo_val[0].asString();
- }
-
- return name;
-}
-
-void LLFloaterEditWater::onWaterPresetNameEdited()
-{
- std::string name = mWaterPresetNameEditor->getText();
- LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater();
-
- pwater->setName(name);
-#if 0
- // Disable saving a water preset having empty name.
- mSaveButton->setEnabled(!getCurrentPresetName().empty());
-#endif
-}
-
-void LLFloaterEditWater::onWaterPresetSelected()
-{
- std::string name;
-
- name = getSelectedPresetName();
-
- LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(name);
-
- if (!pwater)
- {
- LL_WARNS("WATEREDIT") << "Could not find water preset" << LL_ENDL;
- enableEditing(false);
- return;
- }
-
- pwater = pwater->buildClone();
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, pwater);
- mEditSettings = pwater;
-
- syncControls();
- enableEditing(true);
-}
-
-bool LLFloaterEditWater::onSaveAnswer(const LLSD& notification, const LLSD& response)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
-
- // If they choose save, do it. Otherwise, don't do anything
- if (option == 0)
- {
- onSaveConfirmed();
- }
-
- return false;
-}
-
-void LLFloaterEditWater::onSaveConfirmed()
-{
- // Save currently displayed water params to the selected preset.
- std::string name = mEditSettings->getName();
-
- LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL;
-
- LLEnvironment::instance().addWater(mEditSettings);
-
- // Change preference if requested.
- if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue())
- {
- LL_DEBUGS("Windlight") << name << " is now the new preferred water preset" << LL_ENDL;
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings);
- }
-
- closeFloater();
-}
-
-void LLFloaterEditWater::onBtnSave()
-{
- LLEnvironment::instance().addWater(mEditSettings);
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings);
-
- closeFloater();
-}
-
-void LLFloaterEditWater::onBtnCancel()
-{
- closeFloater();
-}
-
-void LLFloaterEditWater::onWaterPresetListChange()
-{
- refreshWaterPresetsList();
-}
-
-void LLFloaterEditWater::onRegionSettingsChange()
-{
-#if 0
- // If creating a new preset, don't bother.
- if (isNewPreset())
- {
- return;
- }
-
- if (getCurrentScope() == LLEnvKey::SCOPE_REGION) // if editing region water
- {
- // reset the floater to its initial state
- reset();
-
- // *TODO: Notify user?
- }
- else // editing a local preset
- {
- refreshWaterPresetsList();
- }
-#endif
-}
-
-void LLFloaterEditWater::onRegionInfoUpdate()
-{
-#if 0
- bool can_edit = true;
-
- // If we've selected the region water for editing.
- if (getCurrentScope() == LLEnvKey::SCOPE_REGION)
- {
- // check whether we have the access
- can_edit = LLEnvManagerNew::canEditRegionSettings();
- }
-
- enableEditing(can_edit);
-#endif
-}
diff --git a/indra/newview/llfloatereditwater.h b/indra/newview/llfloatereditwater.h
deleted file mode 100644
index 081b939039..0000000000
--- a/indra/newview/llfloatereditwater.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @file llfloatereditwater.h
- * @brief Floater to create or edit a water preset
- *
- * $LicenseInfo:firstyear=2011&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2011, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATEREDITWATER_H
-#define LL_LLFLOATEREDITWATER_H
-
-#include "llfloater.h"
-#include "llsettingswater.h"
-
-class LLButton;
-class LLCheckBoxCtrl;
-class LLComboBox;
-class LLLineEditor;
-
-class WLVect2Control;
-class WLVect3Control;
-class WLColorControl;
-class WLFloatControl;
-class WLXFloatControl;
-
-class LLWatterSettingsAdapter;
-
-typedef boost::shared_ptr<LLWatterSettingsAdapter> LLWaterSettingsAdapterPtr;
-
-class LLFloaterEditWater : public LLFloater
-{
- LOG_CLASS(LLFloaterEditWater);
-
-public:
- LLFloaterEditWater(const LLSD &key);
-
- /*virtual*/ BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
- /*virtual*/ void onClose(bool app_quitting);
- /*virtual*/ void draw();
-
-private:
- void initCallbacks(void);
-
- //-- WL stuff begins ------------------------------------------------------
-
- void syncControls(); /// sync up sliders with parameters
-
- void onVector3ControlXMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl);
- void onVector3ControlYMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl);
- void onVector3ControlZMoved(LLUICtrl* ctrl, WLVect3Control* vector_ctrl);
-
- void onVector2ControlXMoved(LLUICtrl* ctrl, WLVect2Control* vector_ctrl);
- void onVector2ControlYMoved(LLUICtrl* ctrl, WLVect2Control* vector_ctrl);
-
- void onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* floatControl);
-
- void onExpFloatControlMoved(LLUICtrl* ctrl, WLXFloatControl* expFloatControl);
-
- void onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl);
-
- void onNormalMapPicked(LLUICtrl* ctrl); /// handle if they choose a new normal map
-
- //-- WL stuff ends --------------------------------------------------------
-
- void reset();
- bool isNewPreset() const;
- void refreshWaterPresetsList();
- void enableEditing(bool enable);
- void saveRegionWater();
-
- std::string getSelectedPresetName() const;
-// std::string getCurrentPresetName() const;
-// LLEnvKey::EScope getCurrentScope() const;
-// void getSelectedPreset(std::string& name, LLEnvKey::EScope& scope) const;
-
- void onWaterPresetNameEdited();
- void onWaterPresetSelected();
- bool onSaveAnswer(const LLSD& notification, const LLSD& response);
- void onSaveConfirmed();
-
- void onBtnSave();
- void onBtnCancel();
-
- void onWaterPresetListChange();
- void onRegionSettingsChange();
- void onRegionInfoUpdate();
-
- LLLineEditor* mWaterPresetNameEditor;
- LLComboBox* mWaterPresetCombo;
- LLCheckBoxCtrl* mMakeDefaultCheckBox;
- LLButton* mSaveButton;
-
- LLWaterSettingsAdapterPtr mWaterAdapter;
- LLSettingsWater::ptr_t mEditSettings;
-};
-
-#endif // LL_LLFLOATEREDITWATER_H
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 7e0a3a5fd8..528987f3bf 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -59,8 +59,6 @@
#include "llfloaterdestinations.h"
#include "llfloatereditdaycycle.h"
#include "llfloatereditextdaycycle.h"
-#include "llfloatereditsky.h"
-#include "llfloatereditwater.h"
#include "llfloaterenvironmentsettings.h"
#include "llfloaterexperienceprofile.h"
#include "llfloaterexperiences.h"
@@ -223,8 +221,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>);
LLFloaterReg::add("env_settings", "floater_environment_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvironmentSettings>);
- LLFloaterReg::add("env_edit_sky", "floater_edit_sky_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditSky>);
- LLFloaterReg::add("env_edit_water", "floater_edit_water_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditWater>);
LLFloaterReg::add("env_edit_day_cycle", "floater_edit_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditDayCycle>);
LLFloaterReg::add("env_fixed_environmentent_water", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentWater>);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 6bc28ad284..861ef05dbd 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -8474,6 +8474,7 @@ class LLWorldEnvPreset : public view_listener_t
{
std::string item = userdata.asString();
+// *LAPRAS* These go away! Keep for the moment.
if (item == "new_water")
{
LLFloaterReg::showInstance("env_fixed_environmentent_water", "new");
diff --git a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml
deleted file mode 100644
index c03a206e88..0000000000
--- a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml
+++ /dev/null
@@ -1,980 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater
- legacy_header_height="18"
- height="375"
- layout="topleft"
- name="Edit Sky Preset"
- help_topic="sky_preset"
- save_rect="true"
- title="Edit Sky Preset"
- width="840">
-
- <string name="title_new">Create a New Sky Preset</string>
- <string name="title_edit">Edit Sky Preset</string>
- <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string>
- <string name="hint_edit">To edit your sky preset, adjust the controls and click "Save".</string>
- <string name="combo_label">-Select a preset-</string>
-
- <text
- follows="top|left|right"
- height="10"
- layout="topleft"
- left="30"
- name="hint"
- top="25"
- width="700">
- To edit your preset, adjust the controls then click "Save"
- </text>
- <text
- follows="top|left|right"
- font="SansSerif"
- height="10"
- layout="topleft"
- left="30"
- name="label"
- top_pad="25"
- width="120">
- Preset Name:
- </text>
- <combo_box
- allow_text_entry="true"
- follows="top|left"
- layout="topleft"
- left_pad="10"
- max_chars="100"
- name="sky_preset_combo"
- top_delta="-5"
- width="200"/>
- <line_editor
- height="20"
- left_delta="0"
- name="sky_preset_name"
- top_delta="0"
- width="200" />
- <text
- follows="top|left|right"
- height="40"
- layout="topleft"
- left_pad="10"
- name="note"
- top_delta="0"
- width="405"
- wrap="true">
- Note: if you change the name of your preset, you will be creating a new preset and the existing preset will not be changed.
- </text>
- <!--======== Controls panel ========-->
- <view_border
- bevel_style="none"
- follows="top|left"
- height="203"
- layout="topleft"
- left="25"
- name="panel_water_preset"
- top="122"
- visible="true"
- width="790"/>
- <tab_container
- follows="left|top"
- height="225"
- halign="center"
- layout="topleft"
- left="22"
- name="WindLight Tabs"
- tab_position="top"
- top="101"
- width="794">
- <panel
- border="true"
- bevel_style="none"
- follows="left|top|right|bottom"
- height="196"
- label="ATMOSPHERE"
- layout="topleft"
- left="1"
- help_topic="sky_preset_atmosphere"
- mouse_opaque="false"
- name="Atmosphere"
- top="60"
- width="698">
-
- <!--======== Tab Panel I. I conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left="40"
- name="BHText"
- top="25"
- width="200">
- Blue Horizon
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="0"
- name="WLBlueHorizon"
- top_pad="6"
- width="60" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="0"
- top_pad="20"
- name="BDensText"
- width="200">
- Haze Horizon
- </text>
- <slider
- control_name="WLHazeHorizon"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.25"
- layout="topleft"
- left_delta="0"
- top_pad="6"
- name="WLHazeHorizon"
- width="200" />
-
- <!--======== Tab Panel I. II conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="55"
- name="BDensText2"
- top="25"
- width="200">
- Blue Density
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="0"
- name="WLBlueDensity"
- top_pad="6"
- width="60" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="0"
- name="HDText"
- top_pad="20"
- width="200">
- Haze Density
- </text>
- <slider
- control_name="WLHazeDensity"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.7"
- layout="topleft"
- left_delta="0"
- max_val="4"
- name="WLHazeDensity"
- top_pad="6"
- width="200" />
-
- <!--======== Tab Panel I. III conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="55"
- name="DensMultText"
- top="25"
- width="200">
- Density Multiplier
- </text>
- <slider
- control_name="WLDensityMult"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.1"
- layout="topleft"
- left_delta="15"
- max_val="0.9"
- name="WLDensityMult"
- top_pad="6"
- width="200" />
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="WLDistanceMultText"
- top_pad="20"
- width="200">
- Distance Multiplier
- </text>
- <slider
- control_name="WLDistancMult"
- decimal_digits="1"
- follows="left|top"
- height="10"
- initial_value="1.0"
- layout="topleft"
- left_delta="15"
- max_val="100"
- name="WLDistanceMult"
- top_pad="6"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="MaxAltText"
- top_pad="20"
- width="200">
- Max Altitude
- </text>
- <slider
- control_name="WLMaxAltitude"
- decimal_digits="0"
- follows="left|top"
- height="10"
- increment="1"
- initial_value="500"
- layout="topleft"
- left_delta="15"
- max_val="4000"
- name="WLMaxAltitude"
- top_pad="6"
- width="200" />
- </panel>
- <panel
- border="true"
- bevel_style="none"
- follows="left|top|right|bottom"
- height="196"
- label="LIGHTING"
- layout="topleft"
- left_delta="0"
- help_topic="sky_preset_lighting"
- name="Lighting"
- top_delta="4"
- width="698">
-
- <!--======== Tab Panel II. I conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left="20"
- name="SLCText"
- top="25"
- width="150">
- Sun/Moon Color
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="10"
- name="WLSunlight"
- top_pad="6"
- width="60" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-10"
- name="WLAmbientText"
- top_pad="20"
- width="150">
- Ambient
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="10"
- name="WLAmbient"
- top_pad="6"
- width="60" />
-
- <!--======== Tab Panel II. II conlumn of controls ========-->
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="100"
- name="SunGlowText"
- top="25"
- width="200">
- Sun Glow
- </text>
- <slider
- control_name="WLGlowB"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.1"
- label="Focus "
- layout="topleft"
- left_delta="10"
- max_val="0.5"
- name="WLGlowB"
- top_pad="6"
- width="200" />
- <slider
- control_name="WLGlowR"
- decimal_digits="2"
- follows="top|left"
- height="10"
- increment="0.01"
- initial_value="0.25"
- label="Size "
- layout="topleft"
- left_delta="0"
- max_val="1.99"
- min_val="1"
- name="WLGlowR"
- top_pad="6"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-10"
- name="WLStarText"
- top_pad="20"
- width="200">
- Star Brightness
- </text>
- <slider
- control_name="WLStarAlpha"
- decimal_digits="2"
- follows="top|left"
- height="10"
- increment="0.01"
- initial_value="0"
- layout="topleft"
- left_delta="10"
- max_val="2"
- name="WLStarAlpha"
- top_pad="6"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-10"
- name="SceneGammaText"
- top_pad="20"
- width="200">
- Scene Gamma
- </text>
- <slider
- control_name="WLGamma"
- decimal_digits="2"
- follows="top|left"
- height="10"
- increment="0.01"
- initial_value="2.0"
- layout="topleft"
- left_delta="10"
- max_val="10"
- name="WLGamma"
- top_pad="6"
- width="200" />
-
- <!--======== Tab Panel II. III conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="60"
- name="TODText"
- top="25"
- width="200">
- Sun/Moon Position
- </text>
-
- <joystick_quat
- follows="left|top"
- height="78"
- layout="topleft"
- left_delta="0"
- name="WLSunRotation"
- quadrant="left"
- sound_flags="3"
- visible="true"
- tool_tip="Move sun in sky"
- top="44"
- width="78" /> />
-
- <joystick_quat
- follows="left|top"
- height="78"
- layout="topleft"
- left_delta="96"
- name="WLMoonRotation"
- quadrant="left"
- sound_flags="3"
- visible="true"
- tool_tip="Move moon in sky"
- top="44"
- width="78" /> />
-
- <!-- multi_slider
- can_edit_text="true"
- control_name="WLSunPos"
- decimal_digits="0"
- follows="bottom"
- height="10"
- increment="0.0833333"
- initial_value="0"
- layout="topleft"
- left_delta="0"
- max_sliders="1"
- max_val="24"
- name="WLSunPos"
- show_text="false"
- top_pad="0"
- width="300" />
-
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- font="SansSerif"
- height="14"
- layout="topleft"
- left_delta="2"
- name="WL12amHash"
- top_pad="6"
- width="6">
- |
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- font="SansSerif"
- height="14"
- layout="topleft"
- left_pad="66"
- name="WL6amHash"
- top_delta="0"
- width="6">
- |
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- font="SansSerif"
- height="14"
- layout="topleft"
- left_pad="67"
- name="WL12pmHash2"
- top_delta="0"
- width="6">
- |
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- font="SansSerif"
- height="14"
- layout="topleft"
- left_pad="67"
- name="WL6pmHash"
- top_delta="0"
- width="6">
- |
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- font="SansSerif"
- height="14"
- layout="topleft"
- left_pad="67"
- name="WL12amHash2"
- top_delta="0"
- width="6">
- |
- </text>
-
-
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_delta="-300"
- name="WL12am"
- top="74"
- width="55">
- 12am
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_pad="20"
- name="WL6am"
- top_delta="0"
- width="55">
- 6am
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_pad="15"
- name="WL12pmHash"
- top_delta="0"
- width="55">
- 12pm
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_pad="18"
- name="WL6pm"
- top_delta="0"
- width="55">
- 6pm
- </text>
- <text
- type="string"
- length="1"
- border_visible="true"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_pad="15"
- name="WL12am2"
- top_delta="0"
- width="55">
- 12am
- </text>
-
- <time
- follows="left|top"
- height="16"
- label_width="0"
- layout="topleft"
- left_delta="-175"
- name="WLDayTime"
- top_pad="15"
- value="6:00 AM"
- width="75"/>
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-106"
- name="WLEastAngleText"
- top_pad="24"
- width="200">
- East Angle
- </text>
- <slider
- control_name="WLEastAngle"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.0"
- layout="topleft"
- left_delta="10"
- name="WLEastAngle"
- top_pad="6"
- width="200" / -->
-
- </panel>
- <panel
- border="true"
- bevel_style="none"
- follows="left|top|right|bottom"
- height="196"
- label="CLOUDS"
- layout="topleft"
- left_delta="0"
- mouse_opaque="false"
- help_topic="sky_preset_clouds"
- name="Clouds"
- top_delta="4"
- width="698">
-
- <!--======== Tab Panel III. I conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left="40"
- name="WLCloudColorText"
- top="25"
- width="200">
- Cloud Color
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="0"
- name="WLCloudColor"
- top_pad="6"
- width="60" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="0"
- name="WLCloudColorText2"
- top_pad="20"
- width="200">
- Cloud XY/Density
- </text>
- <slider
- control_name="WLCloudX"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- label="X"
- layout="topleft"
- left_delta="0"
- top_pad="6"
- name="WLCloudX"
- width="200" />
- <slider
- control_name="WLCloudY"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- label="Y"
- layout="topleft"
- left_delta="0"
- top_pad="6"
- name="WLCloudY"
- width="200" />
- <slider
- control_name="WLCloudDensity"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="1.0"
- label="D"
- layout="topleft"
- left_delta="0"
- name="WLCloudDensity"
- top_pad="6"
- width="200" />
-
- <!--======== Tab Panel III. II conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="55"
- name="WLCloudCoverageText"
- top="15"
- width="200">
- Cloud Coverage
- </text>
- <slider
- control_name="WLCloudCoverage"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- layout="topleft"
- left_delta="15"
- name="WLCloudCoverage"
- top_pad="6"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="WLCloudScaleText"
- top_pad="20"
- width="200">
- Cloud Scale
- </text>
- <slider
- control_name="WLCloudScale"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="1.0"
- layout="topleft"
- left_delta="15"
- min_val="0.01"
- name="WLCloudScale"
- top_pad="6"
- width="200" />
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-13"
- name="WLCloudDetailText"
- top_pad="20"
- width="200">
- Cloud Detail (XY/Density)
- </text>
- <slider
- control_name="WLCloudDetailX"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- label="X"
- layout="topleft"
- left_delta="0"
- top_pad="6"
- name="WLCloudDetailX"
- width="200" />
- <slider
- control_name="WLCloudDetailY"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- label="Y"
- layout="topleft"
- left_delta="0"
- name="WLCloudDetailY"
- top_pad="6"
- width="200" />
- <slider
- control_name="WLCloudDetailDensity"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="1.0"
- label="D"
- layout="topleft"
- left_delta="0"
- name="WLCloudDetailDensity"
- top_pad="6"
- width="200" />
-
- <!--======== Tab Panel III. III conlumn of controls ========-->
-
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="55"
- name="WLCloudScrollXText"
- top="15"
- width="150">
- Cloud Scroll X
- </text>
- <check_box
- control_name="WLCloudLockX"
- follows="left|top"
- height="16"
- label="Lock"
- layout="topleft"
- left_delta="150"
- name="WLCloudLockX"
- top_delta="0"
- width="200" />
- <slider
- control_name="WLCloudScrollX"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- layout="topleft"
- left_delta="-135"
- max_val="10"
- min_val="-10"
- name="WLCloudScrollX"
- top_pad="6"
- width="200" />
- <text
- type="string"
- length="1"
- follows="left|top"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="WLCloudScrollYText"
- top_pad="20"
- width="150">
- Cloud Scroll Y
- </text>
- <check_box
- control_name="WLCloudLockY"
- follows="left|top"
- height="16"
- label="Lock"
- layout="topleft"
- left_delta="150"
- name="WLCloudLockY"
- width="200" />
- <slider
- control_name="WLCloudScrollY"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.5"
- layout="topleft"
- left_delta="-135"
- max_val="10"
- min_val="-10"
- name="WLCloudScrollY"
- top_pad="6"
- width="200" />
- </panel>
- </tab_container>
-<!--======== End of Controls panel ========-->
-
- <check_box
- follows="top|left"
- height="10"
- label="Make this preset my new sky setting"
- layout="topleft"
- left="380"
- name="make_default_cb"
- top_pad="30"
- width="280"/>
- <button
- follows="bottom|right"
- height="23"
- label="Save"
- layout="topleft"
- left_pad="0"
- name="save"
- width="70"/>
- <button
- follows="bottom|right"
- height="23"
- label="Cancel"
- layout="topleft"
- left_pad="15"
- name="cancel"
- width="70"/>
- </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml
deleted file mode 100644
index 905983e7fa..0000000000
--- a/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml
+++ /dev/null
@@ -1,448 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<floater
- legacy_header_height="18"
- height="375"
- layout="topleft"
- name="Edit Water Preset"
- help_topic="water_preset"
- save_rect="true"
- title="Edit Water Preset"
- width="725">
-
- <string name="title_new">Create a New Water Preset</string>
- <string name="title_edit">Edit a Water Preset</string>
- <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string>
- <string name="hint_edit">To edit your water preset, adjust the controls and click "Save".</string>
- <string name="combo_label">-Select a preset-</string>
-
- <text
- follows="top|left|right"
- height="10"
- layout="topleft"
- left="30"
- name="hint"
- top="25"
- width="680">
- To edit your preset, adjust the controls then click "Save"
- </text>
-
- <text
- follows="top|left|right"
- font="SansSerif"
- height="10"
- layout="topleft"
- left="30"
- name="label"
- top_pad="25"
- width="120">
- Preset Name:
- </text>
-
- <combo_box
- allow_text_entry="true"
- follows="top|left"
- layout="topleft"
- left_pad="10"
- max_chars="100"
- name="water_preset_combo"
- top_delta="-5"
- width="200"/>
-
- <line_editor
- height="20"
- left_delta="0"
- name="water_preset_name"
- top_delta="0"
- width="200" />
-
- <text
- follows="top|left|right"
- height="40"
- layout="topleft"
- left_pad="10"
- name="note"
- top_delta="0"
- width="340"
- wrap="true">
- Note: if you change the name of your preset, you will be creating a new preset and the existing preset will not be changed.
- </text>
-
- <!--======== Controls panel ========-->
- <panel
- border="false"
- bevel_style="none"
- follows="top|left"
- height="230"
- layout="topleft"
- left="10"
- name="panel_water_preset"
- top="100"
- width="700">
-
-<!--======== I conlumn of controls ========-->
- <text
- follows="left|top|right"
- height="10"
- font="SansSerif"
- layout="topleft"
- left="10"
- name="water_color_label"
- top="5"
- width="215">
- Water Fog Color
- </text>
- <color_swatch
- can_apply_immediately="true"
- follows="left|top"
- height="37"
- label_height="0"
- layout="topleft"
- left_delta="15"
- name="WaterFogColor"
- top_pad="8"
- width="60" />
-
-
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- top_pad="10"
- name="water_fog_density_label"
- width="215">
- Fog Density Exponent
- </text>
- <slider
- decimal_digits="1"
- follows="left|top"
- height="10"
- initial_value="0"
- layout="topleft"
- left_delta="15"
- max_val="10"
- name="WaterFogDensity"
- top_pad="10"
- width="200"/>
-
-
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- top_pad="15"
- name="underwater_fog_modifier_label"
- width="215">
- Underwater Fog Modifier
- </text>
- <slider
- decimal_digits="1"
- follows="left|top"
- height="10"
- initial_value="0"
- layout="topleft"
- left_delta="15"
- max_val="10"
- name="WaterUnderWaterFogMod"
- top_pad="10"
- width="200"/>
-
-
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- name="BHText"
- top_pad="15"
- width="215">
- Big Wave Direction
- </text>
- <slider
- control_name="WaterWave1DirX"
- decimal_digits="2"
- follows="left|top"
- increment="0.01"
- initial_value="0.7"
- label="X"
- layout="topleft"
- max_val="4"
- min_val="-4"
- name="WaterWave1DirX"
- top_pad="10"
- width="216"/>
- <slider
- control_name="WaterWave1DirY"
- decimal_digits="2"
- follows="left|top"
- increment="0.01"
- initial_value="0.7"
- label="Y"
- layout="topleft"
- max_val="4"
- min_val="-4"
- name="WaterWave1DirY"
- top_pad="5"
- width="216"/>
-
-<!--======== II conlumn of controls ========-->
-
- <text
- follows="left|top|right"
- font="SansSerif"
- height="10"
- layout="topleft"
- left_pad="20"
- name="BDensText"
- top="5"
- width="215">
- Reflection Wavelet Scale
- </text>
- <slider
- control_name="WaterNormalScaleX"
- decimal_digits="1"
- follows="left|top"
- initial_value="0.7"
- layout="topleft"
- left_delta="15"
- max_val="10"
- name="WaterNormalScaleX"
- top_pad="10"
- width="200"/>
- <slider
- control_name="WaterNormalScaleY"
- decimal_digits="1"
- follows="left|top"
- initial_value="0.7"
- layout="topleft"
- max_val="10"
- name="WaterNormalScaleY"
- top_pad="6"
- width="200"/>
- <slider
- control_name="WaterNormalScaleZ"
- decimal_digits="1"
- follows="left|top"
- initial_value="0.7"
- layout="topleft"
- max_val="10"
- name="WaterNormalScaleZ"
- top_pad="6"
- width="200"/>
-
-
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- name="HDText"
- top_pad="16"
- width="215">
- Fresnel Scale
- </text>
- <slider
- control_name="WaterFresnelScale"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0.7"
- layout="topleft"
- left_delta="15"
- name="WaterFresnelScale"
- top_pad="10"
- width="200"/>
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- name="FresnelOffsetText"
- top_pad="15"
- width="215">
- Fresnel Offset
- </text>
- <slider
- control_name="WaterFresnelOffset"
- decimal_digits="2"
- follows="left"
- increment="0.01"
- initial_value="0.7"
- layout="topleft"
- left_delta="15"
- name="WaterFresnelOffset"
- top_pad="10"
- width="200"/>
-
-
- <text
- follows="left|top|right"
- font="SansSerif"
- layout="topleft"
- left_delta="-15"
- name="BHText2"
- top_pad="15"
- width="215">
- Little Wave Direction
- </text>
- <slider
- control_name="WaterWave2DirX"
- decimal_digits="2"
- follows="left|top"
- increment="0.01"
- initial_value="0.7"
- label="X"
- layout="topleft"
- max_val="4"
- min_val="-4"
- name="WaterWave2DirX"
- top_pad="10"
- width="216" />
- <slider
- control_name="WaterWave2DirY"
- decimal_digits="2"
- follows="left|top"
- increment="0.01"
- initial_value="0.7"
- label="Y"
- layout="topleft"
- max_val="4"
- min_val="-4"
- name="WaterWave2DirY"
- top_pad="6"
- width="216" />
-
-<!--======== III conlumn of contorls ========-->
-
- <text
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_pad="20"
- name="DensMultText"
- top="5"
- width="215">
- Refract Scale Above
- </text>
- <slider
- control_name="WaterScaleAbove"
- decimal_digits="2"
- follows="left|top"
- increment="0.01"
- initial_value="0.1"
- layout="topleft"
- left_delta="15"
- name="WaterScaleAbove"
- top_pad="5"
- width="200" />
-
- <text
- type="string"
- length="1"
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="WaterScaleBelowText"
- top_pad="15"
- width="215">
- Refract Scale Below
- </text>
- <slider
- control_name="WaterScaleBelow"
- decimal_digits="2"
- follows="left|top"
- height="10"
- increment="0.01"
- initial_value="0"
- layout="topleft"
- left_delta="15"
- name="WaterScaleBelow"
- top_pad="5"
- width="200"/>
-
- <text
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="MaxAltText"
- top_pad="15"
- width="215">
- Blur Multiplier
- </text>
- <slider
- control_name="WaterBlurMult"
- follows="left|top"
- height="10"
- increment="0.001"
- initial_value="0"
- layout="topleft"
- left_delta="15"
- max_val="0.16"
- name="WaterBlurMult"
- top_pad="5"
- width="200"/>
-
- <text
- follows="left|top|right"
- font="SansSerif"
- height="16"
- layout="topleft"
- left_delta="-15"
- name="BHText3"
- top_pad="15"
- width="215">
- Normal Map
- </text>
- <texture_picker
- height="80"
- layout="topleft"
- left_delta="15"
- name="WaterNormalMap"
- top_pad="5"
- width="100" />
- </panel>
-<!--======== End of Controls panel ========-->
-
- <view_border
- bevel_style="none"
- follows="top|left"
- height="0"
- layout="topleft"
- left="10"
- name="horiz_separator"
- top_pad="5"
- width="700"/>
- <check_box
- follows="top|left"
- height="10"
- label="Make this preset my new water setting"
- layout="topleft"
- left="275"
- name="make_default_cb"
- top_pad="20"
- width="280"/>
- <button
- follows="bottom|right"
- height="23"
- label="Save"
- layout="topleft"
- left_pad="0"
- name="save"
- width="70"/>
- <button
- follows="bottom|right"
- height="23"
- label="Cancel"
- layout="topleft"
- left_pad="15"
- name="cancel"
- width="70"/>
-
- </floater>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 458e127d41..730661c55b 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -713,6 +713,8 @@
</menu_item_call>
<menu_item_separator/>
+
+ <!-- *LAPRAS* These menus go away. Keep till no longer needed -->
<menu
name="Water Presets"
@@ -732,7 +734,7 @@
parameter="edit_water"/>
</menu_item_call>
</menu>
-
+
<menu
name="Sky Presets"
label="Sky Presets">
@@ -770,6 +772,7 @@
parameter="edit_day_cycle"/>
</menu_item_call>
</menu>
+ <!-- *LAPRAS* -->
</menu>