From fb96262c47d9eb022f9291637c6a9ebaec833dca Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 15 Feb 2012 11:51:49 -0800 Subject: PATH-284: Stubbing functionality for the walkability heatmap drop-down. --- indra/newview/llfloaterpathfindingconsole.cpp | 111 ++++++++++++++++++++- indra/newview/llfloaterpathfindingconsole.h | 23 ++++- .../default/xui/en/floater_pathfinding_console.xml | 20 +++- 3 files changed, 145 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index eccea867c7..728efc52a4 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -39,6 +39,7 @@ #include "lllineeditor.h" #include "lltextbase.h" #include "lltabcontainer.h" +#include "llcombobox.h" #include "llnavmeshstation.h" #include "llfloaterreg.h" #include "llviewerregion.h" @@ -47,6 +48,12 @@ #include "LLPathingLib.h" +#define XUI_RENDER_HEATMAP_NONE 0 +#define XUI_RENDER_HEATMAP_A 1 +#define XUI_RENDER_HEATMAP_B 2 +#define XUI_RENDER_HEATMAP_C 3 +#define XUI_RENDER_HEATMAP_D 4 + #define XUI_CHARACTER_TYPE_A 1 #define XUI_CHARACTER_TYPE_B 2 #define XUI_CHARACTER_TYPE_C 3 @@ -70,6 +77,10 @@ BOOL LLFloaterPathfindingConsole::postBuild() mShowNavMeshCheckBox = findChild("show_navmesh"); llassert(mShowNavMeshCheckBox != NULL); + mShowNavMeshWalkabilityComboBox = findChild("show_heatmap_mode"); + llassert(mShowNavMeshWalkabilityComboBox != NULL); + mShowNavMeshWalkabilityComboBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWalkabilitySet, this)); + mShowWalkablesCheckBox = findChild("show_walkables"); llassert(mShowWalkablesCheckBox != NULL); @@ -142,8 +153,8 @@ BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, E BOOL LLFloaterPathfindingConsole::isGeneratePathMode(MASK mask, EClickType clicktype, BOOL down) const { return (getVisible() && (mEditTestTabContainer->getCurrentPanelIndex() == 1) && - (clicktype == LLMouseHandler::CLICK_LEFT) && down && - (((mask & MASK_CONTROL) && !(mask & (~MASK_CONTROL))) || + (clicktype == LLMouseHandler::CLICK_LEFT) && down && + (((mask & MASK_CONTROL) && !(mask & (~MASK_CONTROL))) || ((mask & MASK_SHIFT) && !(mask & (~MASK_SHIFT))))); } @@ -226,6 +237,66 @@ void LLFloaterPathfindingConsole::setRenderWorld(BOOL pIsRenderWorld) mShowWorldCheckBox->set(pIsRenderWorld); } +LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::getRenderHeatmapType() const +{ + ERenderHeatmapType renderHeatmapType; + + switch (mShowNavMeshWalkabilityComboBox->getValue().asInteger()) + { + case XUI_RENDER_HEATMAP_NONE : + renderHeatmapType = kRenderHeatmapNone; + break; + case XUI_RENDER_HEATMAP_A : + renderHeatmapType = kRenderHeatmapA; + break; + case XUI_RENDER_HEATMAP_B : + renderHeatmapType = kRenderHeatmapB; + break; + case XUI_RENDER_HEATMAP_C : + renderHeatmapType = kRenderHeatmapC; + break; + case XUI_RENDER_HEATMAP_D : + renderHeatmapType = kRenderHeatmapD; + break; + default : + renderHeatmapType = kRenderHeatmapNone; + llassert(0); + break; + } + + return renderHeatmapType; +} + +void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType) +{ + LLSD comboBoxValue; + + switch (pRenderHeatmapType) + { + case kRenderHeatmapNone : + comboBoxValue = XUI_RENDER_HEATMAP_NONE; + break; + case kRenderHeatmapA : + comboBoxValue = XUI_RENDER_HEATMAP_A; + break; + case kRenderHeatmapB : + comboBoxValue = XUI_RENDER_HEATMAP_B; + break; + case kRenderHeatmapC : + comboBoxValue = XUI_RENDER_HEATMAP_C; + break; + case kRenderHeatmapD : + comboBoxValue = XUI_RENDER_HEATMAP_D; + break; + default : + comboBoxValue = XUI_RENDER_HEATMAP_NONE; + llassert(0); + break; + } + + return mShowNavMeshWalkabilityComboBox->setValue(comboBoxValue); +} + F32 LLFloaterPathfindingConsole::getCharacterWidth() const { return mCharacterWidthSlider->getValueF32(); @@ -312,6 +383,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) : LLFloater(pSeed), mSelfHandle(), mShowNavMeshCheckBox(NULL), + mShowNavMeshWalkabilityComboBox(NULL), mShowWalkablesCheckBox(NULL), mShowStaticObstaclesCheckBox(NULL), mShowMaterialVolumesCheckBox(NULL), @@ -408,6 +480,41 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) } } +void LLFloaterPathfindingConsole::onShowWalkabilitySet() +{ + switch (getRenderHeatmapType()) + { + case kRenderHeatmapNone : + llwarns << "functionality has not yet been implemented to toggle '" + << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapNone" + << llendl; + break; + case kRenderHeatmapA : + llwarns << "functionality has not yet been implemented to toggle '" + << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapA" + << llendl; + break; + case kRenderHeatmapB : + llwarns << "functionality has not yet been implemented to toggle '" + << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapB" + << llendl; + break; + case kRenderHeatmapC : + llwarns << "functionality has not yet been implemented to toggle '" + << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapC" + << llendl; + break; + case kRenderHeatmapD : + llwarns << "functionality has not yet been implemented to toggle '" + << mShowNavMeshWalkabilityComboBox->getName() << "' to RenderHeatmapD" + << llendl; + break; + default : + llassert(0); + break; + } +} + void LLFloaterPathfindingConsole::onShowWorldToggle() { BOOL checkBoxValue = mShowWorldCheckBox->get(); diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 8f4b7d625e..726bf36636 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -40,6 +40,7 @@ class LLLineEditor; class LLTextBase; class LLCheckBoxCtrl; class LLTabContainer; +class LLComboBox; class LLFloaterPathfindingConsole : public LLFloater @@ -47,6 +48,15 @@ class LLFloaterPathfindingConsole friend class LLFloaterReg; public: + typedef enum + { + kRenderHeatmapNone, + kRenderHeatmapA, + kRenderHeatmapB, + kRenderHeatmapC, + kRenderHeatmapD + } ERenderHeatmapType; + typedef enum { kCharacterTypeA = 0, @@ -82,11 +92,14 @@ public: BOOL isRenderWorld() const; void setRenderWorld(BOOL pIsRenderWorld); - F32 getCharacterWidth() const; - void setCharacterWidth(F32 pCharacterWidth); + ERenderHeatmapType getRenderHeatmapType() const; + void setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType); + + F32 getCharacterWidth() const; + void setCharacterWidth(F32 pCharacterWidth); - ECharacterType getCharacterType() const; - void setCharacterType(ECharacterType pCharacterType); + ECharacterType getCharacterType() const; + void setCharacterType(ECharacterType pCharacterType); void setHasNavMeshReceived(); void setHasNoNavMesh(); @@ -101,6 +114,7 @@ private: virtual void onOpen(const LLSD& pKey); + void onShowWalkabilitySet(); void onShowWorldToggle(); void onCharacterWidthSet(); void onCharacterTypeSwitch(); @@ -113,6 +127,7 @@ private: LLRootHandle mSelfHandle; LLCheckBoxCtrl *mShowNavMeshCheckBox; + LLComboBox *mShowNavMeshWalkabilityComboBox; LLCheckBoxCtrl *mShowWalkablesCheckBox; LLCheckBoxCtrl *mShowStaticObstaclesCheckBox; LLCheckBoxCtrl *mShowMaterialVolumesCheckBox; 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 3fe3dfe963..4a41736972 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 @@ + + Show walkability heatmap: + + width="125"> -- cgit v1.2.3