From 0517f5f487550f0616bc2ca062f94c3ccf63374e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 14 Aug 2012 16:39:43 -0700 Subject: PATH-854: Adding support to display whether linksets are scripted or not in the pathfinding linksets floater. --- indra/newview/llfloaterpathfindinglinksets.cpp | 46 +++++++++++++--------- indra/newview/llpathfindinglinkset.cpp | 16 ++++++++ indra/newview/llpathfindinglinkset.h | 5 +++ .../xui/en/floater_pathfinding_linksets.xml | 34 ++++++++++------ 4 files changed, 70 insertions(+), 31 deletions(-) diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 4d3b7fca91..651be274d9 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -399,11 +399,14 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi columns[2]["column"] = "owner"; columns[2]["value"] = getString("linkset_terrain_owner"); - columns[3]["column"] = "land_impact"; - columns[3]["value"] = getString("linkset_terrain_land_impact"); + columns[3]["column"] = "scripted"; + columns[3]["value"] = getString("linkset_terrain_scripted"); - columns[4]["column"] = "dist_from_you"; - columns[4]["value"] = getString("linkset_terrain_dist_from_you"); + columns[4]["column"] = "land_impact"; + columns[4]["value"] = getString("linkset_terrain_land_impact"); + + columns[5]["column"] = "dist_from_you"; + columns[5]["value"] = getString("linkset_terrain_dist_from_you"); } else { @@ -416,14 +419,21 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi columns[2]["column"] = "owner"; columns[2]["value"] = getOwnerName(pLinksetPtr); - columns[3]["column"] = "land_impact"; - columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); + columns[3]["column"] = "scripted"; + columns[3]["value"] = (pLinksetPtr->hasIsScripted() + ? (pLinksetPtr->isScripted() + ? getString("linkset_is_scripted") + : getString("linkset_is_not_scripted")) + : getString("linkset_is_unknown_scripted")); + + columns[4]["column"] = "land_impact"; + columns[4]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); - columns[4]["column"] = "dist_from_you"; - columns[4]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation())); + columns[5]["column"] = "dist_from_you"; + columns[5]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation())); } - columns[5]["column"] = "linkset_use"; + columns[6]["column"] = "linkset_use"; std::string linksetUse = getLinksetUseString(pLinksetPtr->getLinksetUse()); if (pLinksetPtr->isTerrain()) { @@ -441,19 +451,19 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListItemData(const LLPathfi { linksetUse += (" " + getString("linkset_is_restricted_non_volume_state")); } - columns[5]["value"] = linksetUse; + columns[6]["value"] = linksetUse; - columns[6]["column"] = "a_percent"; - columns[6]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA()); + columns[7]["column"] = "a_percent"; + columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA()); - columns[7]["column"] = "b_percent"; - columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB()); + columns[8]["column"] = "b_percent"; + columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB()); - columns[8]["column"] = "c_percent"; - columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC()); + columns[9]["column"] = "c_percent"; + columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC()); - columns[9]["column"] = "d_percent"; - columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); + columns[10]["column"] = "d_percent"; + columns[10]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); return columns; } diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index fe4daabd89..779db5512e 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -39,6 +39,7 @@ #define LINKSET_MODIFIABLE_FIELD "modifiable" #define LINKSET_CATEGORY_FIELD "navmesh_category" #define LINKSET_CAN_BE_VOLUME "can_be_volume" +#define LINKSET_IS_SCRIPTED_FIELD "is_scripted" #define LINKSET_PHANTOM_FIELD "phantom" #define LINKSET_WALKABILITY_A_FIELD "A" #define LINKSET_WALKABILITY_B_FIELD "B" @@ -62,6 +63,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLSD& pTerrainData) mLandImpact(0U), mIsModifiable(FALSE), mCanBeVolume(FALSE), + mIsScripted(FALSE), + mHasIsScripted(TRUE), mLinksetUse(kUnknown), mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), @@ -77,6 +80,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& mLandImpact(0U), mIsModifiable(TRUE), mCanBeVolume(TRUE), + mIsScripted(FALSE), + mHasIsScripted(FALSE), mLinksetUse(kUnknown), mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), @@ -93,6 +98,8 @@ LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) mLandImpact(pOther.mLandImpact), mIsModifiable(pOther.mIsModifiable), mCanBeVolume(pOther.mCanBeVolume), + mIsScripted(pOther.mIsScripted), + mHasIsScripted(pOther.mHasIsScripted), mLinksetUse(pOther.mLinksetUse), mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA), mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB), @@ -113,6 +120,8 @@ LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkse mLandImpact = pOther.mLandImpact; mIsModifiable = pOther.mIsModifiable; mCanBeVolume = pOther.mCanBeVolume; + mIsScripted = pOther.mIsScripted; + mHasIsScripted = pOther.mHasIsScripted; mLinksetUse = pOther.mLinksetUse; mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA; mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB; @@ -193,6 +202,13 @@ void LLPathfindingLinkset::parseLinksetData(const LLSD &pLinksetData) llassert(pLinksetData.has(LINKSET_MODIFIABLE_FIELD)); llassert(pLinksetData.get(LINKSET_MODIFIABLE_FIELD).isBoolean()); mIsModifiable = pLinksetData.get(LINKSET_MODIFIABLE_FIELD).asBoolean(); + + mHasIsScripted = pLinksetData.has(LINKSET_IS_SCRIPTED_FIELD); + if (mHasIsScripted) + { + llassert(pLinksetData.get(LINKSET_IS_SCRIPTED_FIELD).isBoolean()); + mIsScripted = pLinksetData.get(LINKSET_IS_SCRIPTED_FIELD).asBoolean(); + } } void LLPathfindingLinkset::parsePathfindingData(const LLSD &pLinksetData) diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h index 73b4d6bad4..98675fccc4 100644 --- a/indra/newview/llpathfindinglinkset.h +++ b/indra/newview/llpathfindinglinkset.h @@ -63,6 +63,9 @@ public: inline ELinksetUse getLinksetUse() const {return mLinksetUse;}; + inline BOOL isScripted() const {return mIsScripted;}; + inline BOOL hasIsScripted() const {return mHasIsScripted;}; + inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; @@ -98,6 +101,8 @@ private: U32 mLandImpact; BOOL mIsModifiable; BOOL mCanBeVolume; + BOOL mIsScripted; + BOOL mHasIsScripted; ELinksetUse mLinksetUse; S32 mWalkabilityCoefficientA; S32 mWalkabilityCoefficientB; 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 eaed92ac55..9bc5c7d5a4 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_linksets.xml @@ -4,9 +4,9 @@ can_resize="true" can_tear_off="false" height="395" - width="1015" + width="1075" min_height="395" - min_width="1015" + min_width="1075" layout="topleft" name="floater_pathfinding_linksets" help_topic="floater_pathfinding_linksets" @@ -25,11 +25,15 @@ [Terrain] -- -- + -- -- -- [Loading] [Unknown] [group] + Yes + No + Unknown Walkable Static obstacle Movable obstacle @@ -47,7 +51,7 @@ follows="left|top|right|bottom" layout="topleft" height="226" - width="999"> + width="1059">