diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 40a46f7046..b6841fdece 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -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("flycam_btn"); + mFlycamButton->setVisible(FALSE); + return TRUE; } diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index 94804adf65..ae32ef232a 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -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. diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index cd2614331d..55179c453f 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -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; } diff --git a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml index 849bc75f33..802fdc2531 100644 --- a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml @@ -6,7 +6,7 @@ name="panel_stand_stop_flying" mouse_opaque="false" visible="true" - width="78"> + width="160">