diff options
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 122 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_console.xml | 51 |
3 files changed, 141 insertions, 39 deletions
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> LLFloaterPathfindingConsole::sInstanceHand BOOL LLFloaterPathfindingConsole::postBuild()
{
+ mShowLabel = findChild<LLTextBase>("show_label");
+ llassert(mShowLabel != NULL);
+
mShowNavMeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh");
llassert(mShowNavMeshCheckBox != NULL);
+ mShowNavMeshWalkabilityLabel = findChild<LLTextBase>("show_walkability_label");
+ llassert(mShowNavMeshWalkabilityLabel != NULL);
+
mShowNavMeshWalkabilityComboBox = findChild<LLComboBox>("show_heatmap_mode");
llassert(mShowNavMeshWalkabilityComboBox != NULL);
mShowNavMeshWalkabilityComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWalkabilitySet, this));
@@ -155,10 +161,25 @@ BOOL LLFloaterPathfindingConsole::postBuild() mPathfindingSimulatorStatus = findChild<LLTextBase>("pathfinding_simulator_status");
llassert(mPathfindingSimulatorStatus != NULL);
+ mCtrlClickLabel = findChild<LLTextBase>("ctrl_click_label");
+ llassert(mCtrlClickLabel != NULL);
+
+ mShiftClickLabel = findChild<LLTextBase>("shift_click_label");
+ llassert(mShiftClickLabel != NULL);
+
+ mCharacterWidthLabel = findChild<LLTextBase>("character_width_label");
+ llassert(mCharacterWidthLabel != NULL);
+
mCharacterWidthSlider = findChild<LLSliderCtrl>("character_width");
llassert(mCharacterWidthSlider != NULL);
mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this));
+ mCharacterWidthUnitLabel = findChild<LLTextBase>("character_width_unit_label");
+ llassert(mCharacterWidthUnitLabel != NULL);
+
+ mCharacterTypeLabel = findChild<LLTextBase>("character_type_label");
+ llassert(mCharacterTypeLabel != NULL);
+
mCharacterTypeComboBox = findChild<LLComboBox>("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<LLFloaterPathfindingConsole> 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"> <text - height="13" - word_wrap="true" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" - layout="topleft" - top_pad="9" - 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: </text> <check_box @@ -116,6 +118,7 @@ type="string" text_color="LabelTextColor" text_readonly_color="LabelDisabledColor" + name="show_walkability_label" length="1" follows="left|top" layout="topleft" @@ -317,6 +320,8 @@ use_ellipses="false" type="string" text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="ctrl_click_label" length="1" left="16" follows="left|top" @@ -331,6 +336,8 @@ use_ellipses="false" type="string" text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="shift_click_label" length="1" follows="left|top" layout="topleft" @@ -352,6 +359,8 @@ use_ellipses="false" type="string" text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="character_width_label" length="1" follows="left|top" layout="topleft" @@ -377,6 +386,8 @@ use_ellipses="false" type="string" text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="character_width_unit_label" length="1" follows="left|top" layout="topleft" @@ -391,6 +402,8 @@ use_ellipses="false" type="string" text_color="LabelTextColor" + text_readonly_color="LabelDisabledColor" + name="character_type_label" length="1" follows="left|top" layout="topleft" @@ -504,15 +517,15 @@ top_pad="0" width="400"> <text - height="13" - word_wrap="true" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - layout="topleft" - top_pad="18" - width="250"> + 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? </text> <button |