Commit 276e3f88 authored by NiranV's avatar NiranV
Browse files

Misc: Added bdstatus.cpp/h to CMakeLists.txt and fixed linking errors.

parent c06d633a
......@@ -121,6 +121,7 @@ set(viewer_SOURCE_FILES
bdfloaterobjects.cpp
bdfloaterposer.cpp
bdsidebar.cpp
bdstatus.cpp
bdposingmotion.cpp
exopostprocess.cpp
piemenu.cpp
......@@ -774,6 +775,7 @@ set(viewer_HEADER_FILES
bdfloaterobjects.h
bdfloaterposer.h
bdsidebar.h
bdstatus.h
bdposingmotion.h
exopostprocess.h
piemenu.h
......
/**
*
* Copyright (C) 2018, NiranV Dean
*
* 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.
*
*/
#include "llviewerprecompiledheaders.h"
#include "bdstatus.h"
#include "llagent.h"
#include "llselectmgr.h"
#include "pipeline.h"
#include "llviewercontrol.h"
#include "rlvactions.h"
BDStatus *gDragonStatus = NULL;
BDStatus::BDStatus(const LLRect& rect)
: LLPanel()
{
buildFromFile("panel_statuses.xml");
}
BDStatus::~BDStatus()
{
}
void BDStatus::draw()
{
LLPanel::draw();
}
//BD
void BDStatus::setSitting(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("sitting_layout")->setVisible(toggle);
}
void BDStatus::setFlying(bool toggle)
{
if(gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("flying_layout")->setVisible(toggle);
}
void BDStatus::setRunning(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("running_layout")->setVisible(toggle);
}
void BDStatus::setCrouching(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("crouching_layout")->setVisible(toggle);
}
void BDStatus::setFreeDoF(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("free_dof_layout")->setVisible(toggle);
}
void BDStatus::setLockedDoF(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("locked_dof_layout")->setVisible(toggle);
}
void BDStatus::setWorldFrozen(bool toggle)
{
if (gDragonStatus)
gDragonStatus->findChild<LLLayoutPanel>("world_frozen_layout")->setVisible(toggle);
}
void BDStatus::setPosing(bool toggle)
{
gDragonStatus->findChild<LLLayoutPanel>("posing_layout")->setVisible(toggle);
}
BOOL BDStatus::postBuild()
{
mSittingButton = getChild<LLButton>("sitting_btn");
mFlyingButton = getChild<LLButton>("flying_btn");
mRunningButton = getChild<LLButton>("running_btn");
mCrouchingButton = getChild<LLButton>("crouching_btn");
mFreeDoFButton = getChild<LLButton>("free_dof_btn");
mLockedDoFButton = getChild<LLButton>("locked_dof_btn");
mWorldFrozenButton = getChild<LLButton>("world_frozen_btn");
mPosingButton = getChild<LLButton>("posing_btn");
mSittingButton->setCommitCallback(boost::bind(&BDStatus::onSittingButtonClick, this));
mFlyingButton->setCommitCallback(boost::bind(&BDStatus::onFlyingButtonClick, this));
mRunningButton->setCommitCallback(boost::bind(&BDStatus::onRunningButtonClick, this));
mCrouchingButton->setCommitCallback(boost::bind(&BDStatus::onCrouchingButtonClick, this));
mFreeDoFButton->setCommitCallback(boost::bind(&BDStatus::onFreeDoFButtonClick, this));
mLockedDoFButton->setCommitCallback(boost::bind(&BDStatus::onLockedDoFButtonClick, this));
mWorldFrozenButton->setCommitCallback(boost::bind(&BDStatus::onWorldFrozenButtonClick, this));
mPosingButton->setCommitCallback(boost::bind(&BDStatus::onPosingButtonClick, this));
return TRUE;
}
void BDStatus::onSittingButtonClick()
{
// [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
if ((!RlvActions::isRlvEnabled()) || (RlvActions::canStand()))
{
LLSelectMgr::getInstance()->deselectAllForStandingUp();
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
}
// [/RLVa:KB]
// LLSelectMgr::getInstance()->deselectAllForStandingUp();
// gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
setFocus(FALSE);
}
void BDStatus::onFlyingButtonClick()
{
gAgent.setFlying(false);
setFocus(FALSE);
}
void BDStatus::onRunningButtonClick()
{
gAgent.clearAlwaysRun();
setFocus(FALSE);
}
void BDStatus::onCrouchingButtonClick()
{
//gAgent.clearCrouching();
setFocus(FALSE);
}
void BDStatus::onFreeDoFButtonClick()
{
gPipeline.CameraDoFLocked = FALSE;
setFocus(FALSE);
}
void BDStatus::onLockedDoFButtonClick()
{
gPipeline.CameraFreeDoFFocus = FALSE;
setFocus(FALSE);
}
void BDStatus::onWorldFrozenButtonClick()
{
gSavedSettings.setBOOL("UseFreezeWorld", FALSE);
setFocus(FALSE);
}
void BDStatus::onPosingButtonClick()
{
gAgent.clearPosing();
setFocus(FALSE);
}
/**
*
* Copyright (C) 2018, NiranV Dean
*
* 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.
*
*/
#ifndef BD_STATUS_H
#define BD_STATUS_H
#include <string>
#include "llsliderctrl.h"
#include "llbutton.h"
#include "lllayoutstack.h"
class LLComboBox;
class BDStatus
: public LLPanel
{
public:
BDStatus(const LLRect& rect);
/*virtual*/ ~BDStatus();
/*typedef enum status_mode
{
NONE = 0,
SITTING = 1,
FLYING = 2,
RUNNING = 4,
CROUCHING = 8,
FREE_DOF = 16,
LOCKED_DOF = 32,
WORLD_FROZEN = 64,
POSING = 128
} EStatusMode;*/
static void setSitting(bool toggle);
static void setFlying(bool toggle);
static void setRunning(bool toggle);
static void setCrouching(bool toggle);
static void setFreeDoF(bool toggle);
static void setLockedDoF(bool toggle);
static void setWorldFrozen(bool toggle);
static void setPosing(bool toggle);
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
private:
void onSittingButtonClick();
void onFlyingButtonClick();
void onRunningButtonClick();
void onCrouchingButtonClick();
void onFreeDoFButtonClick();
void onLockedDoFButtonClick();
void onWorldFrozenButtonClick();
void onPosingButtonClick();
//BD
LLButton* mSittingButton;
LLButton* mFlyingButton;
LLButton* mRunningButton;
LLButton* mCrouchingButton;
LLButton* mFreeDoFButton;
LLButton* mLockedDoFButton;
LLButton* mWorldFrozenButton;
LLButton* mPosingButton;
};
extern BDStatus *gDragonStatus;
#endif
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