summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
-rw-r--r--indra/newview/lltoolmgr.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 2f8e464b71..b0e3b5bf89 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -83,6 +83,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::EnableCallbackRegistry::currentRegistrar().add("Build.EnabledOrActive", boost::bind(&LLToolMgr::buildEnabledOrActive, this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Marketplace.Enabled", boost::bind(&LLToolMgr::canAccessMarketplace, this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Marketplace.Toggle", boost::bind(&LLToolMgr::toggleMarketplace, this, _2));
@@ -264,17 +265,21 @@ bool LLToolMgr::canEdit()
return LLViewerParcelMgr::getInstance()->allowAgentBuild();
}
+bool LLToolMgr::buildEnabledOrActive()
+{
+ return inEdit() || canEdit();
+}
+
void LLToolMgr::toggleBuildMode(const LLSD& sdname)
{
const std::string& param = sdname.asString();
+ LLFloaterReg::toggleInstanceOrBringToFront("build");
if (param == "build" && !canEdit())
{
return;
}
- LLFloaterReg::toggleInstanceOrBringToFront("build");
-
bool build_visible = LLFloaterReg::instanceVisible("build");
if (build_visible)
{