diff options
| -rwxr-xr-x | indra/llui/llsliderctrl.cpp | 15 | ||||
| -rwxr-xr-x | indra/llui/llsliderctrl.h | 5 | ||||
| -rwxr-xr-x | indra/newview/CMakeLists.txt | 2 | ||||
| -rwxr-xr-x | indra/newview/app_settings/logcontrol.xml | 1 | ||||
| -rwxr-xr-x | indra/newview/app_settings/settings.xml | 15 | ||||
| -rwxr-xr-x | indra/newview/llfloaterhoverheight.cpp | 69 | ||||
| -rwxr-xr-x | indra/newview/llfloaterhoverheight.h | 43 | ||||
| -rwxr-xr-x | indra/newview/llfloaterperms.cpp | 11 | ||||
| -rwxr-xr-x | indra/newview/llviewerfloaterreg.cpp | 4 | ||||
| -rwxr-xr-x | indra/newview/llviewermenu.cpp | 15 | ||||
| -rwxr-xr-x | indra/newview/llvoavatar.cpp | 6 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/floater_edit_hover_height.xml | 39 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/menu_attachment_self.xml | 8 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/menu_avatar_self.xml | 8 | 
14 files changed, 235 insertions, 6 deletions
| 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/CMakeLists.txt b/indra/newview/CMakeLists.txt index e8f4144e70..5f4c1c5aa9 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -244,6 +244,7 @@ set(viewer_SOURCE_FILES      llfloaterhandler.cpp      llfloaterhardwaresettings.cpp      llfloaterhelpbrowser.cpp +    llfloaterhoverheight.cpp      llfloaterhud.cpp      llfloaterimagepreview.cpp      llfloaterimsessiontab.cpp @@ -849,6 +850,7 @@ set(viewer_HEADER_FILES      llfloaterhandler.h      llfloaterhardwaresettings.h      llfloaterhelpbrowser.h +    llfloaterhoverheight.h      llfloaterhud.h      llfloaterimagepreview.h      llfloaterimnearbychat.h diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 15cb5bc0eb..29639bb9c2 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,6 +42,7 @@  						</array>  					<key>tags</key>  						<array> +						     <string>Avatar</string>  						<!-- sample entry for debugging specific items	  						     <string>Inventory</string>  						     <string>SceneLoadTiming</string> diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f2fb9e854f..ca74b759ff 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -654,6 +654,21 @@        <key>Value</key>        <integer>2</integer>      </map> +    <key>AvatarPosFinalOffset</key> +    <map> +      <key>Comment</key> +      <string>After-everything-else fixup for avatar position.</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Vector3</string> +      <key>Value</key> +      <array> +        <real>0.0</real> +        <real>0.0</real> +        <real>0.0</real> +      </array> +    </map>      <key>AvatarPickerURL</key>      <map>        <key>Comment</key> diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp new file mode 100755 index 0000000000..6f7f8374d2 --- /dev/null +++ b/indra/newview/llfloaterhoverheight.cpp @@ -0,0 +1,69 @@ +/**  +* @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() +{ + +	LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset"); +	F32 value = offset[2]; + +	LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("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; +} + +// static +void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) +{ +	LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); +	F32 value = sldrCtrl->getValueF32(); + +	LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset"); +	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 new file mode 100755 index 0000000000..1aede19e57 --- /dev/null +++ b/indra/newview/llfloaterhoverheight.h @@ -0,0 +1,43 @@ +/**  +* @file   llfloaterhoverheight.h +* @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$ +*/ +#ifndef LL_LLFLOATERHOVERHEIGHT_H +#define LL_LLFLOATERHOVERHEIGHT_H + +#include "llfloater.h" + +class LLFloaterHoverHeight: public LLFloater +{ +public: +	LLFloaterHoverHeight(const LLSD& key); +	BOOL postBuild(); + +	static void onSliderMoved(LLUICtrl* ctrl, void* userData); + +	void onFinalCommit(); +}; + +#endif diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 0880a5f35a..849aa7cd14 100755 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -35,6 +35,8 @@  #include "llagent.h"  #include "llviewerregion.h"  #include "llnotificationsutil.h" +#include "llsdserialize.h" +#include "llvoavatar.h"  LLFloaterPerms::LLFloaterPerms(const LLSD& seed)  : LLFloater(seed) @@ -171,8 +173,9 @@ public:  private:  	static	std::string sPreviousReason; -	void error(U32 status, const std::string& reason) +	void httpFailure()  	{ +		const std::string& reason = getReason();  		// Do not display the same error more than once in a row  		if (reason != sPreviousReason)  		{ @@ -182,8 +185,12 @@ private:  			LLNotificationsUtil::add("DefaultObjectPermissions", args);  		}  	} -	void result(const LLSD& content) + +	void httpSuccess()  	{ +		//const LLSD& content = getContent(); +		//dump_sequential_xml("perms_responder_result.xml", content); +  		// Since we have had a successful POST call be sure to display the next error message  		// even if it is the same as a previous one.  		sPreviousReason = ""; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e19fe9ca75..fc18b20758 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -70,6 +70,7 @@  #include "llfloatergroups.h"  #include "llfloaterhardwaresettings.h"  #include "llfloaterhelpbrowser.h" +#include "llfloaterhoverheight.h"  #include "llfloaterhud.h"  #include "llfloaterimagepreview.h"  #include "llfloaterimsession.h" @@ -221,7 +222,8 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("god_tools", "floater_god_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGodTools>);  	LLFloaterReg::add("group_picker", "floater_choose_group.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGroupPicker>); -	LLFloaterReg::add("help_browser", "floater_help_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHelpBrowser>);	 +	LLFloaterReg::add("help_browser", "floater_help_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHelpBrowser>); +	LLFloaterReg::add("edit_hover_height", "floater_edit_hover_height.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHoverHeight>);  	LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>);  	LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterIMSession>); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3abeba4b43..302dd6f889 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3881,6 +3881,14 @@ class LLEnableEditShape : public view_listener_t  	}  }; +class LLEnableHoverHeight : public view_listener_t +{ +	bool handleEvent(const LLSD& userdata) +	{ +		return true; +	} +}; +  class LLEnableEditPhysics : public view_listener_t  {  	bool handleEvent(const LLSD& userdata) @@ -6075,6 +6083,11 @@ void handle_edit_shape()  	LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_shape"));  } +void handle_hover_height() +{ +	LLFloaterReg::showInstance("edit_hover_height"); +} +  void handle_edit_physics()  {  	LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_physics")); @@ -8571,10 +8584,12 @@ void initialize_menus()  	view_listener_t::addMenu(new LLEditEnableTakeOff(), "Edit.EnableTakeOff");  	view_listener_t::addMenu(new LLEditEnableCustomizeAvatar(), "Edit.EnableCustomizeAvatar");  	view_listener_t::addMenu(new LLEnableEditShape(), "Edit.EnableEditShape"); +	view_listener_t::addMenu(new LLEnableHoverHeight(), "Edit.EnableHoverHeight");  	view_listener_t::addMenu(new LLEnableEditPhysics(), "Edit.EnableEditPhysics");  	commit.add("CustomizeAvatar", boost::bind(&handle_customize_avatar));  	commit.add("EditOutfit", boost::bind(&handle_edit_outfit));  	commit.add("EditShape", boost::bind(&handle_edit_shape)); +	commit.add("HoverHeight", boost::bind(&handle_hover_height));  	commit.add("EditPhysics", boost::bind(&handle_edit_physics));  	// View menu diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3f94074ab3..2c1dedede0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3411,9 +3411,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  		// correct for the fact that the pelvis is not necessarily the center   		// of the agent's physical representation  		root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; +		root_pos += LLVector3d(gSavedSettings.getVector3("AvatarPosFinalOffset"));  		LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); +  		if (newPosition != mRoot->getXform()->getWorldPosition())  		{		  			mRoot->touch(); @@ -3578,7 +3580,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)  	}  	else if (mDrawable.notNull())  	{ -		mRoot->setPosition(mDrawable->getPosition()); +		LLVector3 pos = mDrawable->getPosition(); +		pos += gSavedSettings.getVector3("AvatarPosFinalOffset"); +		mRoot->setPosition(pos);  		mRoot->setRotation(mDrawable->getRotation());  	} diff --git a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml new file mode 100755 index 0000000000..29d06b9b4e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + positioning="cascading" + ignore_ui_scale="false" + legacy_header_height="225" + can_minimize="true" + can_close="true" + can_resize="true" + min_height="65" + min_width="515" + height="65" + layout="topleft" + name="HoverHeight" + single_instance="true" + help_topic="hover_height" + save_rect="true" + save_visibility="true" + title="SET HOVER HEIGHT" + width="515"> +      <slider +     control_name="HoverHeightSlider" +     decimal_digits="3" +     follows="top|left" +     height="15" +     increment="0.001" +     max_val="2" +     min_val="-2" +     initial_value="0.0" +     label="Height" +     label_width="60" +     left="10" +     width="501" +     layout="topleft" +     name="HoverHeightSlider" +     top="35" +     can_edit_text="true" +     > +    </slider> +</floater> diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index bcbc8d5b86..c6ae844d67 100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -91,6 +91,14 @@ name="Edit Outfit">      <menu_item_call.on_enable       function="Edit.EnableEditShape" />    </menu_item_call> +  <menu_item_call label="Hover Height" +     layout="topleft" +     name="Hover Height"> +     <menu_item_call.on_click +      function="HoverHeight" /> +     <menu_item_call.on_enable +      function="Edit.EnableHoverHeight" /> +  </menu_item_call>    <menu_item_call      label="My Friends"      layout="topleft" diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml index ca0c9bd5e4..d3b0b07f70 100755 --- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml @@ -229,6 +229,14 @@         <menu_item_call.on_enable          function="Edit.EnableEditShape" />     </menu_item_call> +   <menu_item_call label="Hover Height" +     layout="topleft" +     name="Hover Height"> +     <menu_item_call.on_click +      function="HoverHeight" /> +     <menu_item_call.on_enable +      function="Edit.EnableHoverHeight" /> +   </menu_item_call>     <menu_item_call       label="My Friends"       layout="topleft" | 
