From b912c27bf44a45e607adc3b5c94d3fd8a9bbf53e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 16:40:53 -0700 Subject: PATH-711: Implementing Leo's changes for the pathfinding console. --- indra/newview/llfloaterpathfindingconsole.cpp | 137 +------------------------- 1 file changed, 1 insertion(+), 136 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 54e60ce0f4..59ce330a10 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -64,9 +64,6 @@ #define XUI_CHARACTER_TYPE_C 3 #define XUI_CHARACTER_TYPE_D 4 -#define XUI_EDIT_TAB_INDEX 0 -#define XUI_TEST_TAB_INDEX 1 - #define SET_SHAPE_RENDER_FLAG(_flag,_type) _flag |= (1U << _type) #define CONTROL_NAME_RETRIEVE_NEIGHBOR "RetrieveNeighboringRegion" @@ -138,37 +135,9 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mViewCharactersButton != NULL); mViewCharactersButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this)); - mEditTestTabContainer = findChild("edit_test_tab_container"); - llassert(mEditTestTabContainer != NULL); - mEditTestTabContainer->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onTabSwitch, this)); - - mEditTab = findChild("edit_panel"); - llassert(mEditTab != NULL); - mTestTab = findChild("test_panel"); llassert(mTestTab != NULL); - mUnfreezeLabel = findChild("unfreeze_label"); - llassert(mUnfreezeLabel != NULL); - - mUnfreezeButton = findChild("enter_unfrozen_mode"); - llassert(mUnfreezeButton != NULL); - mUnfreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onUnfreezeClicked, this)); - - mLinksetsLabel = findChild("edit_linksets_label"); - llassert(mLinksetsLabel != NULL); - - mLinksetsButton = findChild("view_and_edit_linksets"); - llassert(mLinksetsButton != NULL); - mLinksetsButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this)); - - mFreezeLabel = findChild("freeze_label"); - llassert(mFreezeLabel != NULL); - - mFreezeButton = findChild("enter_frozen_mode"); - llassert(mFreezeButton != NULL); - mFreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onFreezeClicked, this)); - mPathfindingViewerStatus = findChild("pathfinding_viewer_status"); llassert(mPathfindingViewerStatus != NULL); @@ -205,11 +174,6 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mClearPathButton != NULL); mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this)); - if (LLPathingLib::getInstance() == NULL) - { - LLPathingLib::initSystem(); - } - if (LLPathingLib::getInstance() != NULL) { mPathfindingToolset = new LLToolset(); @@ -246,11 +210,6 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) fillInColorsForNavMeshVisualization(); } - if (!mAgentStateSlot.connected()) - { - mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLFloaterPathfindingConsole::onAgentStateCB, this, _1)); - } - if (!mRegionBoundarySlot.connected()) { mRegionBoundarySlot = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterPathfindingConsole::onRegionBoundaryCross, this)); @@ -266,14 +225,10 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) mPathEventSlot = LLPathfindingPathTool::getInstance()->registerPathEventListener(boost::bind(&LLFloaterPathfindingConsole::onPathEvent, this)); } - setAgentState(LLPathfindingManager::getInstance()->getAgentState()); setDefaultInputs(); updatePathTestStatus(); - if (mEditTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX) - { - switchIntoTestPathMode(); - } + switchIntoTestPathMode(); } void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) @@ -295,11 +250,6 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) mRegionBoundarySlot.disconnect(); } - if (mAgentStateSlot.connected()) - { - mAgentStateSlot.disconnect(); - } - if (mNavMeshZoneSlot.connected()) { mNavMeshZoneSlot.disconnect(); @@ -501,15 +451,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mPathfindingViewerStatus(NULL), mPathfindingSimulatorStatus(NULL), mViewCharactersButton(NULL), - mEditTestTabContainer(NULL), - mEditTab(NULL), mTestTab(NULL), - mUnfreezeLabel(NULL), - mUnfreezeButton(NULL), - mLinksetsLabel(NULL), - mLinksetsButton(NULL), - mFreezeLabel(NULL), - mFreezeButton(NULL), mCtrlClickLabel(), mShiftClickLabel(), mCharacterWidthLabel(), @@ -522,7 +464,6 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mNavMeshZoneSlot(), mNavMeshZone(), mIsNavMeshUpdating(false), - mAgentStateSlot(), mRegionBoundarySlot(), mTeleportFailedSlot(), mPathEventSlot(), @@ -577,35 +518,6 @@ void LLFloaterPathfindingConsole::onViewCharactersClicked() LLFloaterPathfindingCharacters::openCharactersViewer(); } -void LLFloaterPathfindingConsole::onTabSwitch() -{ - if (mEditTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX) - { - switchIntoTestPathMode(); - } - else - { - switchOutOfTestPathMode(); - } -} - -void LLFloaterPathfindingConsole::onUnfreezeClicked() -{ - mUnfreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateUnfrozen); -} - -void LLFloaterPathfindingConsole::onFreezeClicked() -{ - mFreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateFrozen); -} - -void LLFloaterPathfindingConsole::onViewEditLinksetClicked() -{ - LLFloaterPathfindingLinksets::openLinksetsEditor(); -} - void LLFloaterPathfindingConsole::onCharacterWidthSet() { updateCharacterWidth(); @@ -658,11 +570,6 @@ void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENav } } -void LLFloaterPathfindingConsole::onAgentStateCB(LLPathfindingManager::EAgentState pAgentState) -{ - setAgentState(pAgentState); -} - void LLFloaterPathfindingConsole::onRegionBoundaryCross() { initializeNavMeshZoneForCurrentRegion(); @@ -706,7 +613,6 @@ void LLFloaterPathfindingConsole::onPathEvent() void LLFloaterPathfindingConsole::setDefaultInputs() { - mEditTestTabContainer->selectTab(XUI_EDIT_TAB_INDEX); setRenderWorld(TRUE); setRenderNavMesh(FALSE); setRenderWalkables(FALSE); @@ -776,7 +682,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(FALSE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -802,7 +707,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(TRUE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -830,7 +734,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(TRUE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -1028,44 +931,6 @@ void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems() } } -void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentState pAgentState) -{ - switch (LLPathfindingManager::getInstance()->getLastKnownNonErrorAgentState()) - { - case LLPathfindingManager::kAgentStateUnknown : - case LLPathfindingManager::kAgentStateNotEnabled : - mEditTab->setEnabled(FALSE); - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mLinksetsLabel->setEnabled(FALSE); - mLinksetsButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateFrozen : - mEditTab->setEnabled(TRUE); - mUnfreezeLabel->setEnabled(TRUE); - mUnfreezeButton->setEnabled(TRUE); - mLinksetsLabel->setEnabled(FALSE); - mLinksetsButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateUnfrozen : - mEditTab->setEnabled(TRUE); - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mLinksetsLabel->setEnabled(TRUE); - mLinksetsButton->setEnabled(TRUE); - mFreezeLabel->setEnabled(TRUE); - mFreezeButton->setEnabled(TRUE); - break; - default : - llassert(0); - break; - } -} - void LLFloaterPathfindingConsole::switchIntoTestPathMode() { if (LLPathingLib::getInstance() != NULL) -- cgit v1.2.3 From e738e704b88d64b8a0183f94045d229d9f498bd1 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 17:03:15 -0700 Subject: PATH-714: Removing the DEPRECATED_UNVERSIONED_NAVMESH as the viewer no longer has to support the Premium Wilderness regions on the old server code. --- indra/newview/llfloaterpathfindingconsole.cpp | 34 --------------------------- 1 file changed, 34 deletions(-) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 59ce330a10..eae7aa4bcc 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -847,39 +847,6 @@ std::string LLFloaterPathfindingConsole::getSimulatorStatusText() const { std::string simulatorStatusText(""); -#ifdef DEPRECATED_UNVERSIONED_NAVMESH - if (LLPathfindingManager::getInstance()->isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX()) - { - switch (mNavMeshZone.getNavMeshZoneStatus()) - { - case LLPathfindingNavMeshZone::kNavMeshZonePending : - simulatorStatusText = getString("navmesh_simulator_status_pending"); - break; - case LLPathfindingNavMeshZone::kNavMeshZoneBuilding : - simulatorStatusText = getString("navmesh_simulator_status_building"); - break; - case LLPathfindingNavMeshZone::kNavMeshZoneSomePending : - simulatorStatusText = getString("navmesh_simulator_status_some_pending"); - break; - case LLPathfindingNavMeshZone::kNavMeshZoneSomeBuilding : - simulatorStatusText = getString("navmesh_simulator_status_some_building"); - break; - case LLPathfindingNavMeshZone::kNavMeshZonePendingAndBuilding : - simulatorStatusText = getString("navmesh_simulator_status_pending_and_building"); - break; - case LLPathfindingNavMeshZone::kNavMeshZoneComplete : - simulatorStatusText = getString("navmesh_simulator_status_complete"); - break; - default : - simulatorStatusText = getString("navmesh_simulator_status_unknown"); - break; - } - } - else - { - simulatorStatusText = getString("navmesh_simulator_status_region_not_enabled"); - } -#else // DEPRECATED_UNVERSIONED_NAVMESH switch (mNavMeshZone.getNavMeshZoneStatus()) { case LLPathfindingNavMeshZone::kNavMeshZonePending : @@ -904,7 +871,6 @@ std::string LLFloaterPathfindingConsole::getSimulatorStatusText() const simulatorStatusText = getString("navmesh_simulator_status_unknown"); break; } -#endif // DEPRECATED_UNVERSIONED_NAVMESH return simulatorStatusText; } -- cgit v1.2.3 From 76f7c0e58c75add62c0fb989bf13bfa50952c4bd Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 13 Jun 2012 16:12:11 -0400 Subject: path-722: Make sure to remove the bake navmesh button if the pathingfinding console is closed. --- indra/newview/llfloaterpathfindingconsole.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llfloaterpathfindingconsole.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index eae7aa4bcc..7d3efb5454 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -51,6 +51,7 @@ #include "pipeline.h" #include "llpathinglib.h" #include "llviewerparcelmgr.h" +#include "llpanelnavmeshrebake.h" #define XUI_RENDER_HEATMAP_NONE 0 #define XUI_RENDER_HEATMAP_A 1 @@ -264,6 +265,9 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) setDefaultInputs(); setConsoleState(kConsoleStateUnknown); cleanupRenderableRestoreItems(); + LLPanelNavMeshRebake* pPanelNavMeshRebake = LLPanelNavMeshRebake::getInstance(); + if ( pPanelNavMeshRebake ) { pPanelNavMeshRebake->setVisible( FALSE ); } + LLFloater::onClose(pIsAppQuitting); } -- cgit v1.2.3