diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-01-19 18:22:17 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-01-19 18:22:17 -0800 |
commit | fe637c5f9571e91c8e90440a0677e5c40b7bf648 (patch) | |
tree | 2150d1b3f303bf1ec165cea45ae6a9d87a334fec /indra/newview | |
parent | 53175f835ea0170a38ccaa49397eb09d26a52984 (diff) |
PATH-225: Replacing the Fixed and Walkable columns with a single State column.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 78 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml | 17 |
3 files changed, 49 insertions, 53 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index b6b3c05e84..26830390e0 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -100,8 +100,7 @@ PathfindingLinkset::PathfindingLinkset(const std::string &pUUID, const LLSD& pNa mDescription(),
mLandImpact(0U),
mLocation(),
- mIsPermanent(false),
- mIsWalkable(false),
+ mPathState(kIgnored),
mIsPhantom(false),
mA(0),
mB(0),
@@ -123,11 +122,13 @@ PathfindingLinkset::PathfindingLinkset(const std::string &pUUID, const LLSD& pNa llassert(pNavMeshItem.has("permanent"));
llassert(pNavMeshItem.get("permanent").isBoolean());
- mIsPermanent = 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
@@ -160,8 +161,7 @@ PathfindingLinkset::PathfindingLinkset(const PathfindingLinkset& pOther) mDescription(pOther.mDescription),
mLandImpact(pOther.mLandImpact),
mLocation(pOther.mLocation),
- mIsPermanent(pOther.mIsPermanent),
- mIsWalkable(pOther.mIsWalkable),
+ mPathState(pOther.mPathState),
mIsPhantom(pOther.mIsPhantom),
mA(pOther.mA),
mB(pOther.mB),
@@ -181,8 +181,7 @@ PathfindingLinkset& PathfindingLinkset::operator =(const PathfindingLinkset& pOt mDescription = pOther.mDescription;
mLandImpact = pOther.mLandImpact;
mLocation = pOther.mLocation;
- mIsPermanent = pOther.mIsPermanent;
- mIsWalkable = pOther.mIsWalkable;
+ mPathState = pOther.mPathState;
mIsPhantom = pOther.mIsPhantom;
mA = pOther.mA;
mB = pOther.mB;
@@ -219,13 +218,17 @@ const LLVector3& PathfindingLinkset::getPositionAgent() const PathfindingLinkset::EPathState PathfindingLinkset::getPathState() const
{
- return (mIsPermanent ? (mIsWalkable ? kWalkable : kObstacle) : kIgnored);
+ return mPathState;
}
void PathfindingLinkset::setPathState(EPathState pPathState)
{
- mIsPermanent = isPermanent(pPathState);
- mIsWalkable = isWalkable(pPathState);
+ mPathState = pPathState;
+}
+
+PathfindingLinkset::EPathState PathfindingLinkset::getPathState(bool pIsPermanent, bool pIsWalkable)
+{
+ return (pIsPermanent ? (pIsWalkable ? kWalkable : kObstacle) : kIgnored);
}
BOOL PathfindingLinkset::isPermanent(EPathState pPathState)
@@ -272,16 +275,6 @@ BOOL PathfindingLinkset::isWalkable(EPathState pPathState) return retVal;
}
-BOOL PathfindingLinkset::isPermanent() const
-{
- return mIsPermanent;
-}
-
-BOOL PathfindingLinkset::isWalkable() const
-{
- return mIsWalkable;
-}
-
BOOL PathfindingLinkset::isPhantom() const
{
return mIsPhantom;
@@ -994,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.isPermanent() ? "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;
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 02d90accf1..915d799079 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -64,12 +64,10 @@ public: 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 isPermanent() const;
- BOOL isWalkable() const;
-
BOOL isPhantom() const;
void setPhantom(BOOL pIsPhantom);
@@ -93,8 +91,7 @@ private: std::string mDescription;
U32 mLandImpact;
LLVector3 mLocation;
- BOOL mIsPermanent;
- BOOL mIsWalkable;
+ EPathState mPathState;
BOOL mIsPhantom;
S32 mA;
S32 mB;
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 a808a1f08f..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 @@ -162,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" |