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 +++++++++++++++++++------- 1 file changed, 76 insertions(+), 26 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') 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; +} -- cgit v1.2.3