summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-11-18 10:45:40 -0500
committerLogan Dethrow <log@lindenlab.com>2011-11-18 10:45:40 -0500
commit3819c3b049abb0771c7129c0a11a8fcd0725f9fd (patch)
treef0bb1432b1ae475c7d844f278b668e1d76193e96 /indra/newview/lltoolmgr.cpp
parent620b63a31667d93d9186217eb355d05e71ff245c (diff)
parent4bcdcd02fb7e83a2754084f2fb599b56ea6c8743 (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()