MAINT-1303 FIXED Hide menus and buttons after exiting mouselook if 'Hide all controls' is switched on.

master
maxim_productengine 2012-10-18 18:58:55 +03:00
parent 19f25eea3d
commit 9cc1dfd4e6
3 changed files with 38 additions and 17 deletions

View File

@ -14059,5 +14059,17 @@
<real>1.0</real>
</array>
</map>
<key>HideUIControls</key>
<map>
<key>Comment</key>
<string>Hide all menu items and buttons</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -35,6 +35,7 @@
#include "llfloaterreg.h"
#include "llhudmanager.h"
#include "lljoystickbutton.h"
#include "llmoveview.h"
#include "llselectmgr.h"
#include "llsmoothstep.h"
#include "lltoolmgr.h"
@ -2113,6 +2114,11 @@ void LLAgentCamera::changeCameraToDefault()
{
changeCameraToThirdPerson();
}
if (gSavedSettings.getBOOL("HideUIControls"))
{
gViewerWindow->setUIVisibility(false);
LLPanelStandStopFlying::getInstance()->setVisible(false);
}
}

View File

@ -3908,25 +3908,27 @@ class LLViewToggleUI : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
LLNotification::Params params("ConfirmHideUI");
params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2));
LLSD substitutions;
if(gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
{
LLNotification::Params params("ConfirmHideUI");
params.functor.function(boost::bind(&LLViewToggleUI::confirm, this, _1, _2));
LLSD substitutions;
#if LL_DARWIN
substitutions["SHORTCUT"] = "Cmd+Shift+U";
substitutions["SHORTCUT"] = "Cmd+Shift+U";
#else
substitutions["SHORTCUT"] = "Ctrl+Shift+U";
substitutions["SHORTCUT"] = "Ctrl+Shift+U";
#endif
params.substitutions = substitutions;
if (gViewerWindow->getUIVisibility())
{
// hiding, so show notification
LLNotifications::instance().add(params);
params.substitutions = substitutions;
if (!gSavedSettings.getBOOL("HideUIControls"))
{
// hiding, so show notification
LLNotifications::instance().add(params);
}
else
{
LLNotifications::instance().forceResponse(params, 0);
}
}
else
{
LLNotifications::instance().forceResponse(params, 0);
}
return true;
}
@ -3936,8 +3938,9 @@ class LLViewToggleUI : public view_listener_t
if (option == 0) // OK
{
gViewerWindow->setUIVisibility(!gViewerWindow->getUIVisibility());
LLPanelStandStopFlying::getInstance()->setVisible(gViewerWindow->getUIVisibility());
gViewerWindow->setUIVisibility(gSavedSettings.getBOOL("HideUIControls"));
LLPanelStandStopFlying::getInstance()->setVisible(gSavedSettings.getBOOL("HideUIControls"));
gSavedSettings.setBOOL("HideUIControls",!gSavedSettings.getBOOL("HideUIControls"));
}
}
};