From 8b3957b310afa23e543c3eb33aca9131dba52b31 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 7 Jun 2018 20:22:20 +0300 Subject: MAINT-8331 EEP UI control: XYVector --- indra/llui/CMakeLists.txt | 2 + indra/llui/llxyvector.cpp | 306 +++++++++++++++++++++ indra/llui/llxyvector.h | 118 ++++++++ indra/newview/llpaneleditsky.cpp | 12 +- indra/newview/llpaneleditwater.cpp | 26 +- indra/newview/llpaneleditwater.h | 18 +- .../default/xui/en/floater_edit_ext_day_cycle.xml | 11 +- .../default/xui/en/panel_settings_sky_clouds.xml | 53 +--- .../skins/default/xui/en/panel_settings_water.xml | 118 +++----- .../skins/default/xui/en/widgets/xy_vector.xml | 29 ++ 10 files changed, 522 insertions(+), 171 deletions(-) create mode 100644 indra/llui/llxyvector.cpp create mode 100644 indra/llui/llxyvector.h create mode 100644 indra/newview/skins/default/xui/en/widgets/xy_vector.xml (limited to 'indra') diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 8054eb3619..04cd8b3f21 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -135,6 +135,7 @@ set(llui_SOURCE_FILES llviewereventrecorder.cpp llwindowshade.cpp llxuiparser.cpp + llxyvector.cpp ) set(llui_HEADER_FILES @@ -251,6 +252,7 @@ set(llui_HEADER_FILES llviewquery.h llwindowshade.h llxuiparser.h + llxyvector.h ) set_source_files_properties(${llui_HEADER_FILES} diff --git a/indra/llui/llxyvector.cpp b/indra/llui/llxyvector.cpp new file mode 100644 index 0000000000..48f38b8a92 --- /dev/null +++ b/indra/llui/llxyvector.cpp @@ -0,0 +1,306 @@ +/** +* @file llxyvector.cpp +* @author Andrey Lihatskiy +* @brief Implementation for LLXYVector +* +* $LicenseInfo:firstyear=2001&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2018, 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$ +*/ + +// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane. + +#include "linden_common.h" + +#include "llxyvector.h" + +#include "llstring.h" +#include "llrect.h" + +#include "lluictrlfactory.h" +#include "llrender.h" + +// Globals +static LLDefaultChildRegistry::Register register_xy_vector("xy_vector"); + + +const F32 CENTER_CIRCLE_RADIUS = 2; +const S32 ARROW_ANGLE = 30; +const S32 ARROW_LENGTH_LONG = 10; +const S32 ARROW_LENGTH_SHORT = 6; + +LLXYVector::Params::Params() + : x_entry("x_entry"), + y_entry("y_entry"), + touch_area("touch_area"), + border("border"), + edit_bar_height("edit_bar_height", 18), + padding("padding", 4), + min_val_x("min_val_x", -1.0f), + max_val_x("max_val_x", 1.0f), + increment_x("increment_x", 0.05f), + min_val_y("min_val_y", -1.0f), + max_val_y("max_val_y", 1.0f), + increment_y("increment_y", 0.05f), + label_width("label_width", 16), + arrow_color("arrow_color", LLColor4::white), + ghost_color("ghost_color"), + area_color("area_color", LLColor4::grey4), + grid_color("grid_color", LLColor4::grey % 0.25f) +{ +} + +LLXYVector::LLXYVector(const LLXYVector::Params& p) + : LLUICtrl(p), + mArrowColor(p.arrow_color()), + mAreaColor(p.area_color), + mGridColor(p.grid_color), + mMinValueX(p.min_val_x), + mMaxValueX(p.max_val_x), + mIncrementX(p.increment_x), + mMinValueY(p.min_val_y), + mMaxValueY(p.max_val_y), + mIncrementY(p.increment_y) +{ + mGhostColor = p.ghost_color.isProvided() ? p.ghost_color() % 0.3f : p.arrow_color() % 0.3f; + + LLRect border_rect = getLocalRect(); + LLViewBorder::Params params = p.border; + params.rect(border_rect); + mBorder = LLUICtrlFactory::create(params); + addChild(mBorder); + + LLTextBox::Params x_label_params; + x_label_params.initial_value(p.x_entry.label()); + x_label_params.rect = LLRect(p.padding, + border_rect.mTop - p.padding, + p.label_width, + border_rect.getHeight() - p.edit_bar_height); + mXLabel = LLUICtrlFactory::create(x_label_params); + addChild(mXLabel); + LLLineEditor::Params x_params = p.x_entry; + x_params.rect = LLRect(p.padding + p.label_width, + border_rect.mTop - p.padding, + border_rect.getCenterX(), + border_rect.getHeight() - p.edit_bar_height); + x_params.commit_callback.function(boost::bind(&LLXYVector::onEditChange, this)); + mXEntry = LLUICtrlFactory::create(x_params); + mXEntry->setPrevalidateInput(LLTextValidate::validateFloat); + addChild(mXEntry); + + LLTextBox::Params y_label_params; + y_label_params.initial_value(p.y_entry.label()); + y_label_params.rect = LLRect(border_rect.getCenterX() + p.padding, + border_rect.mTop - p.padding, + border_rect.getCenterX() + p.label_width, + border_rect.getHeight() - p.edit_bar_height); + mYLabel = LLUICtrlFactory::create(y_label_params); + addChild(mYLabel); + LLLineEditor::Params y_params = p.y_entry; + y_params.rect = LLRect(border_rect.getCenterX() + p.padding + p.label_width, + border_rect.getHeight() - p.padding, + border_rect.getWidth() - p.padding, + border_rect.getHeight() - p.edit_bar_height); + y_params.commit_callback.function(boost::bind(&LLXYVector::onEditChange, this)); + mYEntry = LLUICtrlFactory::create(y_params); + mYEntry->setPrevalidateInput(LLTextValidate::validateFloat); + addChild(mYEntry); + + LLPanel::Params touch_area = p.touch_area; + touch_area.rect = LLRect(p.padding, + border_rect.mTop - p.edit_bar_height - p.padding, + border_rect.getWidth() - p.padding, + p.padding); + mTouchArea = LLUICtrlFactory::create(touch_area); + addChild(mTouchArea); +} + +LLXYVector::~LLXYVector() +{ +} + +BOOL LLXYVector::postBuild() +{ + return TRUE; +} + +void drawArrow(S32 tailX, S32 tailY, S32 tipX, S32 tipY, LLColor4 color) +{ + gl_line_2d(tailX, tailY, tipX, tipY, color); + + S32 dx = tipX - tailX; + S32 dy = tipY - tailY; + + S32 arrowLength = (abs(dx) < ARROW_LENGTH_LONG && abs(dy) < ARROW_LENGTH_LONG) ? ARROW_LENGTH_SHORT : ARROW_LENGTH_LONG; + + F32 theta = std::atan2(dy, dx); + + F32 rad = ARROW_ANGLE * std::atan(1) * 4 / 180; + F32 x = tipX - arrowLength * cos(theta + rad); + F32 y = tipY - arrowLength * sin(theta + rad); + F32 rad2 = -1 * ARROW_ANGLE * std::atan(1) * 4 / 180; + F32 x2 = tipX - arrowLength * cos(theta + rad2); + F32 y2 = tipY - arrowLength * sin(theta + rad2); + gl_triangle_2d(tipX, tipY, x, y, x2, y2, color, true); +} + +void LLXYVector::draw() +{ + S32 centerX = mTouchArea->getRect().getCenterX(); + S32 centerY = mTouchArea->getRect().getCenterY(); + + S32 pointX = centerX + (mValueX * mTouchArea->getRect().getWidth() / (2 * mMaxValueX)); + S32 pointY = centerY + (mValueY * mTouchArea->getRect().getHeight() / (2 * mMaxValueY)); + + // fill + gl_rect_2d(mTouchArea->getRect(), mAreaColor, true); + + // draw grid + gl_line_2d(centerX, mTouchArea->getRect().mTop, centerX, mTouchArea->getRect().mBottom, mGridColor); + gl_line_2d(mTouchArea->getRect().mLeft, centerY, mTouchArea->getRect().mRight, centerY, mGridColor); + + // draw ghost + if (hasMouseCapture()) + { + drawArrow(centerX, centerY, mGhostX, mGhostY, mGhostColor); + } + else + { + mGhostX = pointX; + mGhostY = pointY; + } + + if (abs(mValueX) >= mIncrementX || abs(mValueY) >= mIncrementY) + { + // draw the vector arrow + drawArrow(centerX, centerY, pointX, pointY, mArrowColor); + } + else + { + // skip the arrow, set color for center circle + gGL.color4fv(mArrowColor.get().mV); + } + + // draw center circle + gl_circle_2d(centerX, centerY, CENTER_CIRCLE_RADIUS, 12, true); + + LLView::draw(); +} + +void LLXYVector::onEditChange() +{ + if (getEnabled()) + { + setValueAndCommit(mXEntry->getValue().asReal(), mYEntry->getValue().asReal()); + } +} + +void LLXYVector::setValue(const LLSD& value) +{ + if (value.isArray()) + { + setValue(value[0].asReal(), value[1].asReal()); + } +} + +void LLXYVector::setValue(F32 x, F32 y) +{ + x = llclamp(x, mMinValueX, mMaxValueX); + y = llclamp(y, mMinValueY, mMaxValueY); + + // Round the values to nearest increments + x -= mMinValueX; + x += mIncrementX / 2.0001f; + x -= fmod(x, mIncrementX); + x += mMinValueX; + + y -= mMinValueY; + y += mIncrementY / 2.0001f; + y -= fmod(y, mIncrementY); + y += mMinValueY; + + mValueX = x; + mValueY = y; + + update(); +} + +void LLXYVector::setValueAndCommit(F32 x, F32 y) +{ + if (mValueX != x || mValueY != y) + { + setValue(x, y); + onCommit(); + } +} + +LLSD LLXYVector::getValue() const +{ + LLSD value; + value.append(mValueX); + value.append(mValueY); + return value; +} + +void LLXYVector::update() +{ + mXEntry->setValue(mValueX); + mYEntry->setValue(mValueY); +} + +BOOL LLXYVector::handleHover(S32 x, S32 y, MASK mask) +{ + if (hasMouseCapture()) + { + F32 valueX = F32(x - mTouchArea->getRect().getCenterX()) / mTouchArea->getRect().getWidth(); + F32 valueY = F32(y - mTouchArea->getRect().getCenterY()) / mTouchArea->getRect().getHeight(); + + valueX *= 2 * mMaxValueX; + valueY *= 2 * mMaxValueY; + + setValueAndCommit(valueX, valueY); + } + + return TRUE; +} + +BOOL LLXYVector::handleMouseUp(S32 x, S32 y, MASK mask) +{ + if (hasMouseCapture()) + { + gFocusMgr.setMouseCapture(NULL); + make_ui_sound("UISndClickRelease"); + } + + return TRUE; +} + +BOOL LLXYVector::handleMouseDown(S32 x, S32 y, MASK mask) +{ + + if (mTouchArea->getRect().pointInRect(x, y)) + { + gFocusMgr.setMouseCapture(this); + make_ui_sound("UISndClick"); + } + + return TRUE; +} + diff --git a/indra/llui/llxyvector.h b/indra/llui/llxyvector.h new file mode 100644 index 0000000000..4d67db3251 --- /dev/null +++ b/indra/llui/llxyvector.h @@ -0,0 +1,118 @@ +/** +* @file llxyvector.h +* @author Andrey Lihatskiy +* @brief Header file for LLXYVector +* +* $LicenseInfo:firstyear=2001&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2018, 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$ +*/ + +// A control that allows to set two related vector magnitudes by manipulating a single vector on a plane. + +#ifndef LL_LLXYVECTOR_H +#define LL_LLXYVECTOR_H + +#include "lluictrl.h" +#include "llpanel.h" +#include "lltextbox.h" +#include "lllineeditor.h" + +class LLXYVector + : public LLUICtrl +{ +public: + struct Params + : public LLInitParam::Block + { + Optional x_entry; + Optional y_entry; + Optional touch_area; + Optional border; + Optional edit_bar_height; + Optional padding; + Optional label_width; + Optional min_val_x; + Optional max_val_x; + Optional increment_x; + Optional min_val_y; + Optional max_val_y; + Optional increment_y; + Optional arrow_color; + Optional ghost_color; + Optional area_color; + Optional grid_color; + + Params(); + }; + + + virtual ~LLXYVector(); + /*virtual*/ BOOL postBuild(); + + virtual BOOL handleHover(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + + virtual void draw(); + + virtual void setValue(const LLSD& value); + void setValue(F32 x, F32 y); + virtual LLSD getValue() const; + +protected: + friend class LLUICtrlFactory; + LLXYVector(const Params&); + void onEditChange(); + +protected: + LLTextBox* mXLabel; + LLTextBox* mYLabel; + LLLineEditor* mXEntry; + LLLineEditor* mYEntry; + LLPanel* mTouchArea; + LLViewBorder* mBorder; + +private: + void update(); + void setValueAndCommit(F32 x, F32 y); + + F32 mValueX; + F32 mValueY; + + F32 mMinValueX; + F32 mMaxValueX; + F32 mIncrementX; + F32 mMinValueY; + F32 mMaxValueY; + F32 mIncrementY; + + U32 mGhostX; + U32 mGhostY; + + LLUIColor mArrowColor; + LLUIColor mGhostColor; + LLUIColor mAreaColor; + LLUIColor mGridColor; + +}; + +#endif + diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index dc724ce9c7..b6cd4bb37f 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -49,8 +49,7 @@ namespace const std::string FIELD_SKY_CLOUD_COLOR("cloud_color"); const std::string FIELD_SKY_CLOUD_COVERAGE("cloud_coverage"); const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale"); - const std::string FIELD_SKY_CLOUD_SCROLL_X("cloud_scroll_x"); - const std::string FIELD_SKY_CLOUD_SCROLL_Y("cloud_scroll_y"); + const std::string FIELD_SKY_CLOUD_SCROLL_XY("cloud_scroll_xy"); const std::string FIELD_SKY_CLOUD_MAP("cloud_map"); const std::string FIELD_SKY_CLOUD_DENSITY_X("cloud_density_x"); const std::string FIELD_SKY_CLOUD_DENSITY_Y("cloud_density_y"); @@ -194,8 +193,7 @@ BOOL LLPanelSettingsSkyCloudTab::postBuild() getChild(FIELD_SKY_CLOUD_COLOR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudColorChanged(); }); getChild(FIELD_SKY_CLOUD_COVERAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudCoverageChanged(); }); getChild(FIELD_SKY_CLOUD_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScaleChanged(); }); - getChild(FIELD_SKY_CLOUD_SCROLL_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); - getChild(FIELD_SKY_CLOUD_SCROLL_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); + getChild(FIELD_SKY_CLOUD_SCROLL_XY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); getChild(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); // getChild(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::DEFAULT_CLOUD_TEXTURE_ID); @@ -228,8 +226,7 @@ void LLPanelSettingsSkyCloudTab::refresh() getChild(FIELD_SKY_CLOUD_SCALE)->setValue(mSkySettings->getCloudScale()); LLVector2 cloudScroll(mSkySettings->getCloudScrollRate()); - getChild(FIELD_SKY_CLOUD_SCROLL_X)->setValue(cloudScroll[0]); - getChild(FIELD_SKY_CLOUD_SCROLL_Y)->setValue(cloudScroll[1]); + getChild(FIELD_SKY_CLOUD_SCROLL_XY)->setValue(cloudScroll.getValue()); getChild(FIELD_SKY_CLOUD_MAP)->setValue(mSkySettings->getCloudNoiseTextureId()); @@ -262,8 +259,7 @@ void LLPanelSettingsSkyCloudTab::onCloudScaleChanged() void LLPanelSettingsSkyCloudTab::onCloudScrollChanged() { - LLVector2 scroll(getChild(FIELD_SKY_CLOUD_SCROLL_X)->getValue().asReal(), - getChild(FIELD_SKY_CLOUD_SCROLL_Y)->getValue().asReal()); + LLVector2 scroll(getChild(FIELD_SKY_CLOUD_SCROLL_XY)->getValue()); mSkySettings->setCloudScrollRate(scroll); } diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index b0a300abe3..21b2868e7b 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -31,6 +31,7 @@ #include "llslider.h" #include "lltexturectrl.h" #include "llcolorswatch.h" +#include "llxyvector.h" namespace { @@ -39,11 +40,8 @@ namespace const std::string FIELD_WATER_UNDERWATER_MOD("water_underwater_mod"); const std::string FIELD_WATER_NORMAL_MAP("water_normal_map"); - const std::string FIELD_WATER_WAVE1_X("water_wave1_x"); - const std::string FIELD_WATER_WAVE1_Y("water_wave1_y"); - - const std::string FIELD_WATER_WAVE2_X("water_wave2_x"); - const std::string FIELD_WATER_WAVE2_Y("water_wave2_y"); + const std::string FIELD_WATER_WAVE1_XY("water_wave1_xy"); + const std::string FIELD_WATER_WAVE2_XY("water_wave2_xy"); const std::string FIELD_WATER_NORMAL_SCALE_X("water_normal_scale_x"); const std::string FIELD_WATER_NORMAL_SCALE_Y("water_normal_scale_y"); @@ -82,6 +80,8 @@ BOOL LLPanelSettingsWaterMainTab::postBuild() mClrFogColor = getChild(FIELD_WATER_FOG_COLOR); mTxtNormalMap = getChild(FIELD_WATER_NORMAL_MAP); + getChild(FIELD_WATER_WAVE1_XY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onLargeWaveChanged(); }); + mClrFogColor->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogColorChanged(); }); getChild(FIELD_WATER_FOG_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogDensityChanged(); }); // getChild(FIELD_WATER_FOG_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogDensityChanged(getChild(FIELD_WATER_FOG_DENSITY)->getValue().asReal()); }); @@ -90,11 +90,7 @@ BOOL LLPanelSettingsWaterMainTab::postBuild() mTxtNormalMap->setDefaultImageAssetID(LLSettingsWater::GetDefaultWaterNormalAssetId()); mTxtNormalMap->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNormalMapChanged(); }); - getChild(FIELD_WATER_WAVE1_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onLargeWaveChanged(); }); - getChild(FIELD_WATER_WAVE1_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onLargeWaveChanged(); }); - - getChild(FIELD_WATER_WAVE2_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSmallWaveChanged(); }); - getChild(FIELD_WATER_WAVE2_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSmallWaveChanged(); }); + getChild(FIELD_WATER_WAVE2_XY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSmallWaveChanged(); }); getChild(FIELD_WATER_NORMAL_SCALE_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNormalScaleChanged(); }); getChild(FIELD_WATER_NORMAL_SCALE_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNormalScaleChanged(); }); @@ -128,11 +124,9 @@ void LLPanelSettingsWaterMainTab::refresh() getChild(FIELD_WATER_UNDERWATER_MOD)->setValue(mWaterSettings->getFogMod()); mTxtNormalMap->setValue(mWaterSettings->getNormalMapID()); LLVector2 vect2 = mWaterSettings->getWave1Dir(); - getChild(FIELD_WATER_WAVE1_X)->setValue(vect2[0]); - getChild(FIELD_WATER_WAVE1_Y)->setValue(vect2[1]); + getChild(FIELD_WATER_WAVE1_XY)->setValue(vect2.getValue()); vect2 = mWaterSettings->getWave2Dir(); - getChild(FIELD_WATER_WAVE2_X)->setValue(vect2[0]); - getChild(FIELD_WATER_WAVE2_Y)->setValue(vect2[1]); + getChild(FIELD_WATER_WAVE2_XY)->setValue(vect2.getValue()); LLVector3 vect3 = mWaterSettings->getNormalScale(); getChild(FIELD_WATER_NORMAL_SCALE_X)->setValue(vect3[0]); getChild(FIELD_WATER_NORMAL_SCALE_Y)->setValue(vect3[1]); @@ -169,14 +163,14 @@ void LLPanelSettingsWaterMainTab::onNormalMapChanged() void LLPanelSettingsWaterMainTab::onLargeWaveChanged() { - LLVector2 vect(getChild(FIELD_WATER_WAVE1_X)->getValue().asReal(), getChild(FIELD_WATER_WAVE1_Y)->getValue().asReal()); + LLVector2 vect(getChild(FIELD_WATER_WAVE1_XY)->getValue()); LL_WARNS("LAPRAS") << "Changing Large Wave from " << mWaterSettings->getWave1Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave1Dir(vect); } void LLPanelSettingsWaterMainTab::onSmallWaveChanged() { - LLVector2 vect(getChild(FIELD_WATER_WAVE2_X)->getValue().asReal(), getChild(FIELD_WATER_WAVE2_Y)->getValue().asReal()); + LLVector2 vect(getChild(FIELD_WATER_WAVE2_XY)->getValue()); LL_WARNS("LAPRAS") << "Changing Small Wave from " << mWaterSettings->getWave2Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave2Dir(vect); } diff --git a/indra/newview/llpaneleditwater.h b/indra/newview/llpaneleditwater.h index 3b41a1bb24..1b70bf265c 100644 --- a/indra/newview/llpaneleditwater.h +++ b/indra/newview/llpaneleditwater.h @@ -36,6 +36,7 @@ class LLSlider; class LLColorSwatchCtrl; class LLTextureCtrl; +class LLXYVector; //========================================================================= class LLPanelSettingsWater : public LLSettingsEditPanel @@ -76,23 +77,6 @@ private: // LLSlider * mSldUnderWaterMod; LLTextureCtrl * mTxtNormalMap; -// // Temp until XY control -// LLSlider * mSldWave1X; -// LLSlider * mSldWave1Y; -// -// // Temp until XY control -// LLSlider * mSldWave2X; -// LLSlider * mSldWave2Y; -// -// LLSlider * mSldNormalScaleX; -// LLSlider * mSldNormalScaleY; -// LLSlider * mSldNormalScaleZ; -// LLSlider * mSldFresnelScale; -// LLSlider * mSldFresnelOffset; -// LLSlider * mSldScaleAbove; -// LLSlider * mSldScaleBelow; -// LLSlider * mSldBlurMultip; - void onFogColorChanged(); void onFogDensityChanged(); void onFogUnderWaterChanged(); 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 a1140b2532..fdd00ca910 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 @@ -6,7 +6,8 @@ help_topic="day_presets" save_rect="true" title="Edit Day Cycle" - width="705"> + width="705" + can_resize="true"> Create a New Day Cycle @@ -434,16 +435,16 @@ tool_tip="Replace frame with settings from inventory"/> diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml index 9bd931f9fb..57658a4725 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml @@ -95,51 +95,24 @@ width="200"> Cloud Scroll: - - - placeholder - - - - + name="cloud_scroll_xy" + width="120" + height="145" + visible="true" + left_delta="0" + top_delta="21" + min_val_x="-10" + max_val_x="10" + min_val_y="-10" + max_val_y="10" /> + Cloud Image: diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml index 59184b0f95..85d636d107 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_water.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml @@ -7,7 +7,7 @@ left="0" help_topic="land_general_tab" name="panel_settings_water" - top="0"> + top="0"> + left_delta="130"> Large Wave Speed - - - placeholder - - - - + + + left_delta="160"> Small Wave Speed - - - placeholder - - - - + + + + + + + + + + + -- cgit v1.2.3