summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-15 22:37:44 +0100
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-15 22:37:44 +0100
commitddd0094e22b53c91d2a2e25ea62a535763237238 (patch)
treec7ed920f490c701c9e1a8baacf91046515deeb51 /indra
parent23d2a97cda93d73ae1f5cae300b0e7534868f455 (diff)
parent885853b41775296d536f9bcb3614264109430c2b (diff)
Merge
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp49
-rw-r--r--indra/llinventory/llsettingsdaycycle.h3
-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/llfloatereditextdaycycle.cpp262
-rw-r--r--indra/newview/llfloatereditextdaycycle.h38
-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/llfloaterfixedenvironment.cpp165
-rw-r--r--indra/newview/llfloaterfixedenvironment.h27
-rw-r--r--indra/newview/llinventorybridge.cpp43
-rw-r--r--indra/newview/llsettingsvo.cpp163
-rw-r--r--indra/newview/llsettingsvo.h27
-rw-r--r--indra/newview/llviewerfloaterreg.cpp4
-rw-r--r--indra/newview/llviewerinventory.cpp13
-rw-r--r--indra/newview/llviewerinventory.h3
-rw-r--r--indra/newview/llviewermenu.cpp1
-rw-r--r--indra/newview/llviewerwindow.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml476
-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
25 files changed, 999 insertions, 3770 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 70826d1410..3f60430715 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -483,7 +483,7 @@ void LLSettingsDay::updateSettings()
//=========================================================================
LLSettingsDay::KeyframeList_t LLSettingsDay::getTrackKeyframes(S32 trackno)
{
- if ((trackno < 1) || (trackno >= TRACK_MAX))
+ if ((trackno < 0) || (trackno >= TRACK_MAX))
{
LL_WARNS("DAYCYCLE") << "Attempt get track (#" << trackno << ") out of range!" << LL_ENDL;
return KeyframeList_t();
@@ -508,6 +508,17 @@ void LLSettingsDay::setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 ke
setDirtyFlag(true);
}
+const LLSettingsWaterPtr_t LLSettingsDay::getWaterAtKeyframe(F32 keyframe)
+{
+ // todo: better way to identify keyframes?
+ CycleTrack_t::iterator iter = mDayTracks[TRACK_WATER].find(keyframe);
+ if (iter != mDayTracks[TRACK_WATER].end())
+ {
+ return std::dynamic_pointer_cast<LLSettingsWater>(iter->second);
+ }
+
+ return LLSettingsWaterPtr_t(NULL);
+}
void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track)
{
@@ -521,6 +532,42 @@ void LLSettingsDay::setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe
setDirtyFlag(true);
}
+const LLSettingsSkyPtr_t LLSettingsDay::getSkyAtKeyframe(F32 keyframe, S32 track)
+{
+ if ((track < 1) || (track >= TRACK_MAX))
+ {
+ LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL;
+ return LLSettingsSkyPtr_t(NULL);
+ }
+
+ // todo: better way to identify keyframes?
+ CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe);
+ if (iter != mDayTracks[track].end())
+ {
+ return std::dynamic_pointer_cast<LLSettingsSky>(iter->second);
+ }
+
+ return LLSettingsSkyPtr_t(NULL);
+}
+
+const LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(F32 keyframe, S32 track)
+{
+ if ((track < 0) || (track >= TRACK_MAX))
+ {
+ LL_WARNS("DAYCYCLE") << "Attempt to set sky track (#" << track << ") out of range!" << LL_ENDL;
+ return LLSettingsBase::ptr_t(NULL);
+ }
+
+ // todo: better way to identify keyframes?
+ CycleTrack_t::iterator iter = mDayTracks[track].find(keyframe);
+ if (iter != mDayTracks[track].end())
+ {
+ return iter->second;
+ }
+
+ return LLSettingsSkyPtr_t(NULL);
+}
+
LLSettingsDay::TrackBound_t LLSettingsDay::getBoundingEntries(LLSettingsDay::CycleTrack_t &track, F32 keyframe)
{
return TrackBound_t(get_wrapping_atbefore(track, keyframe), get_wrapping_atafter(track, keyframe));
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index da572572c4..93c275bfb8 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -88,7 +88,10 @@ public:
KeyframeList_t getTrackKeyframes(S32 track);
void setWaterAtKeyframe(const LLSettingsWaterPtr_t &water, F32 keyframe);
+ const LLSettingsWaterPtr_t getWaterAtKeyframe(F32 keyframe);
void setSkyAtKeyframe(const LLSettingsSkyPtr_t &sky, F32 keyframe, S32 track);
+ const LLSettingsSkyPtr_t getSkyAtKeyframe(F32 keyframe, S32 track);
+ const LLSettingsBase::ptr_t getSettingsAtKeyframe(F32 keyframe, S32 track);
//---------------------------------------------------------------------
void startDayCycle();
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/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index c1063218fb..e41259feb3 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -45,16 +45,26 @@
#include "llagent.h"
#include "llregioninfomodel.h"
#include "llviewerregion.h"
+#include "llpaneleditwater.h"
+#include "llpaneleditsky.h"
#include "llenvironment.h"
#include "lltrans.h"
+static const std::string track_tabs[] = {
+ "water_track",
+ "sky4_track",
+ "sky3_track",
+ "sky2_track",
+ "sky1_track",
+ };
+
LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key):
LLFloater(key),
- mDayPresetsCombo(NULL),
mSaveButton(NULL),
- mCancelButton(NULL)
+ mCancelButton(NULL),
+ mCurrentTrack(1)
// mDayCyclesCombo(NULL)
// , mTimeSlider(NULL)
// , mKeysSlider(NULL)
@@ -62,32 +72,37 @@ LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key):
// , mMakeDefaultCheckBox(NULL)
// ,
{
+ mCommitCallbackRegistrar.add("DayCycle.Track", boost::bind(&LLFloaterEditExtDayCycle::onTrackSelectionCallback, this, _2));
}
// virtual
BOOL LLFloaterEditExtDayCycle::postBuild()
{
+ getChild<LLButton>("add_frame")->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onAddTrack, this));
+ getChild<LLButton>("delete_frame")->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onRemoveTrack, this));
+ getChild<LLLineEditor>("day_cycle_name")->setKeystrokeCallback(boost::bind(&LLFloaterEditExtDayCycle::onCommitName, this, _1, _2), NULL);
+
// mDayCyclesCombo = getChild<LLComboBox>("day_cycle_preset_combo");
// mTimeSlider = getChild<LLMultiSliderCtrl>("WLTimeSlider");
// mKeysSlider = getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
- mDayPresetsCombo = getChild<LLComboBox>("day_cycle_preset_combo");
// mTimeCtrl = getChild<LLTimeCtrl>("time");
- mSaveButton = getChild<LLButton>("save_btn");
- mCancelButton = getChild<LLButton>("cancel_btn");
- mUploadButton = getChild<LLButton>("upload_btn");
+ mSaveButton = getChild<LLButton>("save_btn", true);
+ mCancelButton = getChild<LLButton>("cancel_btn", true);
+ mUploadButton = getChild<LLButton>("upload_btn", true);
+ mKeysSlider = getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
+ mSkyTabContainer = getChild<LLView>("frame_settings_sky", true);
+ mWaterTabContainer = getChild<LLView>("frame_settings_water", true);
// mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");
+ //initCallbacks();
- mDayPresetsCombo->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onDayPresetChanged, this));
mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onBtnSave, this));
mCancelButton->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onBtnCancel, this));
mUploadButton->setCommitCallback(boost::bind(&LLFloaterEditExtDayCycle::onUpload, this));
- //initCallbacks();
-// // add the time slider
-// mTimeSlider->addSlider();
+ getChild<LLButton>("sky4_track", true)->setToggleState(true);
return TRUE;
}
@@ -97,7 +112,52 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT);
LLEnvironment::instance().updateEnvironment();
- refreshSkyPresetsList();
+
+ {
+ // TODO/TEMP
+ LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION);
+ mEditDay = pday->buildClone(); // pday should be passed as parameter
+ }
+
+ LLLineEditor* name_field = getChild<LLLineEditor>("day_cycle_name");
+ name_field->setText(mEditDay->getName());
+
+ selectTrack(mCurrentTrack);
+
+ /* TODO
+ if (mEditDay->hasSetting("cycle length")) // todo: figure out name
+ {
+ // extract setting
+ S32 extracted_time =
+ std::string time = LLTrans::getString("time_label", LLSD("TIME",(extracted_time * 0..100%) + offset));
+ std::string descr = LLTrans::getString("0_label", LLSD("DSC",time));
+ getChild<LLView>("p0")->setLabel(descr);
+ ...
+
+ getChild<LLView>("p1")->setLabel(descr);
+ time =
+ descr =
+ getChild<LLView>("p2")->setLabel(descr);
+ time =
+ descr =
+ getChild<LLView>("p3")->setLabel(descr);
+ time =
+ descr =
+ getChild<LLView>("p4")->setLabel(descr);
+ }
+ else
+ {
+ std::string descr = LLTrans::getString("0_label", LLSD());
+ getChild<LLView>("p0")->setLabel(descr);
+
+ }
+ */
+
+
+ /*list_name_id_t getSkyList() const;
+ list_name_id_t getWaterList() const;
+
+ getChild<LLButton>("sky4_track", true)->setToggleState(true);*/
}
void LLFloaterEditExtDayCycle::onClose(bool app_quitting)
@@ -183,54 +243,146 @@ void LLFloaterEditExtDayCycle::onVisibilityChange(BOOL new_visibility)
}
}
-//-------------------------------------------------------------------------
-void LLFloaterEditExtDayCycle::onDayPresetChanged()
+void LLFloaterEditExtDayCycle::onBtnSave()
{
- std::string dayname = mDayPresetsCombo->getSelectedValue().asString();
+ if (!mCommitSignal.empty())
+ mCommitSignal(mEditDay);
+ closeFloater();
+}
- LLSettingsDay::ptr_t pday = LLEnvironment::instance().findDayCycleByName(dayname);
+void LLFloaterEditExtDayCycle::onBtnCancel()
+{
+ closeFloater();
+}
- if (pday)
+void LLFloaterEditExtDayCycle::onAddTrack()
+{
+ F32 frame = 0; // temp?
+ mKeysSlider->addSlider(frame);
+ if (mCurrentTrack == 0)
{
- pday = pday->buildClone();
- LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, pday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET);
- mEditDay = pday;
+ mEditDay->setWaterAtKeyframe(LLSettingsVOWater::buildDefaultWater(), frame);
}
+ else
+ {
+ mEditDay->setSkyAtKeyframe(LLSettingsVOSky::buildDefaultSky(), frame, mCurrentTrack);
+ }
+}
+void LLFloaterEditExtDayCycle::onRemoveTrack()
+{
+ //mKeysSlider->deleteCurSlider();
}
-void LLFloaterEditExtDayCycle::onBtnSave()
+void LLFloaterEditExtDayCycle::onCommitName(class LLLineEditor* caller, void* user_data)
{
- if (!mCommitSignal.empty())
- mCommitSignal(mEditDay);
- closeFloater();
+ mEditDay->setName(caller->getText());
}
-void LLFloaterEditExtDayCycle::onBtnCancel()
+void LLFloaterEditExtDayCycle::onTrackSelectionCallback(const LLSD& user_data)
{
- closeFloater();
+ U32 track_index = user_data.asInteger(); // 1-5
+ selectTrack(track_index);
}
+void LLFloaterEditExtDayCycle::selectTrack(U32 track_index)
+{
+ mCurrentTrack = track_index;
+ LLButton* button = getChild<LLButton>(track_tabs[track_index], true);
+ if (button->getToggleState())
+ {
+ return;
+ }
-//-------------------------------------------------------------------------
-void LLFloaterEditExtDayCycle::refreshSkyPresetsList()
+ for (int i = 0; i < 5; i++)
+ {
+ getChild<LLButton>(track_tabs[i], true)->setToggleState(false);
+ }
+
+ button->setToggleState(true);
+
+ updateTabs();
+ updateSlider();
+}
+
+void LLFloaterEditExtDayCycle::updateTabs()
{
- mDayPresetsCombo->removeall();
+ bool show_water = mCurrentTrack == 0;
+ mSkyTabContainer->setVisible(!show_water);
+ mWaterTabContainer->setVisible(show_water);
- LLEnvironment::list_name_id_t cyclelist = LLEnvironment::instance().getDayCycleList();
+ if (show_water)
+ {
+ updateWaterTabs();
+ }
+ else
+ {
+ updateSkyTabs();
+ }
+}
- mDayPresetsCombo->removeall();
+void LLFloaterEditExtDayCycle::updateWaterTabs()
+{
+ const LLSettingsWaterPtr_t p_water = mEditDay->getWaterAtKeyframe(mKeysSlider->getCurSliderValue());
+ // Compiler warnings from getChild about LLPanelSettingsWaterMainTab not being complete/missing params constructor...
+ // Todo: fix class to work with getChild()
+ LLPanelSettingsWaterMainTab* panel = mWaterTabContainer->findChild<LLPanelSettingsWaterMainTab>("water_panel", true);
+ if (panel)
+ {
+ panel->setWater(p_water); // todo: Null disables
+ }
+}
- for (LLEnvironment::list_name_id_t::iterator it = cyclelist.begin(); it != cyclelist.end(); ++it)
+void LLFloaterEditExtDayCycle::updateSkyTabs()
+{
+ const LLSettingsSkyPtr_t p_sky = mEditDay->getSkyAtKeyframe(mKeysSlider->getCurSliderValue(), mCurrentTrack);
+
+ // Compiler warnings from getChild about tabs...
+ // Todo: fix class
+ LLPanelSettingsSky* panel;
+ panel = mSkyTabContainer->findChild<LLPanelSettingsSky>("atmosphere_panel", true);
+ if (panel)
{
- mDayPresetsCombo->add((*it).first);
+ panel->setSky(p_sky); // todo: Null disables
}
+ panel = mSkyTabContainer->findChild<LLPanelSettingsSky>("clouds_panel", true);
+ if (panel)
+ {
+ panel->setSky(p_sky);
+ }
+ panel = mSkyTabContainer->findChild<LLPanelSettingsSky>("moon_panel", true);
+ if (panel)
+ {
+ panel->setSky(p_sky);
+ }
+}
+
+void LLFloaterEditExtDayCycle::updateSlider()
+{
+ mKeysSlider->clear();
- // set defaults on combo boxes
- mDayPresetsCombo->selectFirstItem();
+ LLSettingsDay::KeyframeList_t keyframes = mEditDay->getTrackKeyframes(mCurrentTrack);
+ LLSettingsDay::KeyframeList_t::iterator iter = keyframes.begin();
+ LLSettingsDay::KeyframeList_t::iterator end = keyframes.end();
+
+ while (iter != end)
+ {
+ mKeysSlider->addSlider(*iter);
+ iter++;
+ }
}
+/*void LLFloaterEditExtDayCycle::updateTrack()
+{
+ LLMultiSliderCtrl* slider = getChild<LLMultiSliderCtrl>("WLDayCycleKeys");
+ //mEditDay->getTrackKeyframes
+
+ // todo make tracks named to allow movement
+}*/
+
+//-------------------------------------------------------------------------
+
LLFloaterEditExtDayCycle::connection_t LLFloaterEditExtDayCycle::setEditCommitSignal(LLFloaterEditExtDayCycle::edit_commit_signal_t::slot_type cb)
{
return mCommitSignal.connect(cb);
@@ -503,28 +655,26 @@ LLFloaterEditExtDayCycle::connection_t LLFloaterEditExtDayCycle::setEditCommitSi
// #endif
// }
//
-// #if 0
-// void LLFloaterEditExtDayCycle::addSliderKey(F32 time, LLWLParamKey keyframe)
-// {
-// // make a slider
-// const std::string& sldr_name = mKeysSlider->addSlider(time);
-// if (sldr_name.empty())
-// {
-// return;
-// }
-//
-// // set the key
-// SliderKey newKey(keyframe, mKeysSlider->getCurSliderValue());
-//
-// llassert_always(sldr_name != LLStringUtil::null);
-//
-// // add to map
-// mSliderToKey.insert(std::pair<std::string, SliderKey>(sldr_name, newKey));
-//
-// llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size());
-// }
-// #endif
-//
+void LLFloaterEditExtDayCycle::addSliderKey(F32 time, const std::shared_ptr<LLSettingsBase> keyframe)
+{
+ // make a slider
+ const std::string& sldr_name = mKeysSlider->addSlider(time);
+ if (sldr_name.empty())
+ {
+ return;
+ }
+
+ // set the key
+ SliderKey newKey(keyframe, mKeysSlider->getCurSliderValue());
+
+ llassert_always(sldr_name != LLStringUtil::null);
+
+ // add to map
+ mSliderToKey.insert(std::pair<std::string, SliderKey>(sldr_name, newKey));
+
+ llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size());
+}
+
// #if 0
// LLWLParamKey LLFloaterEditExtDayCycle::getSelectedDayCycle()
// {
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index 18d0ce2259..a9004087c9 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -37,6 +37,18 @@ class LLLineEditor;
class LLMultiSliderCtrl;
class LLTimeCtrl;
+typedef std::shared_ptr<LLSettingsBase> LLSettingsBasePtr_t;
+
+class SliderKey
+{
+public:
+ SliderKey(LLSettingsBasePtr_t kf, F32 t) : keyframe(kf), time(t) {}
+
+ LLSettingsBasePtr_t keyframe;
+ F32 time;
+};
+
+
/**
* Floater for creating or editing a day cycle.
*/
@@ -75,18 +87,26 @@ private:
// void applyTrack();
//
// /// refresh the sky presets combobox
- void refreshSkyPresetsList();
- void onDayPresetChanged(); /// sky preset selected
+ void onBtnSave();
+ void onBtnCancel();
+ void onAddTrack();
+ void onRemoveTrack();
+ void onCommitName(class LLLineEditor* caller, void* user_data);
+ void onTrackSelectionCallback(const LLSD& user_data);
- void onBtnSave();
- void onBtnCancel();
+ void selectTrack(U32 track_index);
+ void updateTabs();
+ void updateSkyTabs();
+ void updateWaterTabs();
+ void updateSlider(); //track->slider
+ //void updateTrack(); // slider->track, todo: better name
// /// refresh the day cycle combobox
// void refreshDayCyclesList();
//
// /// add a slider to the track
-// // void addSliderKey(F32 time, LLWLParamKey keyframe);
+ void addSliderKey(F32 time, const LLSettingsBasePtr_t key);
//
// void initCallbacks();
// // LLWLParamKey getSelectedDayCycle();
@@ -123,8 +143,8 @@ private:
LLSettingsDay::ptr_t mSavedDay;
LLSettingsDay::ptr_t mEditDay;
+ U32 mCurrentTrack;
- LLComboBox* mDayPresetsCombo;
LLButton* mSaveButton;
LLButton* mCancelButton;
LLButton* mUploadButton;
@@ -133,12 +153,14 @@ private:
// LLComboBox* mDayCyclesCombo;
// LLMultiSliderCtrl* mTimeSlider;
-// LLMultiSliderCtrl* mKeysSlider;
+ LLMultiSliderCtrl* mKeysSlider;
+ LLView* mSkyTabContainer;
+ LLView* mWaterTabContainer;
// LLTimeCtrl* mTimeCtrl;
// LLCheckBoxCtrl* mMakeDefaultCheckBox;
// map of sliders to parameters
-// std::map<std::string, SliderKey> mSliderToKey;
+ std::map<std::string, SliderKey> mSliderToKey;
};
#endif // LL_LLFloaterEditExtDayCycle_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/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index f95e41408f..f03c8ba7d1 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -38,6 +38,8 @@
#include "lltabcontainer.h"
#include "llfilepicker.h"
+#include "llviewerparcelmgr.h"
+
// newview
#include "llpaneleditwater.h"
#include "llpaneleditsky.h"
@@ -47,8 +49,10 @@
#include "llenvironment.h"
#include "llagent.h"
+#include "llparcel.h"
#include "llsettingsvo.h"
+#include "llinventorymodel.h"
namespace
{
@@ -56,21 +60,30 @@ namespace
const std::string CONTROL_TAB_AREA("tab_settings");
- const std::string BUTTON_NAME_LOAD("btn_load");
const std::string BUTTON_NAME_IMPORT("btn_import");
const std::string BUTTON_NAME_COMMIT("btn_commit");
const std::string BUTTON_NAME_CANCEL("btn_cancel");
+ const std::string BUTTON_NAME_FLYOUT("btn_flyout");
const std::string ACTION_SAVE("save_settings");
const std::string ACTION_SAVEAS("save_as_new_settings");
const std::string ACTION_APPLY_LOCAL("apply_local");
const std::string ACTION_APPLY_PARCEL("apply_parcel");
const std::string ACTION_APPLY_REGION("apply_region");
+
+ const std::string XML_FLYOUTMENU_FILE("menu_save_settings.xml");
}
+//=========================================================================
+const std::string LLFloaterFixedEnvironment::KEY_INVENTORY_ID("inventory_id");
+
+
+//=========================================================================
LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) :
LLFloater(key),
- mFlyoutControl(nullptr)
+ mFlyoutControl(nullptr),
+ mInventoryId(),
+ mInventoryItem(nullptr)
{
}
@@ -87,16 +100,40 @@ BOOL LLFloaterFixedEnvironment::postBuild()
mTxtName->setCommitOnFocusLost(TRUE);
mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); });
- getChild<LLButton>(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); });
getChild<LLButton>(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); });
getChild<LLButton>(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); });
- mFlyoutControl = new LLFlyoutComboBtn(this, "btn_commit", "btn_flyout", "menu_save_settings.xml");
+ mFlyoutControl = new LLFlyoutComboBtn(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
return TRUE;
}
+void LLFloaterFixedEnvironment::onOpen(const LLSD& key)
+{
+ LLUUID invid;
+
+ if (key.has(KEY_INVENTORY_ID))
+ {
+ invid = key[KEY_INVENTORY_ID].asUUID();
+ }
+
+ loadInventoryItem(invid);
+ LL_INFOS("SETTINGS") << "Setting edit inventory item to " << mInventoryId << "." << LL_ENDL;
+
+ updateEditEnvironment();
+ syncronizeTabs();
+ refresh();
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+
+}
+
+void LLFloaterFixedEnvironment::onClose(bool app_quitting)
+{
+ mSettings.reset();
+ syncronizeTabs();
+}
+
void LLFloaterFixedEnvironment::onFocusReceived()
{
updateEditEnvironment();
@@ -119,12 +156,10 @@ void LLFloaterFixedEnvironment::refresh()
return;
}
- bool enableApplyAndLoad = canUseInventory();
+ bool is_inventory_avail = canUseInventory();
- mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, enableApplyAndLoad);
- mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, enableApplyAndLoad);
-
- getChild<LLButton>(BUTTON_NAME_LOAD)->setEnabled(enableApplyAndLoad);
+ mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail);
+ mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail);
mTxtName->setValue(mSettings->getName());
@@ -150,14 +185,42 @@ void LLFloaterFixedEnvironment::syncronizeTabs()
}
}
-void LLFloaterFixedEnvironment::onNameChanged(const std::string &name)
+void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId)
{
- mSettings->setName(name);
+ if (inventoryId.isNull())
+ {
+ mInventoryItem = nullptr;
+ mInventoryId.setNull();
+ return;
+ }
+
+ mInventoryId = inventoryId;
+ LL_INFOS("SETTINGS") << "Setting edit inventory item to " << mInventoryId << "." << LL_ENDL;
+ mInventoryItem = gInventory.getItem(mInventoryId);
+
+ if (!mInventoryItem)
+ {
+ LL_WARNS("SETTINGS") << "Could not find inventory item with Id = " << mInventoryId << LL_ENDL;
+ mInventoryId.setNull();
+ mInventoryItem = nullptr;
+ return;
+ }
+
+ LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(),
+ [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); });
}
-void LLFloaterFixedEnvironment::onButtonLoad()
+void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status)
{
- doLoadFromInventory();
+ mSettings = settins;
+ updateEditEnvironment();
+ syncronizeTabs();
+ refresh();
+}
+
+void LLFloaterFixedEnvironment::onNameChanged(const std::string &name)
+{
+ mSettings->setName(name);
}
void LLFloaterFixedEnvironment::onButtonImport()
@@ -171,11 +234,11 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
if (ctrl_action == ACTION_SAVE)
{
- doApplyCreateNewInventory();
+ doApplyUpdateInventory();
}
else if (ctrl_action == ACTION_SAVEAS)
{
- doApplyUpdateInventory();
+ doApplyCreateNewInventory();
}
else if ((ctrl_action == ACTION_APPLY_LOCAL) ||
(ctrl_action == ACTION_APPLY_PARCEL) ||
@@ -198,12 +261,15 @@ void LLFloaterFixedEnvironment::onButtonCancel()
void LLFloaterFixedEnvironment::doApplyCreateNewInventory()
{
// This method knows what sort of settings object to create.
- LLSettingsVOBase::createInventoryItem(mSettings);
+ LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
}
void LLFloaterFixedEnvironment::doApplyUpdateInventory()
{
- // todo update existing inventory object.
+ if (mInventoryId.isNull())
+ LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); });
+ else
+ LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); });
}
void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
@@ -230,20 +296,50 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
}
}
+void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
+{
+ LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL;
+
+ setFocus(TRUE); // Call back the focus...
+ loadInventoryItem(inventory_id);
+}
+
+void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
+{
+ LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been updated with asset " << asset_id << " results are:" << results << LL_ENDL;
+
+ if (inventory_id != mInventoryId)
+ {
+ loadInventoryItem(inventory_id);
+ }
+}
+
//-------------------------------------------------------------------------
bool LLFloaterFixedEnvironment::canUseInventory() const
{
- return !gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty();
+ return LLEnvironment::instance().isInventoryEnabled();
}
bool LLFloaterFixedEnvironment::canApplyRegion() const
{
- return true;
+ return gAgent.canManageEstate();
}
bool LLFloaterFixedEnvironment::canApplyParcel() const
{
- return false;
+ LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection());
+ LLParcel *parcel(nullptr);
+
+ if (handle)
+ parcel = handle->getParcel();
+ if (!parcel)
+ parcel = LLViewerParcelMgr::instance().getAgentParcel();
+
+ if (!parcel)
+ return false;
+
+ return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
+ LLEnvironment::instance().isExtendedEnvironmentEnabled();
}
//=========================================================================
@@ -282,21 +378,12 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key)
// TODO: Should we grab sky and keep it around for reference?
}
- updateEditEnvironment();
- syncronizeTabs();
- refresh();
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
+ LLFloaterFixedEnvironment::onOpen(key);
}
void LLFloaterFixedEnvironmentWater::onClose(bool app_quitting)
{
- mSettings.reset();
- syncronizeTabs();
-}
-
-void LLFloaterFixedEnvironmentWater::doLoadFromInventory()
-{
-
+ LLFloaterFixedEnvironment::onClose(app_quitting);
}
void LLFloaterFixedEnvironmentWater::doImportFromDisk()
@@ -364,24 +451,16 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key)
mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone();
mSettings->setName("Snapshot sky (new)");
- // TODO: Should we grab sky and keep it around for reference?
+ // TODO: Should we grab water and keep it around for reference?
}
- updateEditEnvironment();
- syncronizeTabs();
- refresh();
- LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);
-}
+ LLFloaterFixedEnvironment::onOpen(key);
-void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting)
-{
- mSettings.reset();
- syncronizeTabs();
}
-void LLFloaterFixedEnvironmentSky::doLoadFromInventory()
+void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting)
{
-
+ LLFloaterFixedEnvironment::onClose(app_quitting);
}
void LLFloaterFixedEnvironmentSky::doImportFromDisk()
diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h
index 22ce167244..782dc9e61c 100644
--- a/indra/newview/llfloaterfixedenvironment.h
+++ b/indra/newview/llfloaterfixedenvironment.h
@@ -30,6 +30,7 @@
#include "llfloater.h"
#include "llsettingsbase.h"
#include "llflyoutcombobtn.h"
+#include "llinventory.h"
class LLTabContainer;
class LLButton;
@@ -43,29 +44,33 @@ class LLFloaterFixedEnvironment : public LLFloater
LOG_CLASS(LLFloaterFixedEnvironment);
public:
+ static const std::string KEY_INVENTORY_ID;
+
LLFloaterFixedEnvironment(const LLSD &key);
~LLFloaterFixedEnvironment();
- virtual BOOL postBuild() override;
+ virtual BOOL postBuild() override;
+ virtual void onOpen(const LLSD& key) override;
+ virtual void onClose(bool app_quitting) override;
- virtual void onFocusReceived() override;
- virtual void onFocusLost() override;
+ virtual void onFocusReceived() override;
+ virtual void onFocusLost() override;
void setEditSettings(const LLSettingsBase::ptr_t &settings) { mSettings = settings; syncronizeTabs(); refresh(); }
LLSettingsBase::ptr_t getEditSettings() const { return mSettings; }
protected:
virtual void updateEditEnvironment() = 0;
- virtual void refresh() override;
-
+ virtual void refresh() override;
virtual void syncronizeTabs();
+ void loadInventoryItem(const LLUUID &inventoryId);
+
LLTabContainer * mTab;
LLLineEditor * mTxtName;
LLSettingsBase::ptr_t mSettings;
- virtual void doLoadFromInventory() = 0;
virtual void doImportFromDisk() = 0;
virtual void doApplyCreateNewInventory();
virtual void doApplyUpdateInventory();
@@ -77,14 +82,20 @@ protected:
LLFlyoutComboBtn * mFlyoutControl;
+ LLUUID mInventoryId;
+ LLInventoryItem * mInventoryItem;
+
+ void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
+ void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
+
private:
void onNameChanged(const std::string &name);
- void onButtonLoad();
void onButtonImport();
void onButtonApply(LLUICtrl *ctrl, const LLSD &data);
void onButtonCancel();
+ void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status);
};
class LLFloaterFixedEnvironmentWater : public LLFloaterFixedEnvironment
@@ -102,7 +113,6 @@ public:
protected:
virtual void updateEditEnvironment() override;
- virtual void doLoadFromInventory() override;
virtual void doImportFromDisk() override;
private:
@@ -123,7 +133,6 @@ public:
protected:
virtual void updateEditEnvironment() override;
- virtual void doLoadFromInventory() override;
virtual void doImportFromDisk() override;
private:
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9311861d83..7697714f2f 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -6910,7 +6910,11 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
void LLSettingsBridge::openItem()
{
- LLItemBridge::openItem();
+ LLViewerInventoryItem* item = getItem();
+ if (item)
+ {
+ LLInvFVBridgeAction::doAction(item->getType(), mUUID, getInventoryModel());
+ }
}
void LLSettingsBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
@@ -7271,6 +7275,40 @@ void LLWearableBridgeAction::wearOnAvatar()
}
}
+class LLSettingsBridgeAction
+ : public LLInvFVBridgeAction
+{
+ friend class LLInvFVBridgeAction;
+public:
+ virtual void doIt()
+ {
+ LLViewerInventoryItem* item = getItem();
+ if (item)
+ {
+ LLSettingsType::type_e type = item->getSettingsType();
+ switch (type)
+ {
+ case LLSettingsType::ST_SKY:
+ LLFloaterReg::showInstance("env_fixed_environmentent_sky", LLSDMap("inventory_id", item->getUUID()), TAKE_FOCUS_YES);
+ break;
+ case LLSettingsType::ST_WATER:
+ LLFloaterReg::showInstance("env_fixed_environmentent_water", LLSDMap("inventory_id", item->getUUID()), TAKE_FOCUS_YES);
+ break;
+ case LLSettingsType::ST_DAYCYCLE:
+ //LLFloaterReg::showInstance("env_fixed_environmentent_day", LLSDMap("inventory_id", item->getUUID()), TAKE_FOCUS_YES);
+ break;
+ default:
+ break;
+ }
+ }
+ LLInvFVBridgeAction::doIt();
+ }
+ virtual ~LLSettingsBridgeAction(){}
+protected:
+ LLSettingsBridgeAction(const LLUUID& id, LLInventoryModel* model) : LLInvFVBridgeAction(id, model) {}
+};
+
+
LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type,
const LLUUID& uuid,
LLInventoryModel* model)
@@ -7309,6 +7347,9 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_
case LLAssetType::AT_BODYPART:
action = new LLWearableBridgeAction(uuid,model);
break;
+ case LLAssetType::AT_SETTINGS:
+ action = new LLSettingsBridgeAction(uuid, model);
+ break;
default:
break;
}
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 01d7ab3dcf..ed3c18ef4e 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -55,6 +55,8 @@
#include "llpermissions.h"
#include "llinventorymodel.h"
+#include "llassetstorage.h"
+#include "llvfile.h"
#undef VERIFY_LEGACY_CONVERSION
@@ -101,70 +103,7 @@ private:
//=========================================================================
-#if 0
-void LLSettingsVOBase::storeAsAsset(const LLSettingsBase::ptr_t &settings)
-{
- LLTransactionID tid;
- tid.generate();
-
- LLAssetID aid(tid.makeAssetID(gAgent.getSecureSessionID()));
-
- const std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, aid.asString()) + ".setting";
-
- if (!exportFile(settings, filename))
- {
- LL_WARNS("SETTINGS") << "Unable to save settings file named '" << filename << "'." << LL_ENDL;
-
- LLSD args;
- args["NAME"] = aid.asString() + "setting";
- LLNotificationsUtil::add("CannotSaveWearableOutOfSpace", args);
- return;
- }
-
- SettingsSaveData::ptr_t psave = std::make_shared<SettingsSaveData>();
- psave->mType = settings->getSettingType();
- psave->mSettings = settings;
- psave->mTempFile = filename;
- psave->mTransId = tid;
-
- gAssetStorage->storeAssetData(filename, tid, LLAssetType::AT_SETTINGS,
- [psave](const LLUUID &assetId, void *, S32 status, LLExtStat extstat) {
- onSaveNewAssetComplete(assetId, psave, status, extstat);
- },
- nullptr);
-
-}
-
-void testingOnGotAsset(LLVFS *vfs, const LLUUID &asset_id, LLAssetType::EType asset_type, void *user_data, S32 status, LLExtStat ext_status)
-{
- LL_WARNS("SETTINGS") << "Got back stored setting with id '" << asset_id << "' status is " << status << ":" << ext_status << LL_ENDL;
-}
-
-
-void LLSettingsVOBase::onSaveNewAssetComplete(const LLUUID& new_asset_id, const LLSettingsVOBase::SettingsSaveData::ptr_t &savedata,
- S32 status, LLExtStat ext_status)
-{
- if (!status)
- {
- // Success
- LL_INFOS("SETTINGS") << "Saved setting of type '" << savedata->mType << "' as " << new_asset_id << LL_ENDL;
- }
- else
- {
- LL_WARNS("SETTINGS") << "Unable to save '" << savedata->mType << "' to central asset store." << LL_ENDL;
- LLSD args;
- args["NAME"] = savedata->mType;
- LLNotificationsUtil::add("CannotSaveToAssetStore", args);
- }
-
- gAssetStorage->getAssetData(new_asset_id, LLAssetType::AT_SETTINGS, &testingOnGotAsset, nullptr);
-
- std::remove(savedata->mTempFile.c_str());
-}
-#endif
-
-
-void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings)
+void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback)
{
LLTransactionID tid;
LLUUID parentFolder; //= gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
@@ -172,8 +111,8 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
tid.generate();
- LLPointer<LLInventoryCallback> cb = new LLSettingsInventoryCB([settings](const LLUUID &inventoryId) {
- LLSettingsVOBase::onInventoryItemCreated(inventoryId, settings);
+ LLPointer<LLInventoryCallback> cb = new LLSettingsInventoryCB([settings, callback](const LLUUID &inventoryId) {
+ LLSettingsVOBase::onInventoryItemCreated(inventoryId, settings, callback);
});
create_inventory_settings(gAgent.getID(), gAgent.getSessionID(),
@@ -182,14 +121,13 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
settings->getSettingTypeValue(), nextOwnerPerm, cb);
}
-void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings)
+void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback)
{
// We need to update some inventory stuff here.... maybe.
- uploadSettingsAsset(settings, inventoryId);
+ updateInventoryItem(settings, inventoryId, callback);
}
-
-void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id)
+void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback)
{
const LLViewerRegion* region = gAgent.getRegion();
if (!region)
@@ -200,7 +138,7 @@ void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings
std::string agent_url(region->getCapability("UpdateSettingsAgentInventory"));
- if (agent_url.empty())
+ if (!LLEnvironment::instance().isInventoryEnabled())
{
LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL;
return;
@@ -211,14 +149,14 @@ void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings
LLSDSerialize::serialize(settingdata, buffer, LLSDSerialize::LLSD_NOTATION);
LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(inv_item_id, LLAssetType::AT_SETTINGS, buffer.str(),
- [settings](LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response) {
- LLSettingsVOBase::onAgentAssetUploadComplete(itemId, newAssetId, newItemId, response, settings);
+ [settings, callback](LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response) {
+ LLSettingsVOBase::onAgentAssetUploadComplete(itemId, newAssetId, newItemId, response, settings, callback);
});
LLViewerAssetUpload::EnqueueInventoryUpload(agent_url, uploadInfo);
}
-void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id)
+void LLSettingsVOBase::updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback)
{
const LLViewerRegion* region = gAgent.getRegion();
if (!region)
@@ -229,7 +167,7 @@ void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings
std::string agent_url(region->getCapability("UpdateSettingsAgentInventory"));
- if (agent_url.empty())
+ if (!LLEnvironment::instance().isInventoryEnabled())
{
LL_WARNS("SETTINGS") << "Region does not support settings inventory objects." << LL_ENDL;
return;
@@ -243,23 +181,71 @@ void LLSettingsVOBase::uploadSettingsAsset(const LLSettingsBase::ptr_t &settings
LLSDSerialize::serialize(settingdata, buffer, LLSDSerialize::LLSD_NOTATION);
LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(object_id, inv_item_id, LLAssetType::AT_SETTINGS, buffer.str(),
- [settings](LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response) {
- LLSettingsVOBase::onTaskAssetUploadComplete(itemId, taskId, newAssetId, response, settings);
+ [settings, callback](LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response) {
+ LLSettingsVOBase::onTaskAssetUploadComplete(itemId, taskId, newAssetId, response, settings, callback);
});
LLViewerAssetUpload::EnqueueInventoryUpload(agent_url, uploadInfo);
}
-void LLSettingsVOBase::onAgentAssetUploadComplete(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response, LLSettingsBase::ptr_t psettings)
+void LLSettingsVOBase::onAgentAssetUploadComplete(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response, LLSettingsBase::ptr_t psettings, inventory_result_fn callback)
{
- LL_WARNS("SETTINGS") << "Upload to inventory complete!" << LL_ENDL;
+ LL_WARNS("SETTINGS") << "itemId:" << itemId << " newAssetId:" << newAssetId << " newItemId:" << newItemId << " response:" << response << LL_ENDL;
+ if (callback)
+ callback( newAssetId, itemId, LLUUID::null, response );
}
-void LLSettingsVOBase::onTaskAssetUploadComplete(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, LLSettingsBase::ptr_t psettings)
+void LLSettingsVOBase::onTaskAssetUploadComplete(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, LLSettingsBase::ptr_t psettings, inventory_result_fn callback)
{
LL_WARNS("SETTINGS") << "Upload to task complete!" << LL_ENDL;
+ if (callback)
+ callback(newAssetId, itemId, taskId, response);
}
+
+void LLSettingsVOBase::getSettingsAsset(const LLUUID &assetId, LLSettingsVOBase::asset_download_fn callback)
+{
+ gAssetStorage->getAssetData(assetId, LLAssetType::AT_SETTINGS,
+ [callback](LLVFS *vfs, const LLUUID &asset_id, LLAssetType::EType, void *, S32 status, LLExtStat ext_status)
+ { onAssetDownloadComplete(vfs, asset_id, status, ext_status, callback); },
+ nullptr, true);
+
+}
+
+void LLSettingsVOBase::onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_id, S32 status, LLExtStat ext_status, LLSettingsVOBase::asset_download_fn callback)
+{
+ LLSettingsBase::ptr_t settings;
+ if (!status)
+ {
+ LLVFile file(vfs, asset_id, LLAssetType::AT_SETTINGS, LLVFile::READ);
+ S32 size = file.getSize();
+
+ std::string buffer(size + 1, '\0');
+ file.read((U8 *)buffer.data(), size);
+
+ std::stringstream llsdstream(buffer);
+ LLSD llsdsettings;
+
+ if (LLSDSerialize::deserialize(llsdsettings, llsdstream, -1))
+ {
+ settings = createFromLLSD(llsdsettings);
+ }
+
+ if (!settings)
+ {
+ status = 1;
+ LL_WARNS("SETTINGS") << "Unable to creat settings object." << LL_ENDL;
+ }
+
+ }
+ else
+ {
+ LL_WARNS("SETTINGS") << "Error retrieving asset asset_id. Status code=" << status << " ext_status=" << ext_status << LL_ENDL;
+ }
+ callback(asset_id, settings, status, ext_status);
+}
+
+
bool LLSettingsVOBase::exportFile(const LLSettingsBase::ptr_t &settings, const std::string &filename, LLSDSerialize::ELLSD_Serialize format)
{
try
@@ -311,7 +297,18 @@ LLSettingsBase::ptr_t LLSettingsVOBase::importFile(const std::string &filename)
return LLSettingsBase::ptr_t();
}
- std::string settingtype = settings[SETTING_NAME].asString();
+ return createFromLLSD(settings);
+}
+
+LLSettingsBase::ptr_t LLSettingsVOBase::createFromLLSD(const LLSD &settings)
+{
+ if (!settings.has(SETTING_TYPE))
+ {
+ LL_WARNS("SETTINGS") << "No settings type in LLSD" << LL_ENDL;
+ return LLSettingsBase::ptr_t();
+ }
+
+ std::string settingtype = settings[SETTING_TYPE].asString();
LLSettingsBase::ptr_t psetting;
@@ -328,10 +325,10 @@ LLSettingsBase::ptr_t LLSettingsVOBase::importFile(const std::string &filename)
return LLSettingsVODay::buildDay(settings);
}
- LL_WARNS("SETTINGS") << "Unable to determine settings type for '" << filename << "'." << LL_ENDL;
+ LL_WARNS("SETTINGS") << "Unable to determine settings type for '" << settingtype << "'." << LL_ENDL;
return LLSettingsBase::ptr_t();
-}
+}
//=========================================================================
LLSettingsVOSky::LLSettingsVOSky(const LLSD &data, bool isAdvanced)
diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h
index 3c47009d5f..3339aaf037 100644
--- a/indra/newview/llsettingsvo.h
+++ b/indra/newview/llsettingsvo.h
@@ -36,23 +36,27 @@
#include "llsdserialize.h"
#include "llextendedstatus.h"
+#include <boost/signals2.hpp>
+
+class LLVFS;
//=========================================================================
class LLSettingsVOBase : public LLSettingsBase
{
public:
-#if 0
- static void storeAsAsset(const LLSettingsBase::ptr_t &settings);
-#endif
+ typedef std::function<void(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat extstat)> asset_download_fn;
+ typedef std::function<void(LLUUID asset_id, LLUUID inventory_id, LLUUID object_id, LLSD results)> inventory_result_fn;
- static void createInventoryItem(const LLSettingsBase::ptr_t &settings);
+ static void createInventoryItem(const LLSettingsBase::ptr_t &settings, inventory_result_fn callback = inventory_result_fn());
- static void uploadSettingsAsset(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id);
- static void uploadSettingsAsset(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id);
+ static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn());
+ static void updateInventoryItem(const LLSettingsBase::ptr_t &settings, LLUUID object_id, LLUUID inv_item_id, inventory_result_fn callback = inventory_result_fn());
+ static void getSettingsAsset(const LLUUID &assetId, asset_download_fn callback);
static bool exportFile(const LLSettingsBase::ptr_t &settings, const std::string &filename, LLSDSerialize::ELLSD_Serialize format = LLSDSerialize::LLSD_NOTATION);
static LLSettingsBase::ptr_t importFile(const std::string &filename);
+ static LLSettingsBase::ptr_t createFromLLSD(const LLSD &settings);
private:
struct SettingsSaveData
@@ -66,13 +70,12 @@ private:
LLSettingsVOBase() {}
- static void onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings);
+ static void onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback);
-#if 0
- static void onSaveNewAssetComplete(const LLUUID& new_asset_id, const SettingsSaveData::ptr_t &savedata, S32 status, LLExtStat ext_status);
-#endif
- static void onAgentAssetUploadComplete(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response, LLSettingsBase::ptr_t psettings);
- static void onTaskAssetUploadComplete(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, LLSettingsBase::ptr_t psettings);
+ static void onAgentAssetUploadComplete(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId, LLSD response, LLSettingsBase::ptr_t psettings, inventory_result_fn callback);
+ static void onTaskAssetUploadComplete(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, LLSettingsBase::ptr_t psettings, inventory_result_fn callback);
+
+ static void onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_id, S32 status, LLExtStat ext_status, asset_download_fn callback);
};
//=========================================================================
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/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 8665fb3234..ec457c1b5d 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -2035,6 +2035,19 @@ LLWearableType::EType LLViewerInventoryItem::getWearableType() const
return LLWearableType::inventoryFlagsToWearableType(getFlags());
}
+bool LLViewerInventoryItem::isSettingsType() const
+{
+ return (getInventoryType() == LLInventoryType::IT_SETTINGS);
+}
+
+LLSettingsType::type_e LLViewerInventoryItem::getSettingsType() const
+{
+ if (!isSettingsType())
+ {
+ return LLSettingsType::ST_NONE;
+ }
+ return LLSettingsType::fromInventoryFlags(getFlags());
+}
time_t LLViewerInventoryItem::getCreationDate() const
{
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index be100a764a..d537b28682 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -75,6 +75,9 @@ public:
virtual LLInventoryType::EType getInventoryType() const;
virtual bool isWearableType() const;
virtual LLWearableType::EType getWearableType() const;
+ virtual bool isSettingsType() const;
+ virtual LLSettingsType::type_e getSettingsType() const;
+
virtual U32 getFlags() const;
virtual time_t getCreationDate() const;
virtual U32 getCRC32() const; // really more of a checksum.
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/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 74deaffe16..0e30ca9090 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1719,7 +1719,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
U32 fsaa_samples)
*/
// create window
- mWindow = LLWindowManager::createWindow(this,
+ mWindow = LLWindowManager::createWindow(this,
p.title, p.name, p.x, p.y, p.width, p.height, 0,
p.fullscreen,
gHeadlessClient,
diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
index 88423ad023..70f5e21327 100644
--- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
+++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
- legacy_header_height="18"
- height="500"
+ height="602"
layout="topleft"
name="env_edit_extdaycycle"
help_topic="day_presets"
@@ -13,43 +12,53 @@
<string name="title_edit">Edit Day Cycle</string>
<string name="hint_new">Name your day cycle, adjust the controls to create it, and click "Save".</string>
<string name="hint_edit">To edit your day cycle, adjust the controls below and click "Save".</string>
- <string name="combo_label">-Select a preset-</string>
+
+ <!-- Todo: These 5 strings might be subjected to a change to get dynamic labels-->
+ <string name="0_label">0%[DSC]</string>
+ <string name="1_label">25%[DSC]</string>
+ <string name="2_label">50%[DSC]</string>
+ <string name="3_label">75%[DSC]</string>
+ <string name="4_label">100%[DSC]</string>
+ <string name="time_label"> ([TIME] hr)</string>
<layout_stack name="test_stack"
width="705"
- height="500"
+ height="602"
follows="all"
+ animate="false"
+ top="0"
orientation="vertical">
<layout_panel name="temp"
border="false"
auto_resize="false"
user_resize="true"
- height="45"
- min_height="45"
+ height="29"
+ min_height="29"
background_visible="false">
<!-- This layout_panel is for loading legacy presets -->
<text
- follows="top|left|right"
+ follows="top|left"
font="SansSerif"
height="10"
layout="topleft"
name="label"
- top_delta="70"
- width="120">
- Preset Name:
+ left="15"
+ top="5"
+ width="105">
+ Day Cycle Name:
</text>
- <combo_box
- allow_text_entry="true"
+ <line_editor
follows="top|left"
layout="topleft"
left_pad="10"
max_chars="100"
- name="day_cycle_preset_combo"
- top_delta="-5"
- width="200" />
+ name="day_cycle_name"
+ top="5"
+ width="200"
+ height="21" />
</layout_panel>
- <layout_panel name="timeline"
- border="true"
+ <layout_panel name="timeline_track_selection"
+ border="false"
bevel_style="in"
auto_resize="false"
user_resize="true"
@@ -58,74 +67,415 @@
min_height="0"
visible="true"
background_visible="true">
- <text
- follows="top|left|right"
- font="SansSerif"
+ <panel name="timeline_layers"
+ border="false"
+ follows="left|top"
+ auto_resize="false"
+ user_resize="true"
+ bg_alpha_color="yellow"
+ height="150"
+ width="110"
+ top_pad="0"
+ min_height="0"
+ visible="true"
+ background_visible="true">
+ <button
+ follows="left|top"
+ height="23"
+ label="Sky 4"
+ layout="topleft"
+ top_pad="5"
+ left="10"
+ name="sky4_track"
+ width="100">
+ <button.commit_callback
+ function="DayCycle.Track"
+ parameter="1" />
+ </button>
+ <button
+ follows="left|top"
+ height="23"
+ label="Sky 3"
+ layout="topleft"
+ top_pad="0"
+ left="10"
+ name="sky3_track"
+ width="100">
+ <button.commit_callback
+ function="DayCycle.Track"
+ parameter="2" />
+ </button>
+ <button
+ follows="left|top"
+ height="23"
+ label="Sky 2"
+ layout="topleft"
+ top_pad="0"
+ left="10"
+ name="sky2_track"
+ width="100">
+ <button.commit_callback
+ function="DayCycle.Track"
+ parameter="3" />
+ </button>
+ <button
+ follows="left|top"
+ height="23"
+ label="Sky 1"
+ layout="topleft"
+ top_pad="0"
+ left="10"
+ name="sky1_track"
+ width="100">
+ <button.commit_callback
+ function="DayCycle.Track"
+ parameter="4" />
+ </button>
+ <button
+ follows="left|top"
+ height="23"
+ label="Water"
+ layout="topleft"
+ top_pad="0"
+ left="10"
+ name="water_track"
+ width="100">
+ <button.commit_callback
+ function="DayCycle.Track"
+ parameter="0" />
+ </button>
+ </panel>
+ <panel name="timeline"
+ border="true"
+ follows="left|top"
+ auto_resize="false"
+ user_resize="true"
+ height="150"
+ min_height="0"
+ width="595"
+ min_width="595"
+ left_pad="0"
+ visible="true">
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="p0"
+ top_pad="5"
+ value="0%"
+ width="50" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="69"
+ name="p1"
+ top_delta="0"
+ value="25%"
+ width="50" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="69"
+ name="p2"
+ top_delta="0"
+ value="50%"
+ width="50" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="69"
+ name="p3"
+ top_delta="0"
+ value="75%"
+ width="50" />
+ <text
+ follows="left|top|right"
+ height="15"
+ layout="topleft"
+ left_pad="69"
+ name="p4"
+ top_delta="0"
+ value="100%"
+ width="50" />
+ <multi_slider
+ can_edit_text="true"
+ decimal_digits="0"
+ draw_track="false"
+ follows="bottom"
height="10"
+ increment="0.0833333"
+ initial_value="0"
layout="topleft"
- name="label"
- top_offset="20"
- left_offset="10"
- width="120">
- Time Line Goes here
- </text>
+ left="10"
+ max_sliders="20"
+ max_val="24"
+ name="WLTimeSlider"
+ show_text="false"
+ top_pad="0"
+ use_triangle="true"
+ width="525"
+ min_width="525"/>
+
+ <multi_slider
+ can_edit_text="true"
+ decimal_digits="0"
+ follows="bottom"
+ height="10"
+ increment="0.0833333"
+ initial_value="0"
+ layout="topleft"
+ left="10"
+ max_sliders="20"
+ max_val="24"
+ name="WLDayCycleKeys"
+ show_text="false"
+ top_pad="15"
+ width="525"
+ min_width="525" />
+
+ <line_editor
+ border_style="line"
+ border_thickness="1"
+ follows="left|bottom"
+ font="SansSerif"
+ height="20"
+ layout="topleft"
+ left_pad="0"
+ max_length_bytes="300"
+ name="timeline_field"
+ select_on_focus="true"
+ value="%"
+ tool_tip="The full path to an editor (executable) to edit floater XML files (quotes not necessary)"
+ top_delta="-5"
+ width="35" />
+
+ <layout_stack
+ name="progress_control"
+ follows="top|left"
+ height="25"
+ width="83"
+ layout="topleft"
+ animate="false"
+ left="225"
+ top_pad="40"
+ orientation="horizontal">
+
+ <layout_panel
+ name="skip_back"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="skip_back_btn"
+ follows="top"
+ image_overlay="SkipBackward_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ width="25"
+ height="25"
+ layout="topleft"
+ tool_tip="Step back"
+ top="0"
+ left="0"/>
+ </layout_panel>
+
+ <layout_panel
+ name="play"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="play_btn"
+ follows="top"
+ image_overlay="Play_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ layout="topleft"
+ height="25"
+ width="25"
+ left="0"
+ top="0" />
+ </layout_panel>
+
+ <layout_panel
+ name="pause"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25"
+ visible="false">
+ <button
+ name="pause_btn"
+ follows="top"
+ image_overlay="Pause_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ layout="topleft"
+ height="25"
+ width="25"
+ left="0"
+ top="0"/>
+ </layout_panel>
+
+ <layout_panel
+ name="skip_forward"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="skip_forward_btn"
+ follows="top"
+ image_overlay="SkipForward_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ width="25"
+ height="25"
+ layout="topleft"
+ tool_tip="Step forward"
+ top="0" />
+ </layout_panel>
+ </layout_stack>
+
+ <button
+ follows="top|left"
+ height="23"
+ width="90"
+ label="Add Frame"
+ left_pad="175"
+ top_delta="-12"
+ name="add_frame" />
+ <button
+ follows="left|top"
+ height="23"
+ width="90"
+ label="Delete Frame"
+ top_pad="0"
+ left_delta="0"
+ name="delete_frame" />
+ </panel>
</layout_panel>
- <layout_panel name="flex"
- auto_resize="true"
+ <layout_panel name="frame_settings_water"
+ auto_resize="false"
user_resize="true"
- bg_alpha_color="blue"
- height="11"
+ height="386"
+ width="700"
min_height="0"
- visible="true"
- background_visible="true">
+ visible="false">
<tab_container
follows="all"
halign="left"
height="386"
layout="topleft"
- left_offset="0"
- name="landtab"
+ left="0"
+ name="water_tabs"
tab_position="top"
tab_width="140"
tab_padding_right="3"
- top_offset="6"
- width="633">
- <panel
- border="true"
- follows="all"
- label="DUMMY"
- layout="topleft"
- left="0"
- help_topic="land_general_tab"
- name="land_general_panel"
- top="0">
- <text
- follows="top|left|right"
- font="SansSerif"
- height="10"
- layout="center"
- name="label"
- top_offset="20"
- left_offset="10"
- width="300">
- Space For editing selected frame
- </text>
-
- </panel>
+ top_pad="0"
+ width="700">
+ <panel
+ border="true"
+ filename="panel_settings_water.xml"
+ label="Water_panel"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ name="water_panel"/>
+ </tab_container>
+ </layout_panel>
+ <layout_panel name="frame_settings_sky"
+ auto_resize="false"
+ user_resize="true"
+ height="386"
+ width="700"
+ min_height="0"
+ visible="true">
+ <tab_container
+ follows="all"
+ halign="left"
+ height="386"
+ visible="true"
+ layout="topleft"
+ left="0"
+ name="sky_tabs"
+ tab_position="top"
+ tab_width="140"
+ tab_padding_right="3"
+ top_pad="0"
+ width="700">
+ <panel
+ border="true"
+ filename="panel_settings_sky_atmos.xml"
+ label="Atmosphere &amp; Lighting"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ name="atmosphere_panel" />
+ <panel
+ border="true"
+ filename="panel_settings_sky_clouds.xml"
+ label="Clouds"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ name="clouds_panel" />
+ <panel
+ border="true"
+ filename="panel_settings_sky_sunmoon.xml"
+ label="Sun &amp; Moon"
+ layout="topleft"
+ left_delta="0"
+ top_pad="5"
+ name="moon_panel" />
</tab_container>
</layout_panel>
<layout_panel name="buttons"
auto_resize="false"
user_resize="true"
- height="43"
+ height="26"
min_height="0"
- background_visible="false">
+ visible="true"
+ width="700">
<button
follows="top|left"
height="23"
label="Save"
- left_offset="160"
- top_offset="60"
+ left="5"
+ top_pad="0"
name="save_btn"
width="100" />
<button
@@ -138,7 +488,7 @@
width="100" />
<button
- follows="top|right"
+ follows="top|left"
height="23"
label="Upload"
layout="topleft"
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>