SL-92 WIP - can edit hover height debug setting via slider

meow-7.2.2
Brad Payne (Vir Linden) 2014-09-29 16:39:08 -04:00
parent 2e0a8231d2
commit 626ee6777e
7 changed files with 136 additions and 1 deletions

View File

@ -244,6 +244,7 @@ set(viewer_SOURCE_FILES
llfloaterhandler.cpp
llfloaterhardwaresettings.cpp
llfloaterhelpbrowser.cpp
llfloaterhoverheight.cpp
llfloaterhud.cpp
llfloaterimagepreview.cpp
llfloaterimsessiontab.cpp
@ -848,6 +849,7 @@ set(viewer_HEADER_FILES
llfloaterhandler.h
llfloaterhardwaresettings.h
llfloaterhelpbrowser.h
llfloaterhoverheight.h
llfloaterhud.h
llfloaterimagepreview.h
llfloaterimnearbychat.h

View File

@ -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<LLSliderCtrl*>(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<LLSliderCtrl*>(ctrl);
F32 value = sldrCtrl->getValueF32();
LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset");
offset[2] = value;
gSavedSettings.setVector3("AvatarPosFinalOffset",offset);
}

View File

@ -0,0 +1,41 @@
/**
* @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);
};
#endif

View File

@ -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"
@ -220,7 +221,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>);

View File

@ -3871,6 +3871,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)
@ -6046,6 +6054,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"));
@ -8542,10 +8555,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

View File

@ -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"

View File

@ -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"