summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingconsole.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2011-12-16 17:30:12 -0800
committerTodd Stinson <stinson@lindenlab.com>2011-12-16 17:30:12 -0800
commit64acf29c53639cbd3784f5bcc617b02985cbe412 (patch)
treebe289059b8ce2a34fefb6d0436df67e7fdf483ab /indra/newview/llfloaterpathfindingconsole.cpp
parent6b2df5d57a4d973dea8cac99feb47330ccaa2397 (diff)
Hooking the navmesh and exclusion volumes render states up to the pathfinding console floater.
Diffstat (limited to 'indra/newview/llfloaterpathfindingconsole.cpp')
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp82
1 files changed, 76 insertions, 6 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index a2182a2551..129921d93e 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -31,6 +31,9 @@
#include "llsd.h"
#include "llbutton.h"
+#include "llcheckboxctrl.h"
+
+#include "llpathinglib.h"
//---------------------------------------------------------------------------
// LLFloaterPathfindingConsole
@@ -38,16 +41,33 @@
BOOL LLFloaterPathfindingConsole::postBuild()
{
- LLButton *linksetBtn = getChild<LLButton>("view_and_edit_linksets");
- llassert(linksetBtn != NULL);
+ childSetAction("view_and_edit_linksets", boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this));
+
+ mShowNavmeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh_overlay");
+ llassert(mShowNavmeshCheckBox != NULL);
+ mShowNavmeshCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowNavmeshToggle, this));
+
+ mShowExcludeVolumesCheckBox = findChild<LLCheckBoxCtrl>("show_exclusion_volumes");
+ llassert(mShowExcludeVolumesCheckBox != NULL);
+ mShowExcludeVolumesCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowExcludeVolumesToggle, this));
+
+ mShowPathCheckBox = findChild<LLCheckBoxCtrl>("show_path");
+ llassert(mShowPathCheckBox != NULL);
+ mShowPathCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowPathToggle, this));
+
+ mShowWaterPlaneCheckBox = findChild<LLCheckBoxCtrl>("show_water_plane");
+ llassert(mShowWaterPlaneCheckBox != NULL);
+ mShowWaterPlaneCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWaterPlaneToggle, this));
- linksetBtn->setClickedCallback(boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this));
-
return LLFloater::postBuild();
}
-LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& seed)
- : LLFloater(seed)
+LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
+ : LLFloater(pSeed),
+ mShowNavmeshCheckBox(NULL),
+ mShowExcludeVolumesCheckBox(NULL),
+ mShowPathCheckBox(NULL),
+ mShowWaterPlaneCheckBox(NULL)
{
}
@@ -55,6 +75,56 @@ LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole()
{
}
+void LLFloaterPathfindingConsole::onShowNavmeshToggle()
+{
+ BOOL checkBoxValue = mShowNavmeshCheckBox->get();
+
+ LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
+ if (llPathingLibInstance != NULL)
+ {
+ llPathingLibInstance->setRenderNavMesh(checkBoxValue);
+ }
+ else
+ {
+ mShowNavmeshCheckBox->set(FALSE);
+ llwarns << "cannot find LLPathingLib instance" << llendl;
+ }
+}
+
+void LLFloaterPathfindingConsole::onShowExcludeVolumesToggle()
+{
+ BOOL checkBoxValue = mShowExcludeVolumesCheckBox->get();
+
+ LLPathingLib *llPathingLibInstance = LLPathingLib::getInstance();
+ if (llPathingLibInstance != NULL)
+ {
+ llPathingLibInstance->setRenderNavMeshandShapes(checkBoxValue);
+ }
+ else
+ {
+ mShowExcludeVolumesCheckBox->set(FALSE);
+ llwarns << "cannot find LLPathingLib instance" << llendl;
+ }
+}
+
+void LLFloaterPathfindingConsole::onShowPathToggle()
+{
+ BOOL checkBoxValue = mShowPathCheckBox->get();
+
+ llwarns << "functionality has not yet been implemented to toggle '"
+ << mShowPathCheckBox->getLabel() << "' to "
+ << (checkBoxValue ? "ON" : "OFF") << llendl;
+}
+
+void LLFloaterPathfindingConsole::onShowWaterPlaneToggle()
+{
+ BOOL checkBoxValue = mShowWaterPlaneCheckBox->get();
+
+ llwarns << "functionality has not yet been implemented to toggle '"
+ << mShowWaterPlaneCheckBox->getLabel() << "' to "
+ << (checkBoxValue ? "ON" : "OFF") << llendl;
+}
+
void LLFloaterPathfindingConsole::onViewEditLinksetClicked()
{
LLFloaterPathfindingLinksets::openLinksetsEditor();