diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-03-27 13:38:51 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-03-27 13:38:51 -0700 |
commit | 083c81f53f79f53aafdb380a178be081ae461018 (patch) | |
tree | 5f6469ea7d7114de9fc73b43125010ce34677825 /indra | |
parent | 68f72f102ab19ba2aac3ed357abfaae261737508 (diff) |
PATH-433: Pumping the character type selection from the console floater into the generatePath call of the pathing library.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 79 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.h | 12 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_pathfinding_console.xml | 64 |
3 files changed, 71 insertions, 84 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index f830dc1fac..c83153a15d 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -35,7 +35,7 @@ #include "llagent.h"
#include "llpanel.h"
#include "llbutton.h"
-#include "llradiogroup.h"
+#include "llcheckboxctrl.h"
#include "llsliderctrl.h"
#include "lllineeditor.h"
#include "lltextbase.h"
@@ -57,6 +57,7 @@ #define XUI_RENDER_HEATMAP_C 3
#define XUI_RENDER_HEATMAP_D 4
+#define XUI_CHARACTER_TYPE_NONE 0
#define XUI_CHARACTER_TYPE_A 1
#define XUI_CHARACTER_TYPE_B 2
#define XUI_CHARACTER_TYPE_C 3
@@ -139,9 +140,9 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mCharacterWidthSlider != NULL);
mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this));
- mCharacterTypeRadioGroup = findChild<LLRadioGroup>("character_type");
- llassert(mCharacterTypeRadioGroup != NULL);
- mCharacterTypeRadioGroup->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this));
+ mCharacterTypeComboBox = findChild<LLComboBox>("path_character_type");
+ llassert(mCharacterTypeComboBox != NULL);
+ mCharacterTypeComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this));
mPathTestingStatus = findChild<LLTextBase>("path_test_status");
llassert(mPathTestingStatus != NULL);
@@ -441,8 +442,11 @@ LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getChar {
ECharacterType characterType;
- switch (mCharacterTypeRadioGroup->getValue().asInteger())
+ switch (mCharacterTypeComboBox->getValue().asInteger())
{
+ case XUI_CHARACTER_TYPE_NONE :
+ characterType = kCharacterTypeNone;
+ break;
case XUI_CHARACTER_TYPE_A :
characterType = kCharacterTypeA;
break;
@@ -456,7 +460,7 @@ LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getChar characterType = kCharacterTypeD;
break;
default :
- characterType = kCharacterTypeA;
+ characterType = kCharacterTypeNone;
llassert(0);
break;
}
@@ -470,6 +474,9 @@ void LLFloaterPathfindingConsole::setCharacterType(ECharacterType pCharacterType switch (pCharacterType)
{
+ case kCharacterTypeNone :
+ radioGroupValue = XUI_CHARACTER_TYPE_NONE;
+ break;
case kCharacterTypeA :
radioGroupValue = XUI_CHARACTER_TYPE_A;
break;
@@ -483,12 +490,12 @@ void LLFloaterPathfindingConsole::setCharacterType(ECharacterType pCharacterType radioGroupValue = XUI_CHARACTER_TYPE_D;
break;
default :
- radioGroupValue = XUI_CHARACTER_TYPE_A;
+ radioGroupValue = XUI_CHARACTER_TYPE_NONE;
llassert(0);
break;
}
- mCharacterTypeRadioGroup->setValue(radioGroupValue);
+ mCharacterTypeComboBox->setValue(radioGroupValue);
}
LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
@@ -514,7 +521,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mFreezeLabel(NULL),
mFreezeButton(NULL),
mCharacterWidthSlider(NULL),
- mCharacterTypeRadioGroup(NULL),
+ mCharacterTypeComboBox(NULL),
mPathTestingStatus(NULL),
mClearPathButton(NULL),
mNavMeshZoneSlot(),
@@ -593,32 +600,7 @@ void LLFloaterPathfindingConsole::onCharacterWidthSet() void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
{
- switch (getCharacterType())
- {
- case kCharacterTypeA :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mCharacterTypeRadioGroup->getName() << "' to CharacterTypeA"
- << llendl;
- break;
- case kCharacterTypeB :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mCharacterTypeRadioGroup->getName() << "' to CharacterTypeB"
- << llendl;
- break;
- case kCharacterTypeC :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mCharacterTypeRadioGroup->getName() << "' to CharacterTypeC"
- << llendl;
- break;
- case kCharacterTypeD :
- llwarns << "functionality has not yet been implemented to toggle '"
- << mCharacterTypeRadioGroup->getName() << "' to CharacterTypeD"
- << llendl;
- break;
- default :
- llassert(0);
- break;
- }
+ generatePath();
updatePathTestStatus();
}
@@ -715,7 +697,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mEditTestTabContainer->selectTab(0);
mTestTab->setEnabled(FALSE);
mCharacterWidthSlider->setEnabled(FALSE);
- mCharacterTypeRadioGroup->setEnabled(FALSE);
+ mCharacterTypeComboBox->setEnabled(FALSE);
mClearPathButton->setEnabled(FALSE);
mHasStartPoint = false;
mHasEndPoint = false;
@@ -734,7 +716,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mEditTestTabContainer->selectTab(0);
mTestTab->setEnabled(FALSE);
mCharacterWidthSlider->setEnabled(FALSE);
- mCharacterTypeRadioGroup->setEnabled(FALSE);
+ mCharacterTypeComboBox->setEnabled(FALSE);
mClearPathButton->setEnabled(FALSE);
mHasStartPoint = false;
mHasEndPoint = false;
@@ -750,7 +732,7 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mViewCharactersButton->setEnabled(TRUE);
mTestTab->setEnabled(TRUE);
mCharacterWidthSlider->setEnabled(TRUE);
- mCharacterTypeRadioGroup->setEnabled(TRUE);
+ mCharacterTypeComboBox->setEnabled(TRUE);
mClearPathButton->setEnabled(TRUE);
mTestTab->setEnabled(TRUE);
break;
@@ -928,6 +910,27 @@ void LLFloaterPathfindingConsole::generatePath() if (mHasStartPoint && mHasEndPoint)
{
mPathData.mCharacterWidth = getCharacterWidth();
+ switch (getCharacterType())
+ {
+ case kCharacterTypeNone :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+ break;
+ case kCharacterTypeA :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_A;
+ break;
+ case kCharacterTypeB :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_B;
+ break;
+ case kCharacterTypeC :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_C;
+ break;
+ case kCharacterTypeD :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_D;
+ break;
+ default :
+ mPathData.mCharacterType = LLPathingLib::LLPL_CHARACTER_TYPE_NONE;
+ break;
+ }
LLPathingLib::getInstance()->generatePath(mPathData);
}
}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index dff9b08383..447eaf726d 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -36,7 +36,6 @@ class LLSD; class LLPanel; -class LLRadioGroup; class LLSliderCtrl; class LLLineEditor; class LLTextBase; @@ -62,10 +61,11 @@ public: typedef enum { - kCharacterTypeA = 0, - kCharacterTypeB = 1, - kCharacterTypeC = 2, - kCharacterTypeD = 3 + kCharacterTypeNone, + kCharacterTypeA, + kCharacterTypeB, + kCharacterTypeC, + kCharacterTypeD } ECharacterType; virtual BOOL postBuild(); @@ -179,7 +179,7 @@ private: LLTextBase *mFreezeLabel; LLButton *mFreezeButton; LLSliderCtrl *mCharacterWidthSlider; - LLRadioGroup *mCharacterTypeRadioGroup; + 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 c7b9e2bf19..a672ecce8e 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -30,7 +30,7 @@ <floater.string name="pathing_choose_start_and_end_points">Please choose start and end points.</floater.string> <floater.string name="pathing_choose_start_point">Please choose start point.</floater.string> <floater.string name="pathing_choose_end_point">Please choose end point.</floater.string> - <floater.string name="pathing_path_valid">Path is shown in blue.</floater.string> + <floater.string name="pathing_path_valid">Path is shown in olive green.</floater.string> <floater.string name="navmesh_update_needed">Region boundary hit, navmesh may not be accurate.</floater.string> <text height="13" @@ -420,53 +420,38 @@ follows="left|top" layout="topleft" left_pad="-165" - top_pad="9" + top_pad="13" width="190"> Character type </text> - <radio_group + <combo_box follows="top|left" - height="20" layout="topleft" - left_delta="0" - name="character_type" - top_delta="18" - value="1" - width="190"> - <radio_item + height="19" + width="156" + top_pad="5" + name="path_character_type"> + <combo_box.item + label="None" + name="path_character_type_none" + value="0" /> + <combo_box.item label="A" - height="14" - width="30" - value="1" - name="character_type_a"/> - <radio_item + name="path_character_type_a" + value="1" /> + <combo_box.item label="B" - height="14" - width="30" - layout="topleft" - top="4" - left="50" - value="2" - name="character_type_b"/> - <radio_item + name="path_character_type_b" + value="2" /> + <combo_box.item label="C" - height="14" - width="30" - layout="topleft" - top="4" - left="100" - value="3" - name="character_type_c"/> - <radio_item + name="path_character_type_c" + value="3" /> + <combo_box.item label="D" - height="14" - width="30" - layout="topleft" - top="4" - left="150" - value="4" - name="character_type_d"/> - </radio_group> + name="path_character_type_d" + value="4" /> + </combo_box> <text height="14" word_wrap="true" @@ -476,7 +461,6 @@ length="1" follows="left|top" layout="topleft" - left_pad="-190" top_pad="12" width="190"> Ctrl-click to select start point. |