Added Flycam button. Fixes FIRE-1348

ziree 2011-09-25 02:15:08 +02:00
parent 83dff1ccc9
commit ffbcd1e58e
4 changed files with 42 additions and 11 deletions

View File

@ -597,14 +597,20 @@ void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode)
{
LLPanelStandStopFlying* panel = getInstance();
if (mode == SSFM_STAND)
if (mode == SSFM_FLYCAM)
{
LLFirstUse::sit();
LLFirstUse::notMoving(false);
panel->mFlycamButton->setVisible(TRUE);
}
else
{
if (mode == SSFM_STAND)
{
LLFirstUse::sit();
LLFirstUse::notMoving(false);
}
panel->mStandButton->setVisible(SSFM_STAND == mode);
panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode);
}
panel->mStandButton->setVisible(SSFM_STAND == mode);
panel->mStopFlyingButton->setVisible(SSFM_STOP_FLYING == mode);
//visibility of it should be updated after updating visibility of the buttons
panel->setVisible(TRUE);
}
@ -620,6 +626,10 @@ void LLPanelStandStopFlying::clearStandStopFlyingMode(EStandStopFlyingMode mode)
case SSFM_STOP_FLYING:
panel->mStopFlyingButton->setVisible(FALSE);
break;
case SSFM_FLYCAM:
panel->mFlycamButton->setVisible(FALSE);
panel->setFocus(FALSE);
break;
default:
llerrs << "Unexpected EStandStopFlyingMode is passed: " << mode << llendl;
}
@ -638,7 +648,10 @@ BOOL LLPanelStandStopFlying::postBuild()
//mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE));
mStopFlyingButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStopFlyingButtonClick, this));
mStopFlyingButton->setVisible(FALSE);
mFlycamButton = getChild<LLButton>("flycam_btn");
mFlycamButton->setVisible(FALSE);
return TRUE;
}

View File

@ -127,7 +127,8 @@ public:
typedef enum stand_stop_flying_mode_t
{
SSFM_STAND,
SSFM_STOP_FLYING
SSFM_STOP_FLYING,
SSFM_FLYCAM
} EStandStopFlyingMode;
/**
@ -167,6 +168,7 @@ private:
LLButton* mStandButton;
LLButton* mStopFlyingButton;
LLButton* mFlycamButton;
/**
* The original parent of the panel.

View File

@ -39,7 +39,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llfocusmgr.h"
#include "llmoveview.h"
// ----------------------------------------------------------------------------
// Constants
@ -999,6 +999,7 @@ bool LLViewerJoystick::toggleFlycam()
if (!gSavedSettings.getBOOL("JoystickEnabled") || !gSavedSettings.getBOOL("JoystickFlycamEnabled"))
{
mOverrideCamera = false;
LLPanelStandStopFlying::clearStandStopFlyingMode(LLPanelStandStopFlying::SSFM_FLYCAM);
return false;
}
@ -1016,7 +1017,7 @@ bool LLViewerJoystick::toggleFlycam()
if (mOverrideCamera)
{
moveFlycam(true);
LLPanelStandStopFlying::setStandStopFlyingMode(LLPanelStandStopFlying::SSFM_FLYCAM);
}
else
{
@ -1024,6 +1025,7 @@ bool LLViewerJoystick::toggleFlycam()
// the main camera until the avatar moves, we need to track this situation.
setCameraNeedsUpdate(false);
setNeedsReset(true);
LLPanelStandStopFlying::clearStandStopFlyingMode(LLPanelStandStopFlying::SSFM_FLYCAM);
}
return true;
}

View File

@ -6,7 +6,7 @@
name="panel_stand_stop_flying"
mouse_opaque="false"
visible="true"
width="78">
width="160">
<button
follows="left|bottom"
height="19"
@ -29,4 +29,18 @@
top="2"
visible="false"
width="77" />
<button
follows="left|bottom"
height="19"
label="Flycam"
layout="topleft"
left="80"
name="flycam_btn"
tool_tip="Stop Flycam Mode"
top="2"
visible="true"
width="77">
<commit_callback
function="View.JoystickFlycam" />
</button>
</panel>