summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp339
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.h44
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml105
3 files changed, 330 insertions, 158 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index e24703aca6..26830390e0 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -39,12 +39,17 @@
#include "llscrolllistitem.h"
#include "llscrolllistctrl.h"
#include "llcheckboxctrl.h"
+#include "llradiogroup.h"
#include "llbutton.h"
#include "llresmgr.h"
#include "llviewerregion.h"
#include "llhttpclient.h"
#include "lluuid.h"
+#define XUI_PATH_STATE_WALKABLE 1
+#define XUI_PATH_STATE_OBSTACLE 2
+#define XUI_PATH_STATE_IGNORED 3
+
//---------------------------------------------------------------------------
// NavMeshDataGetResponder
//---------------------------------------------------------------------------
@@ -95,8 +100,7 @@ PathfindingLinkset::PathfindingLinkset(const std::string &pUUID, const LLSD& pNa
mDescription(),
mLandImpact(0U),
mLocation(),
- mIsFixed(false),
- mIsWalkable(false),
+ mPathState(kIgnored),
mIsPhantom(false),
mA(0),
mB(0),
@@ -118,11 +122,13 @@ PathfindingLinkset::PathfindingLinkset(const std::string &pUUID, const LLSD& pNa
llassert(pNavMeshItem.has("permanent"));
llassert(pNavMeshItem.get("permanent").isBoolean());
- mIsFixed = pNavMeshItem.get("permanent").asBoolean();
+ bool isPermanent = pNavMeshItem.get("permanent").asBoolean();
llassert(pNavMeshItem.has("walkable"));
llassert(pNavMeshItem.get("walkable").isBoolean());
- mIsWalkable = pNavMeshItem.get("walkable").asBoolean();
+ bool isWalkable = pNavMeshItem.get("walkable").asBoolean();
+
+ mPathState = getPathState(isPermanent, isWalkable);
llassert(pNavMeshItem.has("phantom"));
//llassert(pNavMeshItem.get("phantom").isBoolean()); XXX stinson 01/10/2012: this should be a boolean but is not
@@ -155,8 +161,7 @@ PathfindingLinkset::PathfindingLinkset(const PathfindingLinkset& pOther)
mDescription(pOther.mDescription),
mLandImpact(pOther.mLandImpact),
mLocation(pOther.mLocation),
- mIsFixed(pOther.mIsFixed),
- mIsWalkable(pOther.mIsWalkable),
+ mPathState(pOther.mPathState),
mIsPhantom(pOther.mIsPhantom),
mA(pOther.mA),
mB(pOther.mB),
@@ -176,8 +181,7 @@ PathfindingLinkset& PathfindingLinkset::operator =(const PathfindingLinkset& pOt
mDescription = pOther.mDescription;
mLandImpact = pOther.mLandImpact;
mLocation = pOther.mLocation;
- mIsFixed = pOther.mIsFixed;
- mIsWalkable = pOther.mIsWalkable;
+ mPathState = pOther.mPathState;
mIsPhantom = pOther.mIsPhantom;
mA = pOther.mA;
mB = pOther.mB;
@@ -212,24 +216,63 @@ const LLVector3& PathfindingLinkset::getPositionAgent() const
return mLocation;
}
-BOOL PathfindingLinkset::isFixed() const
+PathfindingLinkset::EPathState PathfindingLinkset::getPathState() const
{
- return mIsFixed;
+ return mPathState;
}
-void PathfindingLinkset::setFixed(BOOL pIsFixed)
+void PathfindingLinkset::setPathState(EPathState pPathState)
{
- mIsFixed = pIsFixed;
+ mPathState = pPathState;
}
-BOOL PathfindingLinkset::isWalkable() const
+PathfindingLinkset::EPathState PathfindingLinkset::getPathState(bool pIsPermanent, bool pIsWalkable)
{
- return mIsWalkable;
+ return (pIsPermanent ? (pIsWalkable ? kWalkable : kObstacle) : kIgnored);
}
-void PathfindingLinkset::setWalkable(BOOL pIsWalkable)
+BOOL PathfindingLinkset::isPermanent(EPathState pPathState)
{
- mIsWalkable = pIsWalkable;
+ BOOL retVal;
+
+ switch (pPathState)
+ {
+ case kWalkable :
+ case kObstacle :
+ retVal = true;
+ break;
+ case kIgnored :
+ retVal = false;
+ break;
+ default :
+ retVal = false;
+ llassert(0);
+ break;
+ }
+
+ return retVal;
+}
+
+BOOL PathfindingLinkset::isWalkable(EPathState pPathState)
+{
+ BOOL retVal;
+
+ switch (pPathState)
+ {
+ case kWalkable :
+ retVal = true;
+ break;
+ case kObstacle :
+ case kIgnored :
+ retVal = false;
+ break;
+ default :
+ retVal = false;
+ llassert(0);
+ break;
+ }
+
+ return retVal;
}
BOOL PathfindingLinkset::isPhantom() const
@@ -369,8 +412,9 @@ PathfindingLinksets::PathfindingLinksets()
mIsFiltersDirty(false),
mNameFilter(),
mDescriptionFilter(),
- mIsFixedFilter(false),
- mIsWalkableFilter(false)
+ mIsWalkableFilter(true),
+ mIsObstacleFilter(true),
+ mIsIgnoredFilter(true)
{
}
@@ -380,10 +424,11 @@ PathfindingLinksets::PathfindingLinksets(const LLSD& pNavMeshData)
mIsFiltersDirty(false),
mNameFilter(),
mDescriptionFilter(),
- mIsFixedFilter(false),
- mIsWalkableFilter(false)
+ mIsWalkableFilter(true),
+ mIsObstacleFilter(true),
+ mIsIgnoredFilter(true)
{
- parseNavMeshData(pNavMeshData);
+ setNavMeshData(pNavMeshData);
}
PathfindingLinksets::PathfindingLinksets(const PathfindingLinksets& pOther)
@@ -392,8 +437,9 @@ PathfindingLinksets::PathfindingLinksets(const PathfindingLinksets& pOther)
mIsFiltersDirty(pOther.mIsFiltersDirty),
mNameFilter(pOther.mNameFilter),
mDescriptionFilter(pOther.mDescriptionFilter),
- mIsFixedFilter(pOther.mIsFixedFilter),
- mIsWalkableFilter(pOther.mIsWalkableFilter)
+ mIsWalkableFilter(pOther.mIsWalkableFilter),
+ mIsObstacleFilter(pOther.mIsObstacleFilter),
+ mIsIgnoredFilter(pOther.mIsIgnoredFilter)
{
}
@@ -402,15 +448,15 @@ PathfindingLinksets::~PathfindingLinksets()
clearLinksets();
}
-void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData)
+void PathfindingLinksets::setNavMeshData(const LLSD& pNavMeshData)
{
clearLinksets();
- for (LLSD::map_const_iterator linksetIter = pNavMeshData.beginMap();
- linksetIter != pNavMeshData.endMap(); ++linksetIter)
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
{
- const std::string& uuid(linksetIter->first);
- const LLSD& linksetData = linksetIter->second;
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
PathfindingLinkset linkset(uuid, linksetData);
mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
@@ -419,6 +465,29 @@ void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData)
mIsFiltersDirty = true;
}
+void PathfindingLinksets::updateNavMeshData(const LLSD& pNavMeshData)
+{
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
+ {
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
+ PathfindingLinkset linkset(uuid, linksetData);
+
+ PathfindingLinksetMap::iterator linksetIter = mAllLinksets.find(uuid);
+ if (linksetIter == mAllLinksets.end())
+ {
+ mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
+ }
+ else
+ {
+ linksetIter->second = linkset;
+ }
+ }
+
+ mIsFiltersDirty = true;
+}
+
void PathfindingLinksets::clearLinksets()
{
mAllLinksets.clear();
@@ -446,7 +515,7 @@ const PathfindingLinksets::PathfindingLinksetMap& PathfindingLinksets::getFilter
BOOL PathfindingLinksets::isFiltersActive() const
{
- return (mNameFilter.isActive() || mDescriptionFilter.isActive() || mIsFixedFilter || mIsWalkableFilter);
+ return (mNameFilter.isActive() || mDescriptionFilter.isActive() || !mIsWalkableFilter || !mIsIgnoredFilter || !mIsIgnoredFilter);
}
void PathfindingLinksets::setNameFilter(const std::string& pNameFilter)
@@ -469,34 +538,46 @@ const std::string& PathfindingLinksets::getDescriptionFilter() const
return mDescriptionFilter.get();
}
-void PathfindingLinksets::setFixedFilter(BOOL pFixedFilter)
+void PathfindingLinksets::setWalkableFilter(BOOL pWalkableFilter)
{
- mIsFiltersDirty = (mIsFiltersDirty || (mIsFixedFilter == pFixedFilter));
- mIsFixedFilter = pFixedFilter;
+ mIsFiltersDirty = (mIsFiltersDirty || (mIsWalkableFilter == pWalkableFilter));
+ mIsWalkableFilter = pWalkableFilter;
}
-BOOL PathfindingLinksets::isFixedFilter() const
+BOOL PathfindingLinksets::isWalkableFilter() const
{
- return mIsFixedFilter;
+ return mIsWalkableFilter;
}
-void PathfindingLinksets::setWalkableFilter(BOOL pWalkableFilter)
+void PathfindingLinksets::setObstacleFilter(BOOL pObstacleFilter)
{
- mIsFiltersDirty = (mIsFiltersDirty || (mIsWalkableFilter == pWalkableFilter));
- mIsWalkableFilter = pWalkableFilter;
+ mIsFiltersDirty = (mIsFiltersDirty || (mIsObstacleFilter == pObstacleFilter));
+ mIsObstacleFilter = pObstacleFilter;
}
-BOOL PathfindingLinksets::isWalkableFilter() const
+BOOL PathfindingLinksets::isObstacleFilter() const
{
- return mIsWalkableFilter;
+ return mIsObstacleFilter;
+}
+
+void PathfindingLinksets::setIgnoredFilter(BOOL pIgnoredFilter)
+{
+ mIsFiltersDirty = (mIsFiltersDirty || (mIsIgnoredFilter == pIgnoredFilter));
+ mIsIgnoredFilter = pIgnoredFilter;
+}
+
+BOOL PathfindingLinksets::isIgnoredFilter() const
+{
+ return mIsIgnoredFilter;
}
void PathfindingLinksets::clearFilters()
{
mNameFilter.clear();
mDescriptionFilter.clear();
- mIsFixedFilter = false;
- mIsWalkableFilter = false;
+ mIsWalkableFilter = true;
+ mIsObstacleFilter = true;
+ mIsIgnoredFilter = true;
mIsFiltersDirty = false;
}
@@ -520,8 +601,9 @@ void PathfindingLinksets::applyFilters()
BOOL PathfindingLinksets::doesMatchFilters(const PathfindingLinkset& pLinkset) const
{
- return ((!mIsFixedFilter || pLinkset.isFixed()) &&
- (!mIsWalkableFilter || pLinkset.isWalkable()) &&
+ return (((mIsWalkableFilter && (pLinkset.getPathState() == PathfindingLinkset::kWalkable)) ||
+ (mIsObstacleFilter && (pLinkset.getPathState() == PathfindingLinkset::kObstacle)) ||
+ (mIsIgnoredFilter && (pLinkset.getPathState() == PathfindingLinkset::kIgnored))) &&
(!mNameFilter.isActive() || mNameFilter.doesMatch(pLinkset.getName())) &&
(!mDescriptionFilter.isActive() || mDescriptionFilter.doesMatch(pLinkset.getDescription())));
}
@@ -558,22 +640,20 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
mFilterByDescription->setSelectAllonFocusReceived(true);
mFilterByDescription->setCommitOnFocusLost(true);
- mFilterByFixed = findChild<LLCheckBoxCtrl>("filter_by_fixed");
- llassert(mFilterByFixed != NULL);
- mFilterByFixed->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyFiltersClicked, this));
-
mFilterByWalkable = findChild<LLCheckBoxCtrl>("filter_by_walkable");
llassert(mFilterByWalkable != NULL);
mFilterByWalkable->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyFiltersClicked, this));
- mEditFixed = findChild<LLCheckBoxCtrl>("edit_fixed_value");
- llassert(mEditFixed != NULL);
+ mFilterByObstacle = findChild<LLCheckBoxCtrl>("filter_by_obstacle");
+ llassert(mFilterByObstacle != NULL);
+ mFilterByObstacle->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyFiltersClicked, this));
- mEditWalkable = findChild<LLCheckBoxCtrl>("edit_walkable_value");
- llassert(mEditWalkable != NULL);
+ mFilterByIgnored = findChild<LLCheckBoxCtrl>("filter_by_ignored");
+ llassert(mFilterByIgnored != NULL);
+ mFilterByIgnored->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyFiltersClicked, this));
- mEditPhantom = findChild<LLCheckBoxCtrl>("edit_phantom_value");
- llassert(mEditPhantom != NULL);
+ mEditPathState = findChild<LLRadioGroup>("edit_path_state");
+ llassert(mEditPathState != NULL);
mLabelWalkabilityCoefficients = findChild<LLTextBase>("walkability_coefficients_label");
llassert(mLabelWalkabilityCoefficients != NULL);
@@ -606,6 +686,9 @@ BOOL LLFloaterPathfindingLinksets::postBuild()
llassert(mEditD != NULL);
mEditD->setPrevalidate(LLTextValidate::validatePositiveS32);
+ mEditPhantom = findChild<LLCheckBoxCtrl>("edit_phantom_value");
+ llassert(mEditPhantom != NULL);
+
mApplyEdits = findChild<LLButton>("apply_edit_values");
llassert(mApplyEdits != NULL);
mApplyEdits->setCommitCallback(boost::bind(&LLFloaterPathfindingLinksets::onApplyChangesClicked, this));
@@ -658,11 +741,10 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
mLinksetsStatus(NULL),
mFilterByName(NULL),
mFilterByDescription(NULL),
- mFilterByFixed(NULL),
mFilterByWalkable(NULL),
- mEditFixed(NULL),
- mEditWalkable(NULL),
- mEditPhantom(NULL),
+ mFilterByObstacle(NULL),
+ mFilterByIgnored(NULL),
+ mEditPathState(NULL),
mLabelWalkabilityCoefficients(NULL),
mLabelEditA(NULL),
mLabelEditB(NULL),
@@ -672,6 +754,7 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed)
mEditB(NULL),
mEditC(NULL),
mEditD(NULL),
+ mEditPhantom(NULL),
mApplyEdits(NULL)
{
}
@@ -725,7 +808,7 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostDa
void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pNavMeshData);
+ mPathfindingLinksets.setNavMeshData(pNavMeshData);
updateLinksetsList();
setFetchState(kFetchComplete);
}
@@ -741,7 +824,7 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string&
void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pModifiedData);
+ mPathfindingLinksets.updateNavMeshData(pModifiedData);
updateLinksetsList();
setFetchState(kFetchComplete);
}
@@ -842,8 +925,9 @@ void LLFloaterPathfindingLinksets::applyFilters()
{
mPathfindingLinksets.setNameFilter(mFilterByName->getText());
mPathfindingLinksets.setDescriptionFilter(mFilterByDescription->getText());
- mPathfindingLinksets.setFixedFilter(mFilterByFixed->get());
mPathfindingLinksets.setWalkableFilter(mFilterByWalkable->get());
+ mPathfindingLinksets.setObstacleFilter(mFilterByObstacle->get());
+ mPathfindingLinksets.setIgnoredFilter(mFilterByIgnored->get());
updateLinksetsList();
}
@@ -852,8 +936,9 @@ void LLFloaterPathfindingLinksets::clearFilters()
mPathfindingLinksets.clearFilters();
mFilterByName->setText(LLStringExplicit(mPathfindingLinksets.getNameFilter()));
mFilterByDescription->setText(LLStringExplicit(mPathfindingLinksets.getDescriptionFilter()));
- mFilterByFixed->set(mPathfindingLinksets.isFixedFilter());
mFilterByWalkable->set(mPathfindingLinksets.isWalkableFilter());
+ mFilterByObstacle->set(mPathfindingLinksets.isObstacleFilter());
+ mFilterByIgnored->set(mPathfindingLinksets.isIgnoredFilter());
updateLinksetsList();
}
@@ -902,34 +987,45 @@ void LLFloaterPathfindingLinksets::updateLinksetsList()
columns[3]["value"] = llformat("%1.0f m", dist_vec(avatarPosition, linkset.getPositionAgent()));
columns[3]["font"] = "SANSSERIF";
- columns[4]["column"] = "is_fixed";
- columns[4]["value"] = getString(linkset.isFixed() ? "linkset_is_fixed" : "linkset_is_not_fixed");
+ columns[4]["column"] = "path_state";
+ switch (linkset.getPathState())
+ {
+ case PathfindingLinkset::kWalkable :
+ columns[4]["value"] = getString("linkset_path_state_walkable");
+ break;
+ case PathfindingLinkset::kObstacle :
+ columns[4]["value"] = getString("linkset_path_state_obstacle");
+ break;
+ case PathfindingLinkset::kIgnored :
+ columns[4]["value"] = getString("linkset_path_state_ignored");
+ break;
+ default :
+ columns[4]["value"] = getString("linkset_path_state_ignored");
+ llassert(0);
+ break;
+ }
columns[4]["font"] = "SANSSERIF";
- columns[5]["column"] = "is_walkable";
- columns[5]["value"] = getString(linkset.isWalkable() ? "linkset_is_walkable" : "linkset_is_not_walkable");
+ columns[5]["column"] = "is_phantom";
+ columns[5]["value"] = getString(linkset.isPhantom() ? "linkset_is_phantom" : "linkset_is_not_phantom");
columns[5]["font"] = "SANSSERIF";
- columns[6]["column"] = "is_phantom";
- columns[6]["value"] = getString(linkset.isPhantom() ? "linkset_is_phantom" : "linkset_is_not_phantom");
+ columns[6]["column"] = "a_percent";
+ columns[6]["value"] = llformat("%3d", linkset.getA());
columns[6]["font"] = "SANSSERIF";
- columns[7]["column"] = "a_percent";
- columns[7]["value"] = llformat("%3d", linkset.getA());
+ columns[7]["column"] = "b_percent";
+ columns[7]["value"] = llformat("%3d", linkset.getB());
columns[7]["font"] = "SANSSERIF";
- columns[8]["column"] = "b_percent";
- columns[8]["value"] = llformat("%3d", linkset.getB());
+ columns[8]["column"] = "c_percent";
+ columns[8]["value"] = llformat("%3d", linkset.getC());
columns[8]["font"] = "SANSSERIF";
- columns[9]["column"] = "c_percent";
- columns[9]["value"] = llformat("%3d", linkset.getC());
+ columns[9]["column"] = "d_percent";
+ columns[9]["value"] = llformat("%3d", linkset.getD());
columns[9]["font"] = "SANSSERIF";
- columns[10]["column"] = "d_percent";
- columns[10]["value"] = llformat("%3d", linkset.getD());
- columns[10]["font"] = "SANSSERIF";
-
LLSD element;
element["id"] = linkset.getUUID().asString();
element["column"] = columns;
@@ -1013,13 +1109,12 @@ void LLFloaterPathfindingLinksets::updateEditFields()
std::vector<LLScrollListItem*> selectedItems = mLinksetsScrollList->getAllSelected();
if (selectedItems.empty())
{
- mEditFixed->clear();
- mEditWalkable->clear();
- mEditPhantom->clear();
+ mEditPathState->clear();
mEditA->clear();
mEditB->clear();
mEditC->clear();
mEditD->clear();
+ mEditPhantom->clear();
setEnableEditFields(false);
}
@@ -1031,13 +1126,12 @@ void LLFloaterPathfindingLinksets::updateEditFields()
PathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetsMap.find(firstItem->getUUID().asString());
const PathfindingLinkset &linkset(linksetIter->second);
- mEditFixed->set(linkset.isFixed());
- mEditWalkable->set(linkset.isWalkable());
- mEditPhantom->set(linkset.isPhantom());
+ setPathState(linkset.getPathState());
mEditA->setValue(LLSD(linkset.getA()));
mEditB->setValue(LLSD(linkset.getB()));
mEditC->setValue(LLSD(linkset.getC()));
mEditD->setValue(LLSD(linkset.getD()));
+ mEditPhantom->set(linkset.isPhantom());
setEnableEditFields(true);
}
@@ -1048,9 +1142,9 @@ void LLFloaterPathfindingLinksets::applyEditFields()
std::vector<LLScrollListItem*> selectedItems = mLinksetsScrollList->getAllSelected();
if (!selectedItems.empty())
{
- BOOL isFixedBool = mEditFixed->getValue();
- BOOL isWalkableBool = mEditWalkable->getValue();
- BOOL isPhantomBool = mEditPhantom->getValue();
+ PathfindingLinkset::EPathState pathState = getPathState();
+ BOOL isPermanentBool = PathfindingLinkset::isPermanent(pathState);
+ BOOL isWalkableBool = PathfindingLinkset::isWalkable(pathState);
const std::string &aString = mEditA->getText();
const std::string &bString = mEditB->getText();
const std::string &cString = mEditC->getText();
@@ -1059,14 +1153,15 @@ void LLFloaterPathfindingLinksets::applyEditFields()
S32 bValue = static_cast<S32>(atoi(bString.c_str()));
S32 cValue = static_cast<S32>(atoi(cString.c_str()));
S32 dValue = static_cast<S32>(atoi(dString.c_str()));
+ BOOL isPhantomBool = mEditPhantom->getValue();
- LLSD isFixed = (bool)isFixedBool;
+ LLSD isPermanent = (bool)isPermanentBool;
LLSD isWalkable = (bool)isWalkableBool;
- LLSD isPhantom = (bool)isPhantomBool;
LLSD a = static_cast<F32>(aValue) / 100.0f;
LLSD b = static_cast<F32>(bValue) / 100.0f;
LLSD c = static_cast<F32>(cValue) / 100.0f;
LLSD d = static_cast<F32>(dValue) / 100.0f;
+ LLSD isPhantom = (bool)isPhantomBool;
const PathfindingLinksets::PathfindingLinksetMap &linksetsMap = mPathfindingLinksets.getAllLinksets();
@@ -1081,18 +1176,11 @@ void LLFloaterPathfindingLinksets::applyEditFields()
const PathfindingLinkset &linkset = linksetIter->second;
LLSD itemData;
- if (linkset.isFixed() != isFixedBool)
- {
- itemData["permanent"] = isFixed;
- }
- if (linkset.isWalkable() != isWalkableBool)
+ if (linkset.getPathState() != pathState)
{
+ itemData["permanent"] = isPermanent;
itemData["walkable"] = isWalkable;
}
- if (linkset.isPhantom() != isPhantomBool)
- {
- itemData["phantom"] = isPhantom;
- }
if (linkset.getA() != aValue)
{
itemData["A"] = a;
@@ -1109,6 +1197,10 @@ void LLFloaterPathfindingLinksets::applyEditFields()
{
itemData["D"] = d;
}
+ if (linkset.isPhantom() != isPhantomBool)
+ {
+ itemData["phantom"] = isPhantom;
+ }
if (!itemData.isUndefined())
{
@@ -1129,9 +1221,7 @@ void LLFloaterPathfindingLinksets::applyEditFields()
void LLFloaterPathfindingLinksets::setEnableEditFields(BOOL pEnabled)
{
- mEditFixed->setEnabled(pEnabled);
- mEditWalkable->setEnabled(pEnabled);
- mEditPhantom->setEnabled(pEnabled);
+ mEditPathState->setEnabled(pEnabled);
mLabelWalkabilityCoefficients->setEnabled(pEnabled);
mLabelEditA->setEnabled(pEnabled);
mLabelEditB->setEnabled(pEnabled);
@@ -1141,9 +1231,58 @@ void LLFloaterPathfindingLinksets::setEnableEditFields(BOOL pEnabled)
mEditB->setEnabled(pEnabled);
mEditC->setEnabled(pEnabled);
mEditD->setEnabled(pEnabled);
+ mEditPhantom->setEnabled(pEnabled);
mApplyEdits->setEnabled(pEnabled);
}
+PathfindingLinkset::EPathState LLFloaterPathfindingLinksets::getPathState() const
+{
+ PathfindingLinkset::EPathState pathState;
+
+ switch (mEditPathState->getValue().asInteger())
+ {
+ case XUI_PATH_STATE_WALKABLE :
+ pathState = PathfindingLinkset::kWalkable;
+ break;
+ case XUI_PATH_STATE_OBSTACLE :
+ pathState = PathfindingLinkset::kObstacle;
+ break;
+ case XUI_PATH_STATE_IGNORED :
+ pathState = PathfindingLinkset::kIgnored;
+ break;
+ default :
+ pathState = PathfindingLinkset::kIgnored;
+ llassert(0);
+ break;
+ }
+
+ return pathState;
+}
+
+void LLFloaterPathfindingLinksets::setPathState(PathfindingLinkset::EPathState pPathState)
+{
+ LLSD radioGroupValue;
+
+ switch (pPathState)
+ {
+ case PathfindingLinkset::kWalkable :
+ radioGroupValue = XUI_PATH_STATE_WALKABLE;
+ break;
+ case PathfindingLinkset::kObstacle :
+ radioGroupValue = XUI_PATH_STATE_OBSTACLE;
+ break;
+ case PathfindingLinkset::kIgnored :
+ radioGroupValue = XUI_PATH_STATE_IGNORED;
+ break;
+ default :
+ radioGroupValue = XUI_PATH_STATE_IGNORED;
+ llassert(0);
+ break;
+ }
+
+ mEditPathState->setValue(radioGroupValue);
+}
+
//---------------------------------------------------------------------------
// NavMeshDataGetResponder
//---------------------------------------------------------------------------
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h
index b1fd771219..915d799079 100644
--- a/indra/newview/llfloaterpathfindinglinksets.h
+++ b/indra/newview/llfloaterpathfindinglinksets.h
@@ -37,11 +37,19 @@ class LLTextBase;
class LLScrollListCtrl;
class LLLineEditor;
class LLCheckBoxCtrl;
+class LLRadioGroup;
class LLButton;
class PathfindingLinkset
{
public:
+ typedef enum
+ {
+ kWalkable,
+ kObstacle,
+ kIgnored
+ } EPathState;
+
PathfindingLinkset(const std::string &pUUID, const LLSD &pNavMeshItem);
PathfindingLinkset(const PathfindingLinkset& pOther);
virtual ~PathfindingLinkset();
@@ -54,11 +62,11 @@ public:
U32 getLandImpact() const;
const LLVector3& getPositionAgent() const;
- BOOL isFixed() const;
- void setFixed(BOOL pIsFixed);
-
- BOOL isWalkable() const;
- void setWalkable(BOOL pIsWalkable);
+ EPathState getPathState() const;
+ void setPathState(EPathState pPathState);
+ static EPathState getPathState(bool pIsPermanent, bool pIsWalkable);
+ static BOOL isPermanent(EPathState pPathState);
+ static BOOL isWalkable(EPathState pPathState);
BOOL isPhantom() const;
void setPhantom(BOOL pIsPhantom);
@@ -83,8 +91,7 @@ private:
std::string mDescription;
U32 mLandImpact;
LLVector3 mLocation;
- BOOL mIsFixed;
- BOOL mIsWalkable;
+ EPathState mPathState;
BOOL mIsPhantom;
S32 mA;
S32 mB;
@@ -124,7 +131,8 @@ public:
PathfindingLinksets(const PathfindingLinksets& pOther);
virtual ~PathfindingLinksets();
- void parseNavMeshData(const LLSD& pNavMeshData);
+ void setNavMeshData(const LLSD& pNavMeshData);
+ void updateNavMeshData(const LLSD& pNavMeshData);
void clearLinksets();
const PathfindingLinksetMap& getAllLinksets() const;
@@ -135,10 +143,12 @@ public:
const std::string& getNameFilter() const;
void setDescriptionFilter(const std::string& pDescriptionFilter);
const std::string& getDescriptionFilter() const;
- void setFixedFilter(BOOL pFixedFilter);
- BOOL isFixedFilter() const;
void setWalkableFilter(BOOL pWalkableFilter);
BOOL isWalkableFilter() const;
+ void setObstacleFilter(BOOL pObstacleFilter);
+ BOOL isObstacleFilter() const;
+ void setIgnoredFilter(BOOL pIgnoredFilter);
+ BOOL isIgnoredFilter() const;
void clearFilters();
protected:
@@ -150,8 +160,9 @@ private:
bool mIsFiltersDirty;
FilterString mNameFilter;
FilterString mDescriptionFilter;
- BOOL mIsFixedFilter;
BOOL mIsWalkableFilter;
+ BOOL mIsObstacleFilter;
+ BOOL mIsIgnoredFilter;
void applyFilters();
BOOL doesMatchFilters(const PathfindingLinkset& pLinkset) const;
@@ -193,11 +204,10 @@ private:
LLTextBase *mLinksetsStatus;
LLLineEditor *mFilterByName;
LLLineEditor *mFilterByDescription;
- LLCheckBoxCtrl *mFilterByFixed;
LLCheckBoxCtrl *mFilterByWalkable;
- LLCheckBoxCtrl *mEditFixed;
- LLCheckBoxCtrl *mEditWalkable;
- LLCheckBoxCtrl *mEditPhantom;
+ LLCheckBoxCtrl *mFilterByObstacle;
+ LLCheckBoxCtrl *mFilterByIgnored;
+ LLRadioGroup *mEditPathState;
LLTextBase *mLabelWalkabilityCoefficients;
LLTextBase *mLabelEditA;
LLTextBase *mLabelEditB;
@@ -207,6 +217,7 @@ private:
LLLineEditor *mEditB;
LLLineEditor *mEditC;
LLLineEditor *mEditD;
+ LLCheckBoxCtrl *mEditPhantom;
LLButton *mApplyEdits;
// Does its own instance management, so clients not allowed
@@ -246,6 +257,9 @@ private:
void updateEditFields();
void applyEditFields();
void setEnableEditFields(BOOL pEnabled);
+
+ PathfindingLinkset::EPathState getPathState() const;
+ void setPathState(PathfindingLinkset::EPathState pPathState);
};
#endif // LL_LLFLOATERPATHFINDINGLINKSETS_H
diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
index 6f14315ead..d33df8fbb8 100644
--- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
+++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml
@@ -19,10 +19,9 @@
<floater.string name="linksets_fetching_error">Error detected while querying for pathfinding linksets</floater.string>
<floater.string name="linksets_fetching_done_none_found">No pathfinding linksets</floater.string>
<floater.string name="linksets_fetching_done_available">[NUM_SELECTED] linksets selected out of [NUM_TOTAL]</floater.string>
- <floater.string name="linkset_is_fixed">Fixed</floater.string>
- <floater.string name="linkset_is_not_fixed">Not fixed</floater.string>
- <floater.string name="linkset_is_walkable">Walkable</floater.string>
- <floater.string name="linkset_is_not_walkable">--</floater.string>
+ <floater.string name="linkset_path_state_walkable">Walkable</floater.string>
+ <floater.string name="linkset_path_state_obstacle">Obstacle</floater.string>
+ <floater.string name="linkset_path_state_ignored">Ignored</floater.string>
<floater.string name="linkset_is_phantom">Phantom</floater.string>
<floater.string name="linkset_is_not_phantom">--</floater.string>
<text
@@ -36,8 +35,8 @@
layout="topleft"
left="20"
top="16"
- width="90">
- Filter list by:
+ width="67">
+ Filter by:
</text>
<text
height="13"
@@ -48,10 +47,10 @@
length="1"
follows="left|top"
layout="topleft"
- left="109"
+ left="87"
top="16"
- width="94">
- Portion of name
+ width="62">
+ Name
</text>
<line_editor
border_style="line"
@@ -59,11 +58,11 @@
follows="top|left"
height="20"
layout="topleft"
- left_delta="93"
+ left_delta="62"
top="11"
max_length_bytes="10"
name="filter_by_name"
- width="115" />
+ width="105" />
<text
height="13"
word_wrap="false"
@@ -73,10 +72,10 @@
length="1"
follows="left|top"
layout="topleft"
- left="336"
+ left="273"
top="16"
- width="132">
- Portion of description
+ width="88">
+ Description
</text>
<line_editor
border_style="line"
@@ -84,26 +83,37 @@
follows="top|left"
height="20"
layout="topleft"
- left_delta="131"
+ left_delta="88"
top="11"
max_length_bytes="10"
name="filter_by_description"
- width="115" />
+ width="106" />
<check_box
height="19"
- label="Fixed"
+ initial_value="1"
+ label="Walkable"
layout="topleft"
- left="591"
+ left="481"
top="14"
- name="filter_by_fixed"
+ name="filter_by_walkable"
width="90" />
<check_box
height="19"
- label="Walkable"
+ initial_value="1"
+ label="Obstacle"
layout="topleft"
- left="671"
+ left="577"
top="14"
- name="filter_by_walkable"
+ name="filter_by_obstacle"
+ width="90" />
+ <check_box
+ height="19"
+ initial_value="1"
+ label="Ignored"
+ layout="topleft"
+ left="674"
+ top="14"
+ name="filter_by_ignored"
width="90" />
<button
follows="right|top"
@@ -151,13 +161,9 @@
name="dist_from_you"
width="87" />
<scroll_list.columns
- label="Fixed"
- name="is_fixed"
- width="63" />
- <scroll_list.columns
- label="Walkable"
- name="is_walkable"
- width="73" />
+ label="State"
+ name="path_state"
+ width="136" />
<scroll_list.columns
label="Phantom"
name="is_phantom"
@@ -242,21 +248,34 @@
width="910">
Select row(s) to edit attributes of linkset(s). If a linkset is deleted or returned to inventory, attributes assigned to it will be lost.
</text>
- <check_box
- height="19"
- label="Fixed"
- layout="topleft"
- name="edit_fixed_value"
- top_pad="10"
- width="90" />
- <check_box
- height="19"
- label="Walkable"
+ <radio_group
+ follows="top|left"
+ height="55"
+ value="1"
layout="topleft"
- name="edit_walkable_value"
- top_pad="5"
- left="38"
- width="90" />
+ left_delta="0"
+ name="edit_path_state"
+ top_delta="21"
+ width="138">
+ <radio_item
+ label="Walkable"
+ layout="topleft"
+ height="13"
+ name="edit_pathing_state_walkable"
+ value="1"/>
+ <radio_item
+ label="Obstacle"
+ layout="topleft"
+ height="13"
+ name="edit_pathing_state_obstacle"
+ value="2"/>
+ <radio_item
+ label="Ignored"
+ layout="topleft"
+ height="13"
+ name="edit_pathing_state_ignored"
+ value="3"/>
+ </radio_group>
<text
height="13"
word_wrap="false"