diff options
| author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-12-04 14:31:15 -0800 |
|---|---|---|
| committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-12-04 14:31:15 -0800 |
| commit | 40e78a80cc293874216cdc8730d93cba8e987052 (patch) | |
| tree | 1d16ec375ef2b0dfd9c7a3363cd46575c457a033 /indra/newview/llviewermenu.cpp | |
| parent | 18e20ca6f2cb7d51d4d7e7d9566b0018025a91cc (diff) | |
| parent | f5a47417fde70f78b99744386c6da0bcf78e60d5 (diff) | |
Pull and merge viewer-development
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 21a96a4e07..d613ac9651 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -83,6 +83,7 @@ #include "llinventoryfunctions.h" #include "llpanellogin.h" #include "llpanelblockedlist.h" +#include "llmenuoptionpathfindingrebakenavmesh.h" #include "llmoveview.h" #include "llparcel.h" #include "llrootview.h" @@ -4862,6 +4863,37 @@ class LLToolsEnablePathfindingView : public view_listener_t } }; +class LLToolsDoPathfindingRebakeRegion : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool hasPathfinding = (LLPathfindingManager::getInstance() != NULL); + + if (hasPathfinding) + { + LLMenuOptionPathfindingRebakeNavmesh::getInstance()->sendRequestRebakeNavmesh(); + } + + return hasPathfinding; + } +}; + +class LLToolsEnablePathfindingRebakeRegion : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + bool returnValue = false; + + if (LLPathfindingManager::getInstance() != NULL) + { + LLMenuOptionPathfindingRebakeNavmesh *rebakeInstance = LLMenuOptionPathfindingRebakeNavmesh::getInstance(); + returnValue = (rebakeInstance->canRebakeRegion() && + (rebakeInstance->getMode() == LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Available)); + } + return returnValue; + } +}; + // Round the position of all root objects to the grid class LLToolsSnapObjectXY : public view_listener_t { @@ -8299,6 +8331,8 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding"); view_listener_t::addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView"); + view_listener_t::addMenu(new LLToolsDoPathfindingRebakeRegion(), "Tools.DoPathfindingRebakeRegion"); + view_listener_t::addMenu(new LLToolsEnablePathfindingRebakeRegion(), "Tools.EnablePathfindingRebakeRegion"); // Help menu // most items use the ShowFloater method |
