summaryrefslogtreecommitdiff
path: root/indra/newview/lllocationinputctrl.cpp
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2016-04-14 02:10:21 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2016-04-14 02:10:21 +0300
commitaf408181c134e08b4b19f173d56b912c9e1f153b (patch)
tree5db5a3a55b76f047545bd7704bb95dad41f99a0d /indra/newview/lllocationinputctrl.cpp
parent5cd921a59750d73668241a247629c5fcd5852662 (diff)
MAINT-6248 remove the 'OK' and place a 'Rebake region' button in "pending pathfinding changes" notification toast
Diffstat (limited to 'indra/newview/lllocationinputctrl.cpp')
-rwxr-xr-xindra/newview/lllocationinputctrl.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 8d21fda8f9..53b2ca2b74 100755
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -64,6 +64,9 @@
#include "llurllineeditorctrl.h"
#include "llagentui.h"
+#include "llmenuoptionpathfindingrebakenavmesh.h"
+#include "llpathfindingmanager.h"
+
//============================================================================
/*
* "ADD LANDMARK" BUTTON UPDATING LOGIC
@@ -1194,6 +1197,18 @@ bool LLLocationInputCtrl::onLocationContextMenuItemEnabled(const LLSD& userdata)
return false;
}
+void LLLocationInputCtrl::callbackRebakeRegion(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0) // OK
+ {
+ if (LLPathfindingManager::getInstance() != NULL)
+ {
+ LLMenuOptionPathfindingRebakeNavmesh::getInstance()->sendRequestRebakeNavmesh();
+ }
+ }
+}
+
void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
{
switch (icon)
@@ -1211,6 +1226,16 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
LLNotificationsUtil::add("NoBuild");
break;
case PATHFINDING_DIRTY_ICON:
+ if (LLPathfindingManager::getInstance() != NULL)
+ {
+ LLMenuOptionPathfindingRebakeNavmesh *rebakeInstance = LLMenuOptionPathfindingRebakeNavmesh::getInstance();
+ if (rebakeInstance && rebakeInstance->canRebakeRegion() && (rebakeInstance->getMode() == LLMenuOptionPathfindingRebakeNavmesh::kRebakeNavMesh_Available))
+ {
+ LLNotificationsUtil::add("PathfindingDirtyRebake", LLSD(), LLSD(),
+ boost::bind(&LLLocationInputCtrl::callbackRebakeRegion, this, _1, _2));
+ break;
+ }
+ }
LLNotificationsUtil::add("PathfindingDirty");
break;
case PATHFINDING_DISABLED_ICON: