PATH-718: Disabling the view/test menu in the case of a stubbed llphysicsextensions library.

master
Todd Stinson 2012-06-25 18:17:56 -07:00
parent ce10117295
commit c9fea8b43c
4 changed files with 16 additions and 1 deletions

View File

@ -311,6 +311,11 @@ void LLPathfindingManager::quitSystem()
}
}
bool LLPathfindingManager::isPathfindingViewEnabled() const
{
return (LLPathingLib::getInstance() != NULL);
}
bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const
{
return isPathfindingEnabledForRegion(getCurrentRegion());

View File

@ -67,6 +67,7 @@ public:
void initSystem();
void quitSystem();
bool isPathfindingViewEnabled() const;
bool isPathfindingEnabledForCurrentRegion() const;
bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const;

View File

@ -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

View File

@ -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>