diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-26 20:47:27 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-26 20:47:27 +0000 |
commit | af98aad98d43ec8b128ecac3089426d6ae6edc3f (patch) | |
tree | 5971f87afc04580df470a003793dcc8c974e29a7 /indra/newview/llmoveview.cpp | |
parent | 6a364e6f32c12c1ab2c0f33e8ef07d885a8765a2 (diff) |
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3
EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r-- | indra/newview/llmoveview.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 92b1ecfd16..11c8b03f7f 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -36,6 +36,7 @@ // Library includes #include "indra_constants.h" +#include "llparcel.h" // Viewer includes @@ -51,6 +52,8 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" #include "llselectmgr.h" +#include "llviewerparcelmgr.h" +#include "llviewerregion.h" // // Constants @@ -137,6 +140,8 @@ BOOL LLFloaterMove::postBuild() initMovementMode(); + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); + return TRUE; } @@ -385,6 +390,15 @@ void LLFloaterMove::updatePosition() } setOrigin(x, y); } + +//static +void LLFloaterMove::sUpdateFlyingStatus() +{ + LLFloaterMove *floater = LLFloaterReg::findTypedInstance<LLFloaterMove>("moveview"); + if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); + +} + void LLFloaterMove::showModeButtons(BOOL bShow) { if (mModeActionsPanel->getVisible() == bShow) @@ -421,6 +435,8 @@ void LLFloaterMove::enableInstance(BOOL bEnable) void LLFloaterMove::onOpen(const LLSD& key) { updatePosition(); + + sUpdateFlyingStatus(); } void LLFloaterMove::showQuickTips(const EMovementMode mode) @@ -476,11 +492,12 @@ inline LLPanelStandStopFlying* LLPanelStandStopFlying::getInstance() void LLPanelStandStopFlying::setStandStopFlyingMode(EStandStopFlyingMode mode) { LLPanelStandStopFlying* panel = getInstance(); - panel->setVisible(TRUE); - BOOL standVisible = SSFM_STAND == mode; - panel->mStandButton->setVisible(standVisible); - panel->mStopFlyingButton->setVisible(!standVisible); + 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); } //static @@ -505,11 +522,12 @@ BOOL LLPanelStandStopFlying::postBuild() mStandButton = getChild<LLButton>("stand_btn"); mStandButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStandButtonClick, this)); mStandButton->setCommitCallback(boost::bind(&LLFloaterMove::enableInstance, TRUE)); + mStandButton->setVisible(FALSE); mStopFlyingButton = getChild<LLButton>("stop_fly_btn"); mStopFlyingButton->setCommitCallback(boost::bind(&LLFloaterMove::setFlyingMode, FALSE)); mStopFlyingButton->setCommitCallback(boost::bind(&LLPanelStandStopFlying::onStopFlyingButtonClick, this)); - + mStopFlyingButton->setVisible(FALSE); return TRUE; } @@ -517,6 +535,11 @@ BOOL LLPanelStandStopFlying::postBuild() //virtual void LLPanelStandStopFlying::setVisible(BOOL visible) { + //we dont need to show the panel if these buttons are not activated + if (visible && !mStandButton->getVisible() && !mStopFlyingButton->getVisible()) visible = false; + + if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) visible = false; + if (visible) { updatePosition(); |