From 101a674c73ad3007f9a40fc4593df1d0eaa4fd99 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 19 Dec 2011 16:04:48 -0800 Subject: Stubbing out functionality for catching the path selection state switch. --- indra/newview/llfloaterpathfindingconsole.cpp | 102 +++++++++++++++------ indra/newview/llfloaterpathfindingconsole.h | 10 ++ .../default/xui/en/floater_pathfinding_console.xml | 10 +- 3 files changed, 93 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index f713b09e88..5fa9d6f3a4 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -1,29 +1,29 @@ /** - * @file llfloaterpathfindingconsole.cpp - * @author William Todd Stinson - * @brief "Pathfinding console" floater, allowing manipulation of the Havok AI pathfinding settings. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ +* @file llfloaterpathfindingconsole.cpp +* @author William Todd Stinson +* @brief "Pathfinding console" floater, allowing manipulation of the Havok AI pathfinding settings. +* +* $LicenseInfo:firstyear=2002&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ #include "llviewerprecompiledheaders.h" #include "llfloaterpathfindingconsole.h" @@ -67,6 +67,10 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mRegionOverlayDisplayRadioGroup != NULL); mRegionOverlayDisplayRadioGroup->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onRegionOverlayDisplaySwitch, this)); + mPathSelectionRadioGroup = findChild("path_selection"); + llassert(mPathSelectionRadioGroup != NULL); + mPathSelectionRadioGroup ->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onPathSelectionSwitch, this)); + return LLFloater::postBuild(); } @@ -77,6 +81,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mShowPathCheckBox(NULL), mShowWaterPlaneCheckBox(NULL), mRegionOverlayDisplayRadioGroup(NULL), + mPathSelectionRadioGroup(NULL), mNavmeshDownloadObserver() { } @@ -189,6 +194,31 @@ void LLFloaterPathfindingConsole::onRegionOverlayDisplaySwitch() } } +void LLFloaterPathfindingConsole::onPathSelectionSwitch() +{ + switch (getPathSelectionState()) + { + case kPathSelectNone : + llwarns << "functionality has not yet been implemented to toggle '" + << mPathSelectionRadioGroup->getName() << "' to PathSelectNone" + << llendl; + break; + case kPathSelectStartPoint : + llwarns << "functionality has not yet been implemented to toggle '" + << mPathSelectionRadioGroup->getName() << "' to PathSelectStartPoint" + << llendl; + break; + case kPathSelectEndPoint : + llwarns << "functionality has not yet been implemented to toggle '" + << mPathSelectionRadioGroup->getName() << "' to PathSelectEndPoint" + << llendl; + break; + default : + llassert(0); + break; + } +} + void LLFloaterPathfindingConsole::onViewEditLinksetClicked() { LLFloaterPathfindingLinksets::openLinksetsEditor(); @@ -197,7 +227,7 @@ void LLFloaterPathfindingConsole::onViewEditLinksetClicked() LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole::getRegionOverlayDisplay() const { ERegionOverlayDisplay regionOverlayDisplay; - switch (mRegionOverlayDisplayRadioGroup->getSelectedIndex()) + switch (mRegionOverlayDisplayRadioGroup->getValue().asInteger()) { case 0 : regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry; @@ -212,3 +242,23 @@ LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole:: return regionOverlayDisplay; } + +LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::getPathSelectionState() const +{ + EPathSelectionState pathSelectionState; + + switch (mPathSelectionRadioGroup->getValue().asInteger()) + { + case 1 : + pathSelectionState = kPathSelectStartPoint; + break; + case 2: + pathSelectionState = kPathSelectEndPoint; + break; + default : + pathSelectionState = kPathSelectNone; + break; + } + + return pathSelectionState; +} diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index e4e71e9c58..f5af94fa5a 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -46,6 +46,13 @@ class LLFloaterPathfindingConsole kRenderOverlayOnAllRenderableGeometry = 1 } ERegionOverlayDisplay; + typedef enum + { + kPathSelectNone = 0, + kPathSelectStartPoint = 1, + kPathSelectEndPoint = 2 + } EPathSelectionState; + public: virtual BOOL postBuild(); @@ -64,15 +71,18 @@ private: void onShowPathToggle(); void onShowWaterPlaneToggle(); void onRegionOverlayDisplaySwitch(); + void onPathSelectionSwitch(); void onViewEditLinksetClicked(); ERegionOverlayDisplay getRegionOverlayDisplay() const; + EPathSelectionState getPathSelectionState() const; LLCheckBoxCtrl *mShowNavmeshCheckBox; LLCheckBoxCtrl *mShowExcludeVolumesCheckBox; LLCheckBoxCtrl *mShowPathCheckBox; LLCheckBoxCtrl *mShowWaterPlaneCheckBox; LLRadioGroup *mRegionOverlayDisplayRadioGroup; + LLRadioGroup *mPathSelectionRadioGroup; LLNavMeshDownloadObserver mNavmeshDownloadObserver; }; diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 75219d9df9..501451999d 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -118,23 +118,27 @@ Click on two points to see the path between them. + name="choose_path_start_point" + value="1"/> + name="choose_path_end_point" + value="2"/>