Moved region rebake button to 'Tools' menu
This commit is contained in:
@@ -183,6 +183,7 @@
|
||||
#include "llmenugl.h"
|
||||
#include "llmimetypes.h"
|
||||
#include "llmorphview.h"
|
||||
#include "llmenuoptionpathfindingrebakenavmesh.h"
|
||||
#include "llmoveview.h"
|
||||
#include "llmutelist.h"
|
||||
#include "llnotify.h"
|
||||
@@ -5327,6 +5328,39 @@ class LLToolsEnablePathfindingView : public view_listener_t
|
||||
}
|
||||
};
|
||||
|
||||
class LLToolsDoPathfindingRebakeRegion : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool hasPathfinding = (LLPathfindingManager::getInstance() != NULL);
|
||||
|
||||
if (hasPathfinding)
|
||||
{
|
||||
LLMenuOptionPathfindingRebakeNavmesh::getInstance()->sendRequestRebakeNavmesh();
|
||||
}
|
||||
|
||||
return hasPathfinding;
|
||||
}
|
||||
};
|
||||
|
||||
class LLToolsEnablePathfindingRebakeRegion : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
bool returnValue = false;
|
||||
|
||||
if (LLPathfindingManager::getInstance() != NULL)
|
||||
{
|
||||
LLMenuOptionPathfindingRebakeNavmesh *rebakeInstance = LLMenuOptionPathfindingRebakeNavmesh::getInstance();
|
||||
returnValue = (rebakeInstance->canRebakeRegion() &&
|
||||
(rebakeInstance->getMode() == LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Available));
|
||||
|
||||
}
|
||||
gMenuHolder->findControl(userdata["control"].asString())->setValue(returnValue);
|
||||
return returnValue;
|
||||
}
|
||||
};
|
||||
|
||||
// Round the position of all root objects to the grid
|
||||
class LLToolsSnapObjectXY : public view_listener_t
|
||||
{
|
||||
@@ -9511,7 +9545,8 @@ void initialize_menus()
|
||||
|
||||
addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding");
|
||||
addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");
|
||||
|
||||
addMenu(new LLToolsDoPathfindingRebakeRegion(), "Tools.DoPathfindingRebakeRegion");
|
||||
addMenu(new LLToolsEnablePathfindingRebakeRegion(), "Tools.EnablePathfindingRebakeRegion");
|
||||
/*addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject");
|
||||
addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user