summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-10-20 15:28:52 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-10-20 15:28:52 -0700
commit54118511c04323c5ae5d43a9d7f7b8639531d541 (patch)
tree8b6a9061593a53e3c9d83d9c28877447e28569ac /indra/newview/lltoolmgr.cpp
parentecdd689e23cbe4b509fb885107b96b455739a497 (diff)
parent6998c5ebc7aad43d44f1bb6e42e20503c2ff144f (diff)
merge
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
-rw-r--r--indra/newview/lltoolmgr.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 51c0e2eeed..6bc7c6de11 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -247,24 +247,10 @@ bool LLToolMgr::canEdit()
void LLToolMgr::toggleBuildMode()
{
- if (inBuildMode())
- {
- if (gSavedSettings.getBOOL("EditCameraMovement"))
- {
- // just reset the view, will pull us out of edit mode
- handle_reset_view();
- }
- else
- {
- // manually disable edit mode, but do not affect the camera
- gAgentCamera.resetView(false);
- LLFloaterReg::hideInstance("build");
- gViewerWindow->showCursor();
- }
- // avoid spurious avatar movements pulling out of edit mode
- LLViewerJoystick::getInstance()->setNeedsReset();
- }
- else
+ LLFloaterReg::toggleInstanceOrBringToFront("build");
+
+ bool build_visible = LLFloaterReg::instanceVisible("build");
+ if (build_visible)
{
ECameraMode camMode = gAgentCamera.getCameraMode();
if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode)
@@ -291,7 +277,7 @@ void LLToolMgr::toggleBuildMode()
}
}
-
+
setCurrentToolset(gBasicToolset);
getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
@@ -304,6 +290,24 @@ void LLToolMgr::toggleBuildMode()
LLViewerJoystick::getInstance()->setNeedsReset();
}
+ else
+ {
+ if (gSavedSettings.getBOOL("EditCameraMovement"))
+ {
+ // just reset the view, will pull us out of edit mode
+ handle_reset_view();
+ }
+ else
+ {
+ // manually disable edit mode, but do not affect the camera
+ gAgentCamera.resetView(false);
+ LLFloaterReg::hideInstance("build");
+ gViewerWindow->showCursor();
+ }
+ // avoid spurious avatar movements pulling out of edit mode
+ LLViewerJoystick::getInstance()->setNeedsReset();
+ }
+
}
bool LLToolMgr::inBuildMode()