summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp102
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h10
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_console.xml10
3 files changed, 93 insertions, 29 deletions
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<LLRadioGroup>("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.
</text>
<radio_group
+ allow_deselect="true"
follows="top|left"
height="45"
layout="topleft"
left_delta="0"
- name="region_settings_radio_group"
+ name="path_selection"
top_delta="33"
+ value="0"
width="200">
<radio_item
label="Choose start point"
layout="topleft"
height="14"
- name="DisplayOverlayOnFixed"/>
+ name="choose_path_start_point"
+ value="1"/>
<radio_item
label="Choose end point"
layout="topleft"
height="14"
- name="DisplayOverlayOnAll"/>
+ name="choose_path_end_point"
+ value="2"/>
</radio_group>
<text
height="14"