summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-06-25 18:17:56 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-06-25 18:17:56 -0700
commitc9fea8b43cfb50d1e8406ea87f47c51daea7cef1 (patch)
tree70c3ddfad433c1c945d5b718d80c1c9869af9da8 /indra
parentce101172954c9cbc9a089d8796643d545bdee9d5 (diff)
PATH-718: Disabling the view/test menu in the case of a stubbed llphysicsextensions library.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpathfindingmanager.cpp5
-rw-r--r--indra/newview/llpathfindingmanager.h1
-rw-r--r--indra/newview/llviewermenu.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml2
4 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index a01874296d..bafcf57944 100644
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -311,6 +311,11 @@ void LLPathfindingManager::quitSystem()
}
}
+bool LLPathfindingManager::isPathfindingViewEnabled() const
+{
+ return (LLPathingLib::getInstance() != NULL);
+}
+
bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const
{
return isPathfindingEnabledForRegion(getCurrentRegion());
diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h
index 5fa2b94def..9aa3065d89 100644
--- a/indra/newview/llpathfindingmanager.h
+++ b/indra/newview/llpathfindingmanager.h
@@ -67,6 +67,7 @@ public:
void initSystem();
void quitSystem();
+ bool isPathfindingViewEnabled() const;
bool isPathfindingEnabledForCurrentRegion() const;
bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 47cafeb3f8..bcec9c6eda 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4886,6 +4886,14 @@ class LLToolsEnablePathfinding : public view_listener_t
}
};
+class LLToolsEnablePathfindingView : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingViewEnabled();
+ }
+};
+
// Round the position of all root objects to the grid
class LLToolsSnapObjectXY : public view_listener_t
{
@@ -8281,6 +8289,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory");
view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding");
+ view_listener_t::addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");
// Help menu
// most items use the ShowFloater method
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1682996c74..f9a4acb1e3 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -967,7 +967,7 @@
function="Floater.ToggleOrBringToFront"
parameter="pathfinding_console" />
<menu_item_call.on_enable
- function="Tools.EnablePathfinding" />
+ function="Tools.EnablePathfindingView" />
</menu_item_call>
</menu>