diff options
Diffstat (limited to 'indra/newview/llfloaterpathfindingconsole.cpp')
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 82 |
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(); |