diff options
-rw-r--r-- | indra/newview/llpathfindingmanager.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpathfindingmanager.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 2 |
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> |