From 3afaa799628c74abdd1542514bc3852432c3925b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 15 Jan 2018 11:40:32 -0500 Subject: STORM-2145 Fixed bug. Now you can only have one of the load/save/delete floaters open at once. --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 151 ++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 indra/newview/llfloaterpreferenceviewadvanced.cpp (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp new file mode 100644 index 0000000000..ff80328acc --- /dev/null +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -0,0 +1,151 @@ +/** + * @file llfloaterpreferenceviewadvanced.cpp + * @brief floater for adjusting camera position + * + * $LicenseInfo:firstyear=2018&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$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfloaterpreferenceviewadvanced.h" +#include "llfloater.h" +#include "llfloaterreg.h" +#include "lluictrlfactory.h" +#include "llspinctrl.h" +#include "llviewercontrol.h" + + +LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key) +: LLFloater(key) +{ + mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); + mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); + mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); + +} + +LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced() +{} + +void LLFloaterPreferenceViewAdvanced::onClickOk() +{ + closeFloater(); +} + +void LLFloaterPreferenceViewAdvanced::onClickCancel() +{ + gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); + gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); + + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); +} + +BOOL LLFloaterPreferenceViewAdvanced::postBuild() +{ + mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); + mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); + + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); + + return TRUE; +} + +void LLFloaterPreferenceViewAdvanced::updateCameraControl(LLVector3 vector) +{ + LLSpinCtrl* spinnerx = getChild("camera_x"); + LLSpinCtrl* spinnery = getChild("camera_y"); + LLSpinCtrl* spinnerz = getChild("camera_z"); + + if (!spinnerx || !spinnery || !spinnerz) + { + LL_WARNS() << "Could not find all desired UI camera elements" + << LL_ENDL; + return; + } + + if (!spinnerx->hasFocus()) + { + spinnerx->setValue(vector[VX]); + } + + if (!spinnery->hasFocus()) + { + spinnery->setValue(vector[VY]); + } + + if (!spinnerz->hasFocus()) + { + spinnerz->setValue(vector[VZ]); + } +} + +void LLFloaterPreferenceViewAdvanced::updateFocusControl(LLVector3d vector3d) +{ + LLSpinCtrl* spinnerx = getChild("focus_x"); + LLSpinCtrl* spinnery = getChild("focus_y"); + LLSpinCtrl* spinnerz = getChild("focus_z"); + + if (!spinnerx || !spinnery || !spinnerz) + { + LL_WARNS() << "Could not find all desired UI focus elements" + << LL_ENDL; + return; + } + + if (!spinnerx->hasFocus()) + { + spinnerx->setValue(vector3d[VX]); + } + + if (!spinnery->hasFocus()) + { + spinnery->setValue(vector3d[VY]); + } + + if (!spinnerz->hasFocus()) + { + spinnerz->setValue(vector3d[VZ]); + } +} + + void LLFloaterPreferenceViewAdvanced::draw() +{ +// updateControl(); + LLFloater::draw(); +} + +void LLFloaterPreferenceViewAdvanced::onCommitSettings() +{ + LLVector3 vector; + LLVector3d vector3d; + + vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); + vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); + vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); + gSavedSettings.setVector3("CameraOffsetRearView", vector); + + vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); + vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); + vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); + gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); +} -- cgit v1.2.3 From b92b131f6df3bfc19f05804a13ee5aa505d372e4 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 26 Jan 2018 09:55:04 -0500 Subject: STORM-2145 Update floater spinners if values are changed elsewhere --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index ff80328acc..055c6f2232 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -130,7 +130,12 @@ void LLFloaterPreferenceViewAdvanced::updateFocusControl(LLVector3d vector3d) void LLFloaterPreferenceViewAdvanced::draw() { -// updateControl(); + static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); + static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); + + updateCameraControl(camera); + updateFocusControl(focus); + LLFloater::draw(); } -- cgit v1.2.3 From f0ae109b696671c5773a5084a7329d0b164b7735 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 2 Feb 2018 12:36:15 -0500 Subject: STORM-2145 Tiny optimizations --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 60 +++-------------------- 1 file changed, 8 insertions(+), 52 deletions(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index 055c6f2232..791ff79d87 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -70,62 +70,18 @@ BOOL LLFloaterPreferenceViewAdvanced::postBuild() return TRUE; } -void LLFloaterPreferenceViewAdvanced::updateCameraControl(LLVector3 vector) +void LLFloaterPreferenceViewAdvanced::updateCameraControl(const LLVector3& vector) { - LLSpinCtrl* spinnerx = getChild("camera_x"); - LLSpinCtrl* spinnery = getChild("camera_y"); - LLSpinCtrl* spinnerz = getChild("camera_z"); - - if (!spinnerx || !spinnery || !spinnerz) - { - LL_WARNS() << "Could not find all desired UI camera elements" - << LL_ENDL; - return; - } - - if (!spinnerx->hasFocus()) - { - spinnerx->setValue(vector[VX]); - } - - if (!spinnery->hasFocus()) - { - spinnery->setValue(vector[VY]); - } - - if (!spinnerz->hasFocus()) - { - spinnerz->setValue(vector[VZ]); - } + getChild("camera_x")->setValue(vector[VX]); + getChild("camera_y")->setValue(vector[VY]); + getChild("camera_z")->setValue(vector[VZ]); } -void LLFloaterPreferenceViewAdvanced::updateFocusControl(LLVector3d vector3d) +void LLFloaterPreferenceViewAdvanced::updateFocusControl(const LLVector3d& vector3d) { - LLSpinCtrl* spinnerx = getChild("focus_x"); - LLSpinCtrl* spinnery = getChild("focus_y"); - LLSpinCtrl* spinnerz = getChild("focus_z"); - - if (!spinnerx || !spinnery || !spinnerz) - { - LL_WARNS() << "Could not find all desired UI focus elements" - << LL_ENDL; - return; - } - - if (!spinnerx->hasFocus()) - { - spinnerx->setValue(vector3d[VX]); - } - - if (!spinnery->hasFocus()) - { - spinnery->setValue(vector3d[VY]); - } - - if (!spinnerz->hasFocus()) - { - spinnerz->setValue(vector3d[VZ]); - } + getChild("focus_x")->setValue(vector3d[VX]); + getChild("focus_y")->setValue(vector3d[VY]); + getChild("focus_z")->setValue(vector3d[VZ]); } void LLFloaterPreferenceViewAdvanced::draw() -- cgit v1.2.3 From 3e560022459bf3534b873a7f6499dfb5eb75a7d9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 11 Mar 2019 08:11:09 -0700 Subject: Tabs -> spaces. --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 74 +++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index 791ff79d87..e740a3a9cf 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -34,11 +34,11 @@ LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key) -: LLFloater(key) +: LLFloater(key) { - mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); - mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); - mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); + mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); + mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); + mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); } @@ -47,66 +47,66 @@ LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced() void LLFloaterPreferenceViewAdvanced::onClickOk() { - closeFloater(); + closeFloater(); } void LLFloaterPreferenceViewAdvanced::onClickCancel() { - gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); - gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); + gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); + gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); } BOOL LLFloaterPreferenceViewAdvanced::postBuild() { - mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); - mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); + mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); + mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); - return TRUE; + return TRUE; } void LLFloaterPreferenceViewAdvanced::updateCameraControl(const LLVector3& vector) { - getChild("camera_x")->setValue(vector[VX]); - getChild("camera_y")->setValue(vector[VY]); - getChild("camera_z")->setValue(vector[VZ]); + getChild("camera_x")->setValue(vector[VX]); + getChild("camera_y")->setValue(vector[VY]); + getChild("camera_z")->setValue(vector[VZ]); } void LLFloaterPreferenceViewAdvanced::updateFocusControl(const LLVector3d& vector3d) { - getChild("focus_x")->setValue(vector3d[VX]); - getChild("focus_y")->setValue(vector3d[VY]); - getChild("focus_z")->setValue(vector3d[VZ]); + getChild("focus_x")->setValue(vector3d[VX]); + getChild("focus_y")->setValue(vector3d[VY]); + getChild("focus_z")->setValue(vector3d[VZ]); } void LLFloaterPreferenceViewAdvanced::draw() { - static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); - static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); + static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); + static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); - updateCameraControl(camera); - updateFocusControl(focus); + updateCameraControl(camera); + updateFocusControl(focus); - LLFloater::draw(); + LLFloater::draw(); } void LLFloaterPreferenceViewAdvanced::onCommitSettings() { - LLVector3 vector; - LLVector3d vector3d; - - vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); - vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); - vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); - gSavedSettings.setVector3("CameraOffsetRearView", vector); - - vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); - vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); - vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); - gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); + LLVector3 vector; + LLVector3d vector3d; + + vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); + vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); + vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); + gSavedSettings.setVector3("CameraOffsetRearView", vector); + + vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); + vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); + vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); + gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); } -- cgit v1.2.3 From ac2fc3029f3b9b6ba182949c29a7919f2f87eb02 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 12 Mar 2019 08:56:26 -0700 Subject: Backout tabs v spaces changes. 'warn-on-failure:no-tabs' --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 74 +++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index e740a3a9cf..791ff79d87 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -34,11 +34,11 @@ LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key) -: LLFloater(key) +: LLFloater(key) { - mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); - mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); - mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); + mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); + mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); + mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); } @@ -47,66 +47,66 @@ LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced() void LLFloaterPreferenceViewAdvanced::onClickOk() { - closeFloater(); + closeFloater(); } void LLFloaterPreferenceViewAdvanced::onClickCancel() { - gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); - gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); + gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); + gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); } BOOL LLFloaterPreferenceViewAdvanced::postBuild() { - mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); - mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); + mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); + mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); + updateCameraControl(mCameraSaved); + updateFocusControl(mFocusSaved); - return TRUE; + return TRUE; } void LLFloaterPreferenceViewAdvanced::updateCameraControl(const LLVector3& vector) { - getChild("camera_x")->setValue(vector[VX]); - getChild("camera_y")->setValue(vector[VY]); - getChild("camera_z")->setValue(vector[VZ]); + getChild("camera_x")->setValue(vector[VX]); + getChild("camera_y")->setValue(vector[VY]); + getChild("camera_z")->setValue(vector[VZ]); } void LLFloaterPreferenceViewAdvanced::updateFocusControl(const LLVector3d& vector3d) { - getChild("focus_x")->setValue(vector3d[VX]); - getChild("focus_y")->setValue(vector3d[VY]); - getChild("focus_z")->setValue(vector3d[VZ]); + getChild("focus_x")->setValue(vector3d[VX]); + getChild("focus_y")->setValue(vector3d[VY]); + getChild("focus_z")->setValue(vector3d[VZ]); } void LLFloaterPreferenceViewAdvanced::draw() { - static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); - static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); + static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); + static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); - updateCameraControl(camera); - updateFocusControl(focus); + updateCameraControl(camera); + updateFocusControl(focus); - LLFloater::draw(); + LLFloater::draw(); } void LLFloaterPreferenceViewAdvanced::onCommitSettings() { - LLVector3 vector; - LLVector3d vector3d; - - vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); - vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); - vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); - gSavedSettings.setVector3("CameraOffsetRearView", vector); - - vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); - vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); - vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); - gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); + LLVector3 vector; + LLVector3d vector3d; + + vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); + vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); + vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); + gSavedSettings.setVector3("CameraOffsetRearView", vector); + + vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); + vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); + vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); + gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); } -- cgit v1.2.3 From c75d443c8359f0bceee2df2adc0a67b2890922ea Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 4 Nov 2019 20:35:34 +0200 Subject: SL-12186 WIP Updating UI for camera controls, including presets --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 40 +++-------------------- 1 file changed, 5 insertions(+), 35 deletions(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index 791ff79d87..57484d0d0a 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -25,6 +25,7 @@ */ #include "llviewerprecompiledheaders.h" +#include "llagentcamera.h" #include "llfloaterpreferenceviewadvanced.h" #include "llfloater.h" #include "llfloaterreg.h" @@ -36,40 +37,12 @@ LLFloaterPreferenceViewAdvanced::LLFloaterPreferenceViewAdvanced(const LLSD& key) : LLFloater(key) { - mCommitCallbackRegistrar.add("Cancel", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickCancel, this)); mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterPreferenceViewAdvanced::onCommitSettings, this)); - mCommitCallbackRegistrar.add("Ok", boost::bind(&LLFloaterPreferenceViewAdvanced::onClickOk, this)); - } LLFloaterPreferenceViewAdvanced::~LLFloaterPreferenceViewAdvanced() {} -void LLFloaterPreferenceViewAdvanced::onClickOk() -{ - closeFloater(); -} - -void LLFloaterPreferenceViewAdvanced::onClickCancel() -{ - gSavedSettings.setVector3("CameraOffsetRearView", mCameraSaved); - gSavedSettings.setVector3d("FocusOffsetRearView", mFocusSaved); - - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); -} - -BOOL LLFloaterPreferenceViewAdvanced::postBuild() -{ - mCameraSaved = gSavedSettings.getVector3("CameraOffsetRearView"); - mFocusSaved = gSavedSettings.getVector3d("FocusOffsetRearView"); - - updateCameraControl(mCameraSaved); - updateFocusControl(mFocusSaved); - - return TRUE; -} - void LLFloaterPreferenceViewAdvanced::updateCameraControl(const LLVector3& vector) { getChild("camera_x")->setValue(vector[VX]); @@ -86,11 +59,8 @@ void LLFloaterPreferenceViewAdvanced::updateFocusControl(const LLVector3d& vecto void LLFloaterPreferenceViewAdvanced::draw() { - static LLCachedControl camera(gSavedSettings, "CameraOffsetRearView"); - static LLCachedControl focus(gSavedSettings, "FocusOffsetRearView"); - - updateCameraControl(camera); - updateFocusControl(focus); + updateCameraControl(gAgentCamera.getCameraOffsetInitial()); + updateFocusControl(gAgentCamera.getFocusOffsetInitial()); LLFloater::draw(); } @@ -103,10 +73,10 @@ void LLFloaterPreferenceViewAdvanced::onCommitSettings() vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); - gSavedSettings.setVector3("CameraOffsetRearView", vector); + gSavedSettings.setVector3(gAgentCamera.getCameraOffsetCtrlName(), vector); vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); - gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); + gSavedSettings.setVector3d(gAgentCamera.getFocusOffsetCtrlName(), vector3d); } -- cgit v1.2.3 From 7637f343865960ee509ae31205c097f0bb04aac1 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 13 Nov 2019 17:39:40 +0200 Subject: SL-12186 WIP Get rid of excessive offset settings as we moved to store data in xml --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterpreferenceviewadvanced.cpp') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index 57484d0d0a..f8db738923 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -73,10 +73,10 @@ void LLFloaterPreferenceViewAdvanced::onCommitSettings() vector.mV[VX] = (F32)getChild("camera_x")->getValue().asReal(); vector.mV[VY] = (F32)getChild("camera_y")->getValue().asReal(); vector.mV[VZ] = (F32)getChild("camera_z")->getValue().asReal(); - gSavedSettings.setVector3(gAgentCamera.getCameraOffsetCtrlName(), vector); + gSavedSettings.setVector3("CameraOffsetRearView", vector); vector3d.mdV[VX] = (F32)getChild("focus_x")->getValue().asReal(); vector3d.mdV[VY] = (F32)getChild("focus_y")->getValue().asReal(); vector3d.mdV[VZ] = (F32)getChild("focus_z")->getValue().asReal(); - gSavedSettings.setVector3d(gAgentCamera.getFocusOffsetCtrlName(), vector3d); + gSavedSettings.setVector3d("FocusOffsetRearView", vector3d); } -- cgit v1.2.3