summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp291
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h35
2 files changed, 223 insertions, 103 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 46017ccdfc..7ee9ac4d1b 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -42,6 +42,18 @@
#include "llpathinglib.h"
+#define XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY 1
+#define XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY 2
+
+#define XUI_PATH_SELECT_NONE 0
+#define XUI_PATH_SELECT_START_POINT 1
+#define XUI_PATH_SELECT_END_POINT 2
+
+#define XUI_CHARACTER_TYPE_A 1
+#define XUI_CHARACTER_TYPE_B 2
+#define XUI_CHARACTER_TYPE_C 3
+#define XUI_CHARACTER_TYPE_D 4
+
//---------------------------------------------------------------------------
// LLFloaterPathfindingConsole
//---------------------------------------------------------------------------
@@ -107,6 +119,191 @@ BOOL LLFloaterPathfindingConsole::postBuild()
return LLFloater::postBuild();
}
+LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole::getRegionOverlayDisplay() const
+{
+ ERegionOverlayDisplay regionOverlayDisplay;
+ switch (mRegionOverlayDisplayRadioGroup->getValue().asInteger())
+ {
+ case XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY :
+ regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry;
+ break;
+ case XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY :
+ regionOverlayDisplay = kRenderOverlayOnAllRenderableGeometry;
+ break;
+ default :
+ regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry;
+ llassert(0);
+ break;
+ }
+
+ return regionOverlayDisplay;
+}
+
+void LLFloaterPathfindingConsole::setRegionOverlayDisplay(ERegionOverlayDisplay regionOverlayDisplay)
+{
+ LLSD radioGroupValue;
+
+ switch (regionOverlayDisplay)
+ {
+ case kRenderOverlayOnFixedPhysicsGeometry :
+ radioGroupValue = XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY;
+ break;
+ case kRenderOverlayOnAllRenderableGeometry :
+ radioGroupValue = XUI_RENDER_OVERLAY_ON_ALL_RENDERABLE_GEOMETRY;
+ break;
+ default :
+ radioGroupValue = XUI_RENDER_OVERLAY_ON_FIXED_PHYSICS_GEOMETRY;
+ llassert(0);
+ break;
+ }
+
+ mRegionOverlayDisplayRadioGroup->setValue(radioGroupValue);
+}
+
+LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::getPathSelectionState() const
+{
+ EPathSelectionState pathSelectionState;
+
+ switch (mPathSelectionRadioGroup->getValue().asInteger())
+ {
+ case XUI_PATH_SELECT_START_POINT :
+ pathSelectionState = kPathSelectStartPoint;
+ break;
+ case XUI_PATH_SELECT_END_POINT :
+ pathSelectionState = kPathSelectEndPoint;
+ break;
+ default :
+ pathSelectionState = kPathSelectNone;
+ break;
+ }
+
+ return pathSelectionState;
+}
+
+void LLFloaterPathfindingConsole::setPathSelectionState(EPathSelectionState pathSelectionState)
+{
+ LLSD radioGroupValue;
+
+ switch (pathSelectionState)
+ {
+ case kPathSelectStartPoint :
+ radioGroupValue = XUI_PATH_SELECT_START_POINT;
+ break;
+ case kPathSelectEndPoint :
+ radioGroupValue = XUI_PATH_SELECT_END_POINT;
+ break;
+ default :
+ radioGroupValue = XUI_PATH_SELECT_NONE;
+ break;
+ }
+
+ mPathSelectionRadioGroup->setValue(radioGroupValue);
+}
+
+F32 LLFloaterPathfindingConsole::getCharacterWidth() const
+{
+ return mCharacterWidthSlider->getValueF32();
+}
+
+void LLFloaterPathfindingConsole::setCharacterWidth(F32 characterWidth)
+{
+ mCharacterWidthSlider->setValue(LLSD(characterWidth));
+}
+
+LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getCharacterType() const
+{
+ ECharacterType characterType;
+
+ switch (mCharacterTypeRadioGroup->getValue().asInteger())
+ {
+ case XUI_CHARACTER_TYPE_A :
+ characterType = kCharacterTypeA;
+ break;
+ case XUI_CHARACTER_TYPE_B :
+ characterType = kCharacterTypeB;
+ break;
+ case XUI_CHARACTER_TYPE_C :
+ characterType = kCharacterTypeC;
+ break;
+ case XUI_CHARACTER_TYPE_D :
+ characterType = kCharacterTypeD;
+ break;
+ default :
+ characterType = kCharacterTypeA;
+ llassert(0);
+ break;
+ }
+
+ return characterType;
+}
+
+void LLFloaterPathfindingConsole::setCharacterType(ECharacterType characterType)
+{
+ LLSD radioGroupValue;
+
+ switch (characterType)
+ {
+ case kCharacterTypeA :
+ radioGroupValue = XUI_CHARACTER_TYPE_A;
+ break;
+ case kCharacterTypeB :
+ radioGroupValue = XUI_CHARACTER_TYPE_B;
+ break;
+ case kCharacterTypeC :
+ radioGroupValue = XUI_CHARACTER_TYPE_C;
+ break;
+ case kCharacterTypeD :
+ radioGroupValue = XUI_CHARACTER_TYPE_D;
+ break;
+ default :
+ radioGroupValue = XUI_CHARACTER_TYPE_A;
+ llassert(0);
+ break;
+ }
+
+ mCharacterTypeRadioGroup->setValue(radioGroupValue);
+}
+
+F32 LLFloaterPathfindingConsole::getTerrainMaterialA() const
+{
+ return mTerrainMaterialA->getValue().asReal();
+}
+
+void LLFloaterPathfindingConsole::setTerrainMaterialA(F32 terrainMaterial)
+{
+ mTerrainMaterialA->setValue(LLSD(terrainMaterial));
+}
+
+F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const
+{
+ return mTerrainMaterialB->getValue().asReal();
+}
+
+void LLFloaterPathfindingConsole::setTerrainMaterialB(F32 terrainMaterial)
+{
+ mTerrainMaterialB->setValue(LLSD(terrainMaterial));
+}
+
+F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const
+{
+ return mTerrainMaterialC->getValue().asReal();
+}
+
+void LLFloaterPathfindingConsole::setTerrainMaterialC(F32 terrainMaterial)
+{
+ mTerrainMaterialC->setValue(LLSD(terrainMaterial));
+}
+
+F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const
+{
+ return mTerrainMaterialD->getValue().asReal();
+}
+
+void LLFloaterPathfindingConsole::setTerrainMaterialD(F32 terrainMaterial)
+{
+ mTerrainMaterialD->setValue(LLSD(terrainMaterial));
+}
+
LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
: LLFloater(pSeed),
mShowNavmeshCheckBox(NULL),
@@ -338,99 +535,7 @@ void LLFloaterPathfindingConsole::onTerrainMaterialDSet()
llwarns << "functionality has not yet been implemented to setting '" << mTerrainMaterialD->getName()
<< "' to value (" << terrainMaterial << ")" << llendl;
}
-
-LLFloaterPathfindingConsole::ERegionOverlayDisplay LLFloaterPathfindingConsole::getRegionOverlayDisplay() const
-{
- ERegionOverlayDisplay regionOverlayDisplay;
- switch (mRegionOverlayDisplayRadioGroup->getValue().asInteger())
- {
- case 1 :
- regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry;
- break;
- case 2:
- regionOverlayDisplay = kRenderOverlayOnAllRenderableGeometry;
- break;
- default :
- regionOverlayDisplay = kRenderOverlayOnFixedPhysicsGeometry;
- llassert(0);
- break;
- }
-
- return regionOverlayDisplay;
-}
-
-LLFloaterPathfindingConsole::EPathSelectionState LLFloaterPathfindingConsole::getPathSelectionState() const
-{
- EPathSelectionState pathSelectionState;
-
- switch (mPathSelectionRadioGroup->getValue().asInteger())
- {
- case 1 :
- pathSelectionState = kPathSelectStartPoint;
- break;
- case 2:
- pathSelectionState = kPathSelectEndPoint;
- break;
- default :
- pathSelectionState = kPathSelectNone;
- break;
- }
-
- return pathSelectionState;
-}
-
-F32 LLFloaterPathfindingConsole::getCharacterWidth() const
-{
- return mCharacterWidthSlider->getValueF32();
-}
-
-LLFloaterPathfindingConsole::ECharacterType LLFloaterPathfindingConsole::getCharacterType() const
-{
- ECharacterType characterType;
-
- switch (mCharacterTypeRadioGroup->getValue().asInteger())
- {
- case 1 :
- characterType = kCharacterTypeA;
- break;
- case 2 :
- characterType = kCharacterTypeB;
- break;
- case 3 :
- characterType = kCharacterTypeC;
- break;
- case 4 :
- characterType = kCharacterTypeD;
- break;
- default :
- characterType = kCharacterTypeA;
- llassert(0);
- break;
- }
-
- return characterType;
-}
-
-F32 LLFloaterPathfindingConsole::getTerrainMaterialA() const
-{
- return mTerrainMaterialA->getValue().asReal();
-}
-
-F32 LLFloaterPathfindingConsole::getTerrainMaterialB() const
-{
- return mTerrainMaterialB->getValue().asReal();
-}
-
-F32 LLFloaterPathfindingConsole::getTerrainMaterialC() const
-{
- return mTerrainMaterialC->getValue().asReal();
-}
-
-F32 LLFloaterPathfindingConsole::getTerrainMaterialD() const
-{
- return mTerrainMaterialD->getValue().asReal();
-}
BOOL LLFloaterPathfindingConsole::allowAllRenderables()
{
return getRegionOverlayDisplay() == kRenderOverlayOnAllRenderableGeometry ? true : false;
-} \ No newline at end of file
+}
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index c5e1a9536b..a5e8a48263 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -42,6 +42,7 @@ class LLFloaterPathfindingConsole
{
friend class LLFloaterReg;
+public:
typedef enum
{
kRenderOverlayOnFixedPhysicsGeometry = 0,
@@ -63,10 +64,33 @@ class LLFloaterPathfindingConsole
kCharacterTypeD = 3
} ECharacterType;
-public:
virtual BOOL postBuild();
BOOL allowAllRenderables();
+ ERegionOverlayDisplay getRegionOverlayDisplay() const;
+ void setRegionOverlayDisplay(ERegionOverlayDisplay regionOverlayDisplay);
+
+ EPathSelectionState getPathSelectionState() const;
+ void setPathSelectionState(EPathSelectionState pathSelectionState);
+
+ F32 getCharacterWidth() const;
+ void setCharacterWidth(F32 characterWidth);
+
+ ECharacterType getCharacterType() const;
+ void setCharacterType(ECharacterType characterType);
+
+ F32 getTerrainMaterialA() const;
+ void setTerrainMaterialA(F32 terrainMaterial);
+
+ F32 getTerrainMaterialB() const;
+ void setTerrainMaterialB(F32 terrainMaterial);
+
+ F32 getTerrainMaterialC() const;
+ void setTerrainMaterialC(F32 terrainMaterial);
+
+ F32 getTerrainMaterialD() const;
+ void setTerrainMaterialD(F32 terrainMaterial);
+
protected:
private:
@@ -93,15 +117,6 @@ private:
void onTerrainMaterialCSet();
void onTerrainMaterialDSet();
- ERegionOverlayDisplay getRegionOverlayDisplay() const;
- EPathSelectionState getPathSelectionState() const;
- F32 getCharacterWidth() const;
- ECharacterType getCharacterType() const;
- F32 getTerrainMaterialA() const;
- F32 getTerrainMaterialB() const;
- F32 getTerrainMaterialC() const;
- F32 getTerrainMaterialD() const;
-
LLCheckBoxCtrl *mShowNavmeshCheckBox;
LLCheckBoxCtrl *mShowExcludeVolumesCheckBox;
LLCheckBoxCtrl *mShowPathCheckBox;