diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-04-20 18:15:55 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-04-20 18:15:55 -0700 |
commit | de71961b0d400d4989181ee7419942955a775741 (patch) | |
tree | 0f076ca82cbd59f06b4af56000513b3d878bc330 /indra/newview | |
parent | a4adebb116e6e32f35f94e7b34d83a1b3a8fce0a (diff) |
Adding new controls to the console for showing waterplane and world movables only. Also, re-arranging the sorting of the check boxes.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 107 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_console.xml | 33 |
3 files changed, 124 insertions, 30 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 0b86c2a617..6b3bc29519 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -92,8 +92,16 @@ BOOL LLFloaterPathfindingConsole::postBuild() mShowLabel = findChild<LLTextBase>("show_label");
llassert(mShowLabel != NULL);
+ mShowWorldCheckBox = findChild<LLCheckBoxCtrl>("show_world");
+ llassert(mShowWorldCheckBox != NULL);
+ mShowWorldCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldSet, this));
+
+ mShowWorldMovablesOnlyCheckBox = findChild<LLCheckBoxCtrl>("show_world_movables_only");
+ llassert(mShowWorldMovablesOnlyCheckBox != NULL);
+
mShowNavMeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh");
llassert(mShowNavMeshCheckBox != NULL);
+ mShowNavMeshCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowNavMeshSet, this));
mShowNavMeshWalkabilityLabel = findChild<LLTextBase>("show_walkability_label");
llassert(mShowNavMeshWalkabilityLabel != NULL);
@@ -114,10 +122,10 @@ BOOL LLFloaterPathfindingConsole::postBuild() mShowExclusionVolumesCheckBox = findChild<LLCheckBoxCtrl>("show_exclusion_volumes");
llassert(mShowExclusionVolumesCheckBox != NULL);
- mShowWorldCheckBox = findChild<LLCheckBoxCtrl>("show_world");
- llassert(mShowWorldCheckBox != NULL);
+ mShowRenderWaterPlaneCheckBox = findChild<LLCheckBoxCtrl>("show_water_plane");
+ llassert(mShowRenderWaterPlaneCheckBox != NULL);
- mShowXRayCheckBox = findChild<LLCheckBoxCtrl>("x-ray");
+ mShowXRayCheckBox = findChild<LLCheckBoxCtrl>("show_xray");
llassert(mShowXRayCheckBox != NULL);
mViewCharactersButton = findChild<LLButton>("view_characters_floater");
@@ -315,6 +323,7 @@ BOOL LLFloaterPathfindingConsole::isRenderNavMesh() const void LLFloaterPathfindingConsole::setRenderNavMesh(BOOL pIsRenderNavMesh)
{
mShowNavMeshCheckBox->set(pIsRenderNavMesh);
+ setNavMeshRenderState();
}
BOOL LLFloaterPathfindingConsole::isRenderWalkables() const
@@ -365,6 +374,27 @@ BOOL LLFloaterPathfindingConsole::isRenderWorld() const void LLFloaterPathfindingConsole::setRenderWorld(BOOL pIsRenderWorld)
{
mShowWorldCheckBox->set(pIsRenderWorld);
+ setWorldRenderState();
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWorldMovablesOnly() const
+{
+ return (mShowWorldCheckBox->get() && mShowWorldMovablesOnlyCheckBox->get());
+}
+
+void LLFloaterPathfindingConsole::setRenderWorldMovablesOnly(BOOL pIsRenderWorldMovablesOnly)
+{
+ mShowWorldMovablesOnlyCheckBox->set(pIsRenderWorldMovablesOnly);
+}
+
+BOOL LLFloaterPathfindingConsole::isRenderWaterPlane() const
+{
+ return mShowRenderWaterPlaneCheckBox->get();
+}
+
+void LLFloaterPathfindingConsole::setRenderWaterPlane(BOOL pIsRenderWaterPlane)
+{
+ mShowRenderWaterPlaneCheckBox->set(pIsRenderWaterPlane);
}
BOOL LLFloaterPathfindingConsole::isRenderXRay() const
@@ -441,6 +471,8 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed),
mSelfHandle(),
mShowLabel(),
+ mShowWorldCheckBox(NULL),
+ mShowWorldMovablesOnlyCheckBox(NULL),
mShowNavMeshCheckBox(NULL),
mShowNavMeshWalkabilityLabel(),
mShowNavMeshWalkabilityComboBox(NULL),
@@ -448,7 +480,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mShowStaticObstaclesCheckBox(NULL),
mShowMaterialVolumesCheckBox(NULL),
mShowExclusionVolumesCheckBox(NULL),
- mShowWorldCheckBox(NULL),
+ mShowRenderWaterPlaneCheckBox(NULL),
mShowXRayCheckBox(NULL),
mPathfindingViewerStatus(NULL),
mPathfindingSimulatorStatus(NULL),
@@ -500,6 +532,16 @@ LLFloaterPathfindingConsole::~LLFloaterPathfindingConsole() {
}
+void LLFloaterPathfindingConsole::onShowWorldSet()
+{
+ setWorldRenderState();
+}
+
+void LLFloaterPathfindingConsole::onShowNavMeshSet()
+{
+ setNavMeshRenderState();
+}
+
void LLFloaterPathfindingConsole::onShowWalkabilitySet()
{
LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType());
@@ -596,7 +638,8 @@ void LLFloaterPathfindingConsole::onAgentStateCB(LLPathfindingManager::EAgentSta void LLFloaterPathfindingConsole::onRegionBoundaryCross()
{
initializeNavMeshZoneForCurrentRegion();
- mShowWorldCheckBox->set(TRUE);
+ setRenderWorld(TRUE);
+ setRenderWorldMovablesOnly(FALSE);
}
void LLFloaterPathfindingConsole::onPathEvent()
@@ -636,13 +679,14 @@ void LLFloaterPathfindingConsole::onPathEvent() void LLFloaterPathfindingConsole::setDefaultInputs()
{
mEditTestTabContainer->selectTab(XUI_EDIT_TAB_INDEX);
- mShowNavMeshCheckBox->set(FALSE);
- mShowWalkablesCheckBox->set(FALSE);
- mShowMaterialVolumesCheckBox->set(FALSE);
- mShowStaticObstaclesCheckBox->set(FALSE);
- mShowExclusionVolumesCheckBox->set(FALSE);
- mShowWorldCheckBox->set(TRUE);
- mShowXRayCheckBox->set(FALSE);
+ setRenderWorld(TRUE);
+ setRenderNavMesh(FALSE);
+ setRenderWalkables(FALSE);
+ setRenderMaterialVolumes(FALSE);
+ setRenderStaticObstacles(FALSE);
+ setRenderExclusionVolumes(FALSE);
+ setRenderWaterPlane(FALSE);
+ setRenderXRay(FALSE);
}
void LLFloaterPathfindingConsole::setConsoleState(EConsoleState pConsoleState)
@@ -652,6 +696,25 @@ void LLFloaterPathfindingConsole::setConsoleState(EConsoleState pConsoleState) updateStatusOnConsoleState();
}
+void LLFloaterPathfindingConsole::setWorldRenderState()
+{
+ BOOL renderWorld = isRenderWorld();
+
+ mShowWorldMovablesOnlyCheckBox->setEnabled(renderWorld);
+ if (!renderWorld)
+ {
+ mShowWorldMovablesOnlyCheckBox->set(FALSE);
+ }
+}
+
+void LLFloaterPathfindingConsole::setNavMeshRenderState()
+{
+ BOOL renderNavMesh = isRenderNavMesh();
+
+ mShowNavMeshWalkabilityLabel->setEnabled(renderNavMesh);
+ mShowNavMeshWalkabilityComboBox->setEnabled(renderNavMesh);
+}
+
void LLFloaterPathfindingConsole::updateControlsOnConsoleState()
{
switch (mConsoleState)
@@ -659,6 +722,8 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() case kConsoleStateUnknown :
case kConsoleStateRegionNotEnabled :
mShowLabel->setEnabled(FALSE);
+ mShowWorldCheckBox->setEnabled(FALSE);
+ mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
mShowNavMeshCheckBox->setEnabled(FALSE);
mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
@@ -666,7 +731,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowStaticObstaclesCheckBox->setEnabled(FALSE);
mShowMaterialVolumesCheckBox->setEnabled(FALSE);
mShowExclusionVolumesCheckBox->setEnabled(FALSE);
- mShowWorldCheckBox->setEnabled(FALSE);
+ mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
mShowXRayCheckBox->setEnabled(FALSE);
mViewCharactersButton->setEnabled(FALSE);
mEditTestTabContainer->selectTab(0);
@@ -683,6 +748,8 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() break;
case kConsoleStateLibraryNotImplemented :
mShowLabel->setEnabled(FALSE);
+ mShowWorldCheckBox->setEnabled(FALSE);
+ mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
mShowNavMeshCheckBox->setEnabled(FALSE);
mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
@@ -690,7 +757,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowStaticObstaclesCheckBox->setEnabled(FALSE);
mShowMaterialVolumesCheckBox->setEnabled(FALSE);
mShowExclusionVolumesCheckBox->setEnabled(FALSE);
- mShowWorldCheckBox->setEnabled(FALSE);
+ mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
mShowXRayCheckBox->setEnabled(FALSE);
mViewCharactersButton->setEnabled(TRUE);
mEditTestTabContainer->selectTab(0);
@@ -709,6 +776,8 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() case kConsoleStateDownloading :
case kConsoleStateError :
mShowLabel->setEnabled(FALSE);
+ mShowWorldCheckBox->setEnabled(FALSE);
+ mShowWorldMovablesOnlyCheckBox->setEnabled(FALSE);
mShowNavMeshCheckBox->setEnabled(FALSE);
mShowNavMeshWalkabilityLabel->setEnabled(FALSE);
mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
@@ -716,7 +785,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowStaticObstaclesCheckBox->setEnabled(FALSE);
mShowMaterialVolumesCheckBox->setEnabled(FALSE);
mShowExclusionVolumesCheckBox->setEnabled(FALSE);
- mShowWorldCheckBox->setEnabled(FALSE);
+ mShowRenderWaterPlaneCheckBox->setEnabled(FALSE);
mShowXRayCheckBox->setEnabled(FALSE);
mViewCharactersButton->setEnabled(TRUE);
mEditTestTabContainer->selectTab(0);
@@ -733,14 +802,15 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() break;
case kConsoleStateHasNavMesh :
mShowLabel->setEnabled(TRUE);
+ mShowWorldCheckBox->setEnabled(TRUE);
+ setWorldRenderState();
mShowNavMeshCheckBox->setEnabled(TRUE);
- mShowNavMeshWalkabilityLabel->setEnabled(TRUE);
- mShowNavMeshWalkabilityComboBox->setEnabled(TRUE);
+ setNavMeshRenderState();
mShowWalkablesCheckBox->setEnabled(TRUE);
mShowStaticObstaclesCheckBox->setEnabled(TRUE);
mShowMaterialVolumesCheckBox->setEnabled(TRUE);
mShowExclusionVolumesCheckBox->setEnabled(TRUE);
- mShowWorldCheckBox->setEnabled(TRUE);
+ mShowRenderWaterPlaneCheckBox->setEnabled(TRUE);
mShowXRayCheckBox->setEnabled(TRUE);
mViewCharactersButton->setEnabled(TRUE);
mTestTab->setEnabled(TRUE);
@@ -752,7 +822,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mCharacterTypeLabel->setEnabled(TRUE);
mCharacterTypeComboBox->setEnabled(TRUE);
mClearPathButton->setEnabled(TRUE);
- mTestTab->setEnabled(TRUE);
break;
default :
llassert(0);
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index b492444a7d..8c271d2352 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -80,6 +80,12 @@ public: BOOL isRenderWorld() const;
void setRenderWorld(BOOL pIsRenderWorld);
+ BOOL isRenderWorldMovablesOnly() const;
+ void setRenderWorldMovablesOnly(BOOL pIsRenderWorldMovablesOnly);
+
+ BOOL isRenderWaterPlane() const;
+ void setRenderWaterPlane(BOOL pIsRenderWaterPlane);
+
BOOL isRenderXRay() const;
void setRenderXRay(BOOL pIsRenderXRay);
@@ -108,6 +114,8 @@ private: LLFloaterPathfindingConsole(const LLSD& pSeed);
virtual ~LLFloaterPathfindingConsole();
+ void onShowWorldSet();
+ void onShowNavMeshSet();
void onShowWalkabilitySet();
void onViewCharactersClicked();
void onTabSwitch();
@@ -124,6 +132,8 @@ private: void setDefaultInputs();
void setConsoleState(EConsoleState pConsoleState);
+ void setWorldRenderState();
+ void setNavMeshRenderState();
void updateControlsOnConsoleState();
void updateStatusOnConsoleState();
@@ -147,6 +157,8 @@ private: LLRootHandle<LLFloaterPathfindingConsole> mSelfHandle;
LLTextBase *mShowLabel;
+ LLCheckBoxCtrl *mShowWorldCheckBox;
+ LLCheckBoxCtrl *mShowWorldMovablesOnlyCheckBox;
LLCheckBoxCtrl *mShowNavMeshCheckBox;
LLTextBase *mShowNavMeshWalkabilityLabel;
LLComboBox *mShowNavMeshWalkabilityComboBox;
@@ -154,7 +166,7 @@ private: LLCheckBoxCtrl *mShowStaticObstaclesCheckBox;
LLCheckBoxCtrl *mShowMaterialVolumesCheckBox;
LLCheckBoxCtrl *mShowExclusionVolumesCheckBox;
- LLCheckBoxCtrl *mShowWorldCheckBox;
+ LLCheckBoxCtrl *mShowRenderWaterPlaneCheckBox;
LLCheckBoxCtrl *mShowXRayCheckBox;
LLTextBase *mPathfindingViewerStatus;
LLTextBase *mPathfindingSimulatorStatus;
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 7c1c7b687e..a951106640 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -2,7 +2,7 @@ <floater open_positioning="cascading" can_tear_off="false" - height="406" + height="446" layout="topleft" name="floater_pathfinding_console" help_topic="floater_pathfinding_console" @@ -87,7 +87,7 @@ bevel_style="none" follows="left|top" layout="topleft" - height="250" + height="297" width="200"> <text height="13" @@ -106,7 +106,23 @@ </text> <check_box height="19" + label="World" + layout="topleft" + name="show_world" + top_pad="4" + width="90" /> + <check_box + height="19" + label="Movables only" + layout="topleft" + left="20" + name="show_world_movables_only" + top_pad="4" + width="90" /> + <check_box + height="19" label="Navmesh" + left="0" layout="topleft" name="show_navmesh" top_pad="7" @@ -161,7 +177,6 @@ left="0" name="show_walkables" top_pad="10" - tool_tip="Functionality is not implemented currently." width="90" /> <check_box height="19" @@ -169,7 +184,6 @@ layout="topleft" name="show_material_volumes" top_pad="4" - tool_tip="Functionality is not implemented currently." width="90" /> <check_box height="19" @@ -177,7 +191,6 @@ layout="topleft" name="show_static_obstacles" top_pad="4" - tool_tip="Functionality is not implemented currently." width="90" /> <check_box height="19" @@ -188,16 +201,16 @@ width="90" /> <check_box height="19" - label="World" + label="Water plane" layout="topleft" - name="show_world" + name="show_water_plane" top_pad="4" width="90" /> <check_box height="19" - label="X-Ray" + label="With X-ray vision" layout="topleft" - name="x-ray" + name="show_xray" top_pad="4" width="90" /> </panel> @@ -506,7 +519,7 @@ height="0" left="14" width="430" - top_pad="0" + top_pad="25" visible="true" /> <panel border="false" |