diff options
author | Oz Linden <oz@lindenlab.com> | 2012-02-21 15:22:06 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-02-21 15:22:06 -0500 |
commit | eb7e48fc9015266fd2945873f12d925ffc6262ed (patch) | |
tree | 5e56836fbc98a104b2de4919933f71bfcfed7971 /indra | |
parent | 2ee9e7c159e2546cd81ce52fdffde40389aa7882 (diff) | |
parent | 065edd19d60737ee330b0f64defb301995fdb5fd (diff) |
merge changes for storm-1808
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/commands.xml | 2 | ||||
-rwxr-xr-x | indra/newview/llagent.cpp | 6 | ||||
-rw-r--r-- | indra/newview/lltoolmgr.cpp | 11 | ||||
-rw-r--r-- | indra/newview/lltoolmgr.h | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 1d1d39c786..73df064ab2 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -37,6 +37,8 @@ tooltip_ref="Command_Build_Tooltip" execute_function="Build.Toggle" execute_parameters="build" + is_enabled_function="Build.Enabled" + is_enabled_parameters="build" is_running_function="Floater.IsOpen" is_running_parameters="build" /> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ab9b5ff436..3870a3be2e 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -169,11 +169,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname) const std::string& param = sdname.asString(); - if (param == "build") - { - retval = gAgent.canEditParcel(); - } - else if (param == "speak") + if (param == "speak") { if ( gAgent.isVoiceConnected() && LLViewerParcelMgr::getInstance()->allowAgentVoice() && diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 6bc7c6de11..ac01316462 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -81,7 +81,7 @@ LLToolMgr::LLToolMgr() // Not a panel, register these callbacks globally. LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2)); gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -245,8 +245,15 @@ bool LLToolMgr::canEdit() return LLViewerParcelMgr::getInstance()->allowAgentBuild(); } -void LLToolMgr::toggleBuildMode() +void LLToolMgr::toggleBuildMode(const LLSD& sdname) { + const std::string& param = sdname.asString(); + + if (param == "build" && !canEdit()) + { + return; + } + LLFloaterReg::toggleInstanceOrBringToFront("build"); bool build_visible = LLFloaterReg::instanceVisible("build"); diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index d489c4c829..12649cfba2 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -54,7 +54,7 @@ public: bool inEdit(); bool canEdit(); - void toggleBuildMode(); + void toggleBuildMode(const LLSD& sdname); /* Determines if we are in Build mode or not. */ bool inBuildMode(); |