Commit ed7545c4 authored by NiranV's avatar NiranV
Browse files

Fixed: Sitting status button not showing in all different conditions of sitting.

parent f452304d
......@@ -38,7 +38,13 @@ BDStatus::~BDStatus()
}
void BDStatus::draw()
{
{
bool sitting = gAgent.isSitting();
if (!mSitting && sitting)
setSitting(true);
else if(mSitting && !sitting)
setSitting(false);
LLPanel::draw();
}
......@@ -46,48 +52,51 @@ void BDStatus::draw()
void BDStatus::setSitting(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("sitting_layout")->setVisible(toggle);
{
gDragonStatus->mSittingLayout->setVisible(toggle);
gDragonStatus->mSitting = toggle;
}
}
void BDStatus::setFlying(bool toggle)
{
if(gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("flying_layout")->setVisible(toggle);
gDragonStatus->mFlyingLayout->setVisible(toggle);
}
void BDStatus::setRunning(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("running_layout")->setVisible(toggle);
gDragonStatus->mRunningLayout->setVisible(toggle);
}
void BDStatus::setCrouching(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("crouching_layout")->setVisible(toggle);
gDragonStatus->mCrouchingLayout->setVisible(toggle);
}
void BDStatus::setFreeDoF(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("free_dof_layout")->setVisible(toggle);
gDragonStatus->mFreeDoFLayout->setVisible(toggle);
}
void BDStatus::setLockedDoF(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("locked_dof_layout")->setVisible(toggle);
gDragonStatus->mLockedDoFLayout->setVisible(toggle);
}
void BDStatus::setWorldFrozen(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("world_frozen_layout")->setVisible(toggle);
gDragonStatus->mWorldFrozenLayout->setVisible(toggle);
}
void BDStatus::setPosing(bool toggle)
{
gDragonStatus->findChild<LLLayoutPanel>("posing_layout")->setVisible(toggle);
gDragonStatus->mPosingLayout->setVisible(toggle);
}
BOOL BDStatus::postBuild()
......@@ -101,6 +110,15 @@ BOOL BDStatus::postBuild()
mWorldFrozenButton = getChild<LLButton>("world_frozen_btn");
mPosingButton = getChild<LLButton>("posing_btn");
mSittingLayout = getChild<LLLayoutPanel>("sitting_layout");
mFlyingLayout = getChild<LLLayoutPanel>("flying_layout");
mRunningLayout = getChild<LLLayoutPanel>("running_layout");
mCrouchingLayout = getChild<LLLayoutPanel>("crouching_layout");
mFreeDoFLayout = getChild<LLLayoutPanel>("free_dof_layout");
mLockedDoFLayout = getChild<LLLayoutPanel>("locked_dof_layout");
mWorldFrozenLayout = getChild<LLLayoutPanel>("world_frozen_layout");
mPosingLayout = getChild<LLLayoutPanel>("posing_layout");
mSittingButton->setCommitCallback(boost::bind(&BDStatus::onSittingButtonClick, this));
mFlyingButton->setCommitCallback(boost::bind(&BDStatus::onFlyingButtonClick, this));
mRunningButton->setCommitCallback(boost::bind(&BDStatus::onRunningButtonClick, this));
......
......@@ -69,7 +69,6 @@ class BDStatus
void onWorldFrozenButtonClick();
void onPosingButtonClick();
//BD
LLButton* mSittingButton;
LLButton* mFlyingButton;
LLButton* mRunningButton;
......@@ -78,6 +77,17 @@ class BDStatus
LLButton* mLockedDoFButton;
LLButton* mWorldFrozenButton;
LLButton* mPosingButton;
LLLayoutPanel* mSittingLayout;
LLLayoutPanel* mFlyingLayout;
LLLayoutPanel* mRunningLayout;
LLLayoutPanel* mCrouchingLayout;
LLLayoutPanel* mFreeDoFLayout;
LLLayoutPanel* mLockedDoFLayout;
LLLayoutPanel* mWorldFrozenLayout;
LLLayoutPanel* mPosingLayout;
bool mSitting;
};
extern BDStatus *gDragonStatus;
......
......@@ -990,9 +990,6 @@ void LLAgent::standUp()
if ( (!rlv_handler_t::isEnabled()) || (RlvActions::canStand()) )
{
setControlFlags(AGENT_CONTROL_STAND_UP);
//BD
gDragonStatus->setSitting(false);
}
// [/RLVa:KB]
}
......@@ -1354,9 +1351,6 @@ void LLAgent::sitDown()
// [/RLVa:KB]
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
//BD
gDragonStatus->setSitting(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