diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index a01874296d64c4dc08c9a74d39a7e4bf1f996103..bafcf5794416ec533efe43a4b3be19fcdc58db2f 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 5fa2b94def142186ef2a193e88670a116863bdc5..9aa3065d89d82cf785d11b6ef928a2ffbbd32473 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -67,6 +67,7 @@ class LLPathfindingManager : public LLSingleton<LLPathfindingManager> 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 47cafeb3f8b4a25abbdf87fc7ff1e860974ac87f..bcec9c6edab32bbaf1913802b958c92e498dd0c3 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 1682996c74894d689a91c9543aff9506ef8d92a6..f9a4acb1e33e80f16acc89fd5c38a28260b9d83f 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>