Commit 3cfe5fcf authored by NiranV's avatar NiranV
Browse files

Added: Camera Roll status button to reset camera roll when not default.

parent 8333645c
......@@ -21,6 +21,7 @@
#include "bdposingmotion.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llvoavatarself.h"
#include "llselectmgr.h"
#include "pipeline.h"
......@@ -42,12 +43,19 @@ BDStatus::~BDStatus()
void BDStatus::draw()
{
bool camera_roll = gAgentCamera.mCameraRollAngle != 0;
bool sitting = gAgent.isSitting();
if (!mSitting && sitting)
setSitting(true);
else if(mSitting && !sitting)
setSitting(false);
if (!mRoll && camera_roll)
setCameraRoll(true);
else if (mRoll && !camera_roll)
setCameraRoll(false);
LLPanel::draw();
}
......@@ -102,6 +110,11 @@ void BDStatus::setPosing(bool toggle)
gDragonStatus->mPosingLayout->setVisible(toggle);
}
void BDStatus::setCameraRoll(bool toggle)
{
gDragonStatus->mCameraRollLayout->setVisible(toggle);
}
BOOL BDStatus::postBuild()
{
mSittingButton = getChild<LLButton>("sitting_btn");
......@@ -112,6 +125,7 @@ BOOL BDStatus::postBuild()
mLockedDoFButton = getChild<LLButton>("locked_dof_btn");
mWorldFrozenButton = getChild<LLButton>("world_frozen_btn");
mPosingButton = getChild<LLButton>("posing_btn");
mCameraRollButton = getChild<LLButton>("camera_roll_btn");
mSittingLayout = getChild<LLLayoutPanel>("sitting_layout");
mFlyingLayout = getChild<LLLayoutPanel>("flying_layout");
......@@ -121,6 +135,7 @@ BOOL BDStatus::postBuild()
mLockedDoFLayout = getChild<LLLayoutPanel>("locked_dof_layout");
mWorldFrozenLayout = getChild<LLLayoutPanel>("world_frozen_layout");
mPosingLayout = getChild<LLLayoutPanel>("posing_layout");
mCameraRollLayout = getChild<LLLayoutPanel>("camera_roll_layout");
mSittingButton->setCommitCallback(boost::bind(&BDStatus::onSittingButtonClick, this));
mFlyingButton->setCommitCallback(boost::bind(&BDStatus::onFlyingButtonClick, this));
......@@ -130,6 +145,7 @@ BOOL BDStatus::postBuild()
mLockedDoFButton->setCommitCallback(boost::bind(&BDStatus::onLockedDoFButtonClick, this));
mWorldFrozenButton->setCommitCallback(boost::bind(&BDStatus::onWorldFrozenButtonClick, this));
mPosingButton->setCommitCallback(boost::bind(&BDStatus::onPosingButtonClick, this));
mCameraRollButton->setCommitCallback(boost::bind(&BDStatus::onCameraRollButtonClick, this));
return TRUE;
}
......@@ -199,3 +215,11 @@ void BDStatus::onPosingButtonClick()
setFocus(FALSE);
}
void BDStatus::onCameraRollButtonClick()
{
gAgentCamera.mCameraRollAngle = 0;
setCameraRoll(false);
setFocus(FALSE);
}
......@@ -54,6 +54,7 @@ class BDStatus
static void setLockedDoF(bool toggle);
static void setWorldFrozen(bool toggle);
static void setPosing(bool toggle);
static void setCameraRoll(bool toggle);
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
......@@ -68,6 +69,7 @@ class BDStatus
void onLockedDoFButtonClick();
void onWorldFrozenButtonClick();
void onPosingButtonClick();
void onCameraRollButtonClick();
LLButton* mSittingButton;
LLButton* mFlyingButton;
......@@ -77,6 +79,7 @@ class BDStatus
LLButton* mLockedDoFButton;
LLButton* mWorldFrozenButton;
LLButton* mPosingButton;
LLButton* mCameraRollButton;
LLLayoutPanel* mSittingLayout;
LLLayoutPanel* mFlyingLayout;
......@@ -86,8 +89,10 @@ class BDStatus
LLLayoutPanel* mLockedDoFLayout;
LLLayoutPanel* mWorldFrozenLayout;
LLLayoutPanel* mPosingLayout;
LLLayoutPanel* mCameraRollLayout;
bool mSitting;
bool mRoll;
};
extern BDStatus *gDragonStatus;
......
......@@ -241,6 +241,32 @@
<layout_panel
follows="all"
layout="topleft"
height="23"
auto_resize="false"
background_visible="true"
bg_alpha_color="0 0 0 0.5"
visible="false"
name="camera_roll_layout"
width="110">
<button
follows="left|bottom"
height="22"
label="Camera Roll"
layout="topleft"
left="0"
name="camera_roll_btn"
tool_tip="Your camera is currently not leveled"
image_overlay_alignment="left"
image_overlay="Command_View_Icon"
image_hover_unselected="Toolbar_Middle_Over"
image_selected="Toolbar_Middle_Selected"
image_unselected="Toolbar_Middle_Off"
top="0"
width="110" />
</layout_panel>
<layout_panel
follows="all"
layout="topleft"
mouse_opaque="false"
height="21"
auto_resize="true"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment