From e73f5ef5620d9774187575610aeaf16b917b7337 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 19 Apr 2012 18:09:53 -0700 Subject: Ensuring that the view characters button is active in builds with stubbed pathing libraries. Also, adding extra label fields to better indicate enabled/disabled controls on the console. --- indra/newview/llfloaterpathfindingconsole.cpp | 122 +++++++++++++++++---- indra/newview/llfloaterpathfindingconsole.h | 7 ++ .../default/xui/en/floater_pathfinding_console.xml | 51 +++++---- 3 files changed, 141 insertions(+), 39 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 1c7e336375..0b86c2a617 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -89,9 +89,15 @@ LLHandle LLFloaterPathfindingConsole::sInstanceHand BOOL LLFloaterPathfindingConsole::postBuild() { + mShowLabel = findChild("show_label"); + llassert(mShowLabel != NULL); + mShowNavMeshCheckBox = findChild("show_navmesh"); llassert(mShowNavMeshCheckBox != NULL); + mShowNavMeshWalkabilityLabel = findChild("show_walkability_label"); + llassert(mShowNavMeshWalkabilityLabel != NULL); + mShowNavMeshWalkabilityComboBox = findChild("show_heatmap_mode"); llassert(mShowNavMeshWalkabilityComboBox != NULL); mShowNavMeshWalkabilityComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWalkabilitySet, this)); @@ -155,10 +161,25 @@ BOOL LLFloaterPathfindingConsole::postBuild() mPathfindingSimulatorStatus = findChild("pathfinding_simulator_status"); llassert(mPathfindingSimulatorStatus != NULL); + mCtrlClickLabel = findChild("ctrl_click_label"); + llassert(mCtrlClickLabel != NULL); + + mShiftClickLabel = findChild("shift_click_label"); + llassert(mShiftClickLabel != NULL); + + mCharacterWidthLabel = findChild("character_width_label"); + llassert(mCharacterWidthLabel != NULL); + mCharacterWidthSlider = findChild("character_width"); llassert(mCharacterWidthSlider != NULL); mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this)); + mCharacterWidthUnitLabel = findChild("character_width_unit_label"); + llassert(mCharacterWidthUnitLabel != NULL); + + mCharacterTypeLabel = findChild("character_type_label"); + llassert(mCharacterTypeLabel != NULL); + mCharacterTypeComboBox = findChild("path_character_type"); llassert(mCharacterTypeComboBox != NULL); mCharacterTypeComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this)); @@ -170,17 +191,21 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mClearPathButton != NULL); mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this)); - mPathfindingToolset = new LLToolset(); - mPathfindingToolset->addTool(LLPathfindingPathTool::getInstance()); - mPathfindingToolset->addTool(LLToolCamera::getInstance()); - mPathfindingToolset->setShowFloaterTools(false); - updateCharacterWidth(); - updateCharacterType(); - - if ( !LLPathingLib::getInstance() ) + if (LLPathingLib::getInstance() == NULL) { LLPathingLib::initSystem(); - } + } + + if (LLPathingLib::getInstance() != NULL) + { + mPathfindingToolset = new LLToolset(); + mPathfindingToolset->addTool(LLPathfindingPathTool::getInstance()); + mPathfindingToolset->addTool(LLToolCamera::getInstance()); + mPathfindingToolset->setShowFloaterTools(false); + } + + updateCharacterWidth(); + updateCharacterType(); return LLFloater::postBuild(); } @@ -415,7 +440,9 @@ void LLFloaterPathfindingConsole::setRenderHeatmapType(LLPathingLib::LLPLCharact LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mSelfHandle(), + mShowLabel(), mShowNavMeshCheckBox(NULL), + mShowNavMeshWalkabilityLabel(), mShowNavMeshWalkabilityComboBox(NULL), mShowWalkablesCheckBox(NULL), mShowStaticObstaclesCheckBox(NULL), @@ -435,7 +462,12 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mLinksetsButton(NULL), mFreezeLabel(NULL), mFreezeButton(NULL), + mCtrlClickLabel(), + mShiftClickLabel(), + mCharacterWidthLabel(), + mCharacterWidthUnitLabel(), mCharacterWidthSlider(NULL), + mCharacterTypeLabel(), mCharacterTypeComboBox(NULL), mPathTestingStatus(NULL), mClearPathButton(NULL), @@ -625,9 +657,10 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() switch (mConsoleState) { case kConsoleStateUnknown : - case kConsoleStateLibraryNotImplemented : case kConsoleStateRegionNotEnabled : + mShowLabel->setEnabled(FALSE); mShowNavMeshCheckBox->setEnabled(FALSE); + mShowNavMeshWalkabilityLabel->setEnabled(FALSE); mShowNavMeshWalkabilityComboBox->setEnabled(FALSE); mShowWalkablesCheckBox->setEnabled(FALSE); mShowStaticObstaclesCheckBox->setEnabled(FALSE); @@ -638,7 +671,36 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mViewCharactersButton->setEnabled(FALSE); mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); + mCtrlClickLabel->setEnabled(FALSE); + mShiftClickLabel->setEnabled(FALSE); + mCharacterWidthLabel->setEnabled(FALSE); + mCharacterWidthUnitLabel->setEnabled(FALSE); + mCharacterWidthSlider->setEnabled(FALSE); + mCharacterTypeLabel->setEnabled(FALSE); + mCharacterTypeComboBox->setEnabled(FALSE); + mClearPathButton->setEnabled(FALSE); + clearPath(); + break; + case kConsoleStateLibraryNotImplemented : + mShowLabel->setEnabled(FALSE); + mShowNavMeshCheckBox->setEnabled(FALSE); + mShowNavMeshWalkabilityLabel->setEnabled(FALSE); + mShowNavMeshWalkabilityComboBox->setEnabled(FALSE); + mShowWalkablesCheckBox->setEnabled(FALSE); + mShowStaticObstaclesCheckBox->setEnabled(FALSE); + mShowMaterialVolumesCheckBox->setEnabled(FALSE); + mShowExclusionVolumesCheckBox->setEnabled(FALSE); + mShowWorldCheckBox->setEnabled(FALSE); + mShowXRayCheckBox->setEnabled(FALSE); + mViewCharactersButton->setEnabled(TRUE); + mEditTestTabContainer->selectTab(0); + mTestTab->setEnabled(FALSE); + mCtrlClickLabel->setEnabled(FALSE); + mShiftClickLabel->setEnabled(FALSE); + mCharacterWidthLabel->setEnabled(FALSE); + mCharacterWidthUnitLabel->setEnabled(FALSE); mCharacterWidthSlider->setEnabled(FALSE); + mCharacterTypeLabel->setEnabled(FALSE); mCharacterTypeComboBox->setEnabled(FALSE); mClearPathButton->setEnabled(FALSE); clearPath(); @@ -646,7 +708,9 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() case kConsoleStateCheckingVersion : case kConsoleStateDownloading : case kConsoleStateError : + mShowLabel->setEnabled(FALSE); mShowNavMeshCheckBox->setEnabled(FALSE); + mShowNavMeshWalkabilityLabel->setEnabled(FALSE); mShowNavMeshWalkabilityComboBox->setEnabled(FALSE); mShowWalkablesCheckBox->setEnabled(FALSE); mShowStaticObstaclesCheckBox->setEnabled(FALSE); @@ -657,13 +721,20 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mViewCharactersButton->setEnabled(TRUE); mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); + mCtrlClickLabel->setEnabled(FALSE); + mShiftClickLabel->setEnabled(FALSE); + mCharacterWidthLabel->setEnabled(FALSE); + mCharacterWidthUnitLabel->setEnabled(FALSE); mCharacterWidthSlider->setEnabled(FALSE); + mCharacterTypeLabel->setEnabled(FALSE); mCharacterTypeComboBox->setEnabled(FALSE); mClearPathButton->setEnabled(FALSE); clearPath(); break; case kConsoleStateHasNavMesh : + mShowLabel->setEnabled(TRUE); mShowNavMeshCheckBox->setEnabled(TRUE); + mShowNavMeshWalkabilityLabel->setEnabled(TRUE); mShowNavMeshWalkabilityComboBox->setEnabled(TRUE); mShowWalkablesCheckBox->setEnabled(TRUE); mShowStaticObstaclesCheckBox->setEnabled(TRUE); @@ -673,7 +744,12 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowXRayCheckBox->setEnabled(TRUE); mViewCharactersButton->setEnabled(TRUE); mTestTab->setEnabled(TRUE); + mCtrlClickLabel->setEnabled(TRUE); + mShiftClickLabel->setEnabled(TRUE); + mCharacterWidthLabel->setEnabled(TRUE); + mCharacterWidthUnitLabel->setEnabled(TRUE); mCharacterWidthSlider->setEnabled(TRUE); + mCharacterTypeLabel->setEnabled(TRUE); mCharacterTypeComboBox->setEnabled(TRUE); mClearPathButton->setEnabled(TRUE); mTestTab->setEnabled(TRUE); @@ -862,23 +938,29 @@ void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentStat void LLFloaterPathfindingConsole::switchIntoTestPathMode() { - llassert(mPathfindingToolset != NULL); - LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); - if (toolMgrInstance->getCurrentToolset() != mPathfindingToolset) + if (LLPathingLib::getInstance() != NULL) { - mSavedToolset = toolMgrInstance->getCurrentToolset(); - toolMgrInstance->setCurrentToolset(mPathfindingToolset); + llassert(mPathfindingToolset != NULL); + LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); + if (toolMgrInstance->getCurrentToolset() != mPathfindingToolset) + { + mSavedToolset = toolMgrInstance->getCurrentToolset(); + toolMgrInstance->setCurrentToolset(mPathfindingToolset); + } } } void LLFloaterPathfindingConsole::switchOutOfTestPathMode() { - llassert(mPathfindingToolset != NULL); - LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); - if (toolMgrInstance->getCurrentToolset() == mPathfindingToolset) + if (LLPathingLib::getInstance() != NULL) { - toolMgrInstance->setCurrentToolset(mSavedToolset); - mSavedToolset = NULL; + llassert(mPathfindingToolset != NULL); + LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); + if (toolMgrInstance->getCurrentToolset() == mPathfindingToolset) + { + toolMgrInstance->setCurrentToolset(mSavedToolset); + mSavedToolset = NULL; + } } } diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 618a652195..b492444a7d 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -146,7 +146,9 @@ private: void fillInColorsForNavMeshVisualization(); LLRootHandle mSelfHandle; + LLTextBase *mShowLabel; LLCheckBoxCtrl *mShowNavMeshCheckBox; + LLTextBase *mShowNavMeshWalkabilityLabel; LLComboBox *mShowNavMeshWalkabilityComboBox; LLCheckBoxCtrl *mShowWalkablesCheckBox; LLCheckBoxCtrl *mShowStaticObstaclesCheckBox; @@ -166,7 +168,12 @@ private: LLButton *mLinksetsButton; LLTextBase *mFreezeLabel; LLButton *mFreezeButton; + LLTextBase *mCtrlClickLabel; + LLTextBase *mShiftClickLabel; + LLTextBase *mCharacterWidthLabel; + LLTextBase *mCharacterWidthUnitLabel; LLSliderCtrl *mCharacterWidthSlider; + LLTextBase *mCharacterTypeLabel; LLComboBox *mCharacterTypeComboBox; LLTextBase *mPathTestingStatus; LLButton *mClearPathButton; 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 28f0d9fa4a..7c1c7b687e 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -90,16 +90,18 @@ height="250" width="200"> + height="13" + word_wrap="true" + use_ellipses="false" + type="string" + text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="show_label" + length="1" + follows="left|top" + layout="topleft" + top_pad="9" + width="200"> Show: + height="13" + word_wrap="true" + use_ellipses="false" + type="string" + text_color="LabelTextColor" + length="1" + layout="topleft" + top_pad="18" + width="250"> Lost characters? Bad performance?