From 1f5c2c056ff2b660b053cf3a7344fdf1c5c15b0e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 8 Feb 2012 18:25:35 -0500 Subject: STORM-1808 Indicate ability to build --- indra/newview/app_settings/commands.xml | 2 ++ indra/newview/llagent.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 1d1d39c786..16a7e0b314 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="Agent.IsActionAllowed" + 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..f0add8ddc4 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -171,7 +171,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname) if (param == "build") { - retval = gAgent.canEditParcel(); + retval = LLViewerParcelMgr::getInstance()->allowAgentBuild(); } else if (param == "speak") { -- cgit v1.2.3 From 566bbe7e09bf9cd9939cfae40773d86993803d1b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 19 Feb 2012 14:06:32 -0500 Subject: STORM-1808 Recode so build button is not clickable when grayed out --- indra/newview/app_settings/commands.xml | 4 ++-- indra/newview/llagent.cpp | 6 +----- indra/newview/lltoolmgr.cpp | 11 +++++++++-- indra/newview/lltoolmgr.h | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 16a7e0b314..12ce45717b 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -37,10 +37,10 @@ tooltip_ref="Command_Build_Tooltip" execute_function="Build.Toggle" execute_parameters="build" - is_enabled_function="Agent.IsActionAllowed" + is_enabled_function="Build.Enabled" is_enabled_parameters="build" is_running_function="Floater.IsOpen" - is_running_parameters="build" + is_running_parameters="toolbox floater" /> allowAgentBuild(); - } - 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(); -- cgit v1.2.3 From 065edd19d60737ee330b0f64defb301995fdb5fd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 19 Feb 2012 16:20:47 -0500 Subject: STORM-1808 Fix wrong name in xml file --- indra/newview/app_settings/commands.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 12ce45717b..73df064ab2 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -40,7 +40,7 @@ is_enabled_function="Build.Enabled" is_enabled_parameters="build" is_running_function="Floater.IsOpen" - is_running_parameters="toolbox floater" + is_running_parameters="build" />