From 626ee6777e68c0df36c82290c8e00eaebe43b8b4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Sep 2014 16:39:08 -0400 Subject: SL-92 WIP - can edit hover height debug setting via slider --- indra/newview/llfloaterhoverheight.cpp | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 indra/newview/llfloaterhoverheight.cpp (limited to 'indra/newview/llfloaterhoverheight.cpp') diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp new file mode 100755 index 0000000000..5222f7bb3f --- /dev/null +++ b/indra/newview/llfloaterhoverheight.cpp @@ -0,0 +1,59 @@ +/** +* @file llfloaterhoverheight.cpp +* @brief Controller for self avatar hover height +* @author vir@lindenlab.com +* +* $LicenseInfo:firstyear=2014&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2014, 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 "llfloaterhoverheight.h" +#include "llsliderctrl.h" +#include "llviewercontrol.h" + +LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key) +{ +} + +BOOL LLFloaterHoverHeight::postBuild() +{ + LLSliderCtrl* sldrCtrl = static_cast(ctrl); + + LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset"); + F32 value = offset[2]; + sldrCtrl->setValue(value,FALSE); + childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); + + return TRUE; +} + +// static +void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) +{ + LLSliderCtrl* sldrCtrl = static_cast(ctrl); + F32 value = sldrCtrl->getValueF32(); + + LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset"); + offset[2] = value; + gSavedSettings.setVector3("AvatarPosFinalOffset",offset); +} -- cgit v1.3 From 52ed6ac28697ffcfd7300602aec34db8eafc171a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 30 Sep 2014 15:34:16 -0400 Subject: SL-92 WIP - ui floater tweaks for hover height control --- indra/llui/llsliderctrl.cpp | 15 ++++++++++++++- indra/llui/llsliderctrl.h | 5 ++++- indra/newview/llfloaterhoverheight.cpp | 12 +++++++++++- indra/newview/llfloaterhoverheight.h | 2 ++ 4 files changed, 31 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterhoverheight.cpp') diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 62c5ecb8f1..2da39fa54b 100755 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -58,7 +58,8 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) mPrecision(p.decimal_digits), mTextEnabledColor(p.text_color()), mTextDisabledColor(p.text_disabled_color()), - mLabelWidth(p.label_width) + mLabelWidth(p.label_width), + mEditorCommitSignal(NULL) { S32 top = getRect().getHeight(); S32 bottom = 0; @@ -196,6 +197,11 @@ LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p) updateText(); } +LLSliderCtrl::~LLSliderCtrl() +{ + delete mEditorCommitSignal; +} + // static void LLSliderCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata ) { @@ -308,6 +314,8 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata ) if( success ) { self->onCommit(); + if (self->mEditorCommitSignal) + (*(self->mEditorCommitSignal))(self, self->getValueF32()); } else { @@ -421,6 +429,11 @@ boost::signals2::connection LLSliderCtrl::setSliderMouseUpCallback( const commit return mSlider->setMouseUpCallback( cb ); } +boost::signals2::connection LLSliderCtrl::setSliderEditorCommitCallback( const commit_signal_t::slot_type& cb ) +{ + if (!mEditorCommitSignal) mEditorCommitSignal = new commit_signal_t(); + return mEditorCommitSignal->connect(cb); +} void LLSliderCtrl::onTabInto() { if( mEditor ) diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index 5153e33f49..67cca9ef04 100755 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -81,7 +81,7 @@ protected: LLSliderCtrl(const Params&); friend class LLUICtrlFactory; public: - virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. + virtual ~LLSliderCtrl(); /*virtual*/ F32 getValueF32() const { return mSlider->getValueF32(); } void setValue(F32 v, BOOL from_event = FALSE); @@ -112,6 +112,7 @@ public: boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); + boost::signals2::connection setSliderEditorCommitCallback( const commit_signal_t::slot_type& cb ); /*virtual*/ void onTabInto(); @@ -150,6 +151,8 @@ private: LLUIColor mTextEnabledColor; LLUIColor mTextDisabledColor; + + commit_signal_t* mEditorCommitSignal; }; #endif // LL_LLSLIDERCTRL_H diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 5222f7bb3f..6f7f8374d2 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -37,11 +37,14 @@ LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key) BOOL LLFloaterHoverHeight::postBuild() { - LLSliderCtrl* sldrCtrl = static_cast(ctrl); LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset"); F32 value = offset[2]; + + LLSliderCtrl* sldrCtrl = getChild("HoverHeightSlider"); sldrCtrl->setValue(value,FALSE); + sldrCtrl->setSliderMouseUpCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); + sldrCtrl->setSliderEditorCommitCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); return TRUE; @@ -57,3 +60,10 @@ void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) offset[2] = value; gSavedSettings.setVector3("AvatarPosFinalOffset",offset); } + +// Do extra send-to-the-server work when slider drag completes, or new +// value entered as text. +void LLFloaterHoverHeight::onFinalCommit() +{ + LL_INFOS() << "FINAL FINAL!!!" << LL_ENDL; +} diff --git a/indra/newview/llfloaterhoverheight.h b/indra/newview/llfloaterhoverheight.h index 4ede8f08e0..1aede19e57 100755 --- a/indra/newview/llfloaterhoverheight.h +++ b/indra/newview/llfloaterhoverheight.h @@ -36,6 +36,8 @@ public: BOOL postBuild(); static void onSliderMoved(LLUICtrl* ctrl, void* userData); + + void onFinalCommit(); }; #endif -- cgit v1.3 From c9981ec59c4613531b2d5bb03f6ab8f6d914343c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 8 Dec 2014 13:12:28 -0500 Subject: SL-92 WIP - hover height communicated via appearance messages. --- indra/llmessage/message_prehash.cpp | 2 ++ indra/llmessage/message_prehash.h | 2 ++ indra/newview/app_settings/logcontrol.xml | 2 +- indra/newview/llfloaterhoverheight.cpp | 46 ++++++++++++++++++++++++++---- indra/newview/llfloaterhoverheight.h | 2 ++ indra/newview/llvoavatar.cpp | 30 +++++++++++++++++-- indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 2 ++ scripts/messages/message_template.msg | 4 +++ scripts/messages/message_template.msg.sha1 | 2 +- 10 files changed, 82 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloaterhoverheight.cpp') diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 39cfb6019e..a62b9c3227 100755 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1383,3 +1383,5 @@ char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()-> char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData"); char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion"); char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion"); +char const* const _PREHASH_AppearanceHover = LLMessageStringTable::getInstance()->getString("AppearanceHover"); +char const* const _PREHASH_HoverHeight = LLMessageStringTable::getInstance()->getString("HoverHeight"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 573e10dc0b..573c8e466f 100755 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1383,4 +1383,6 @@ extern char const* const _PREHASH_GroupAVSounds; extern char const* const _PREHASH_AppearanceData; extern char const* const _PREHASH_AppearanceVersion; extern char const* const _PREHASH_CofVersion; +extern char const* const _PREHASH_AppearanceHover; +extern char const* const _PREHASH_HoverHeight; #endif diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 29639bb9c2..de3732f339 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,8 +42,8 @@ tags - Avatar