summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-15 16:48:50 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-15 16:48:50 -0800
commit6ee41cfe1425c62bb1c1ac04c0f4dc4810675397 (patch)
tree9597c0962be2206b511a4d9069066c0345ec571c
parenta17dee79f04e21f414d59ed1d5566160dda8fa08 (diff)
PATH-284: Adding first pass for toggling state for frozen/unfrozen modes.
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp155
-rw-r--r--indra/newview/llfloaterpathfindingconsole.h15
-rw-r--r--indra/newview/skins/default/xui/en/floater_pathfinding_console.xml39
3 files changed, 179 insertions, 30 deletions
diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp
index 728efc52a4..1b948c442b 100644
--- a/indra/newview/llfloaterpathfindingconsole.cpp
+++ b/indra/newview/llfloaterpathfindingconsole.cpp
@@ -70,10 +70,6 @@ LLHandle<LLFloaterPathfindingConsole> LLFloaterPathfindingConsole::sInstanceHand
BOOL LLFloaterPathfindingConsole::postBuild()
{
- childSetAction("view_characters_floater", boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this));
- childSetAction("view_and_edit_linksets", boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this));
- childSetAction("clear_path", boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this));
-
mShowNavMeshCheckBox = findChild<LLCheckBoxCtrl>("show_navmesh");
llassert(mShowNavMeshCheckBox != NULL);
@@ -97,12 +93,37 @@ BOOL LLFloaterPathfindingConsole::postBuild()
llassert(mShowWorldCheckBox != NULL);
mShowWorldCheckBox->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onShowWorldToggle, this));
- mPathfindingStatus = findChild<LLTextBase>("pathfinding_status");
- llassert(mPathfindingStatus != NULL);
+ mViewCharactersButton = findChild<LLButton>("view_characters_floater");
+ llassert(mViewCharactersButton != NULL);
+ mViewCharactersButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this));
mEditTestTabContainer = findChild<LLTabContainer>("edit_test_tab_container");
llassert(mEditTestTabContainer != NULL);
+ mUnfreezeLabel = findChild<LLTextBase>("unfreeze_label");
+ llassert(mUnfreezeLabel != NULL);
+
+ mUnfreezeButton = findChild<LLButton>("enter_unfrozen_mode");
+ llassert(mUnfreezeButton != NULL);
+ mUnfreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onUnfreezeClicked, this));
+
+ mLinksetsLabel = findChild<LLTextBase>("edit_linksets_label");
+ llassert(mLinksetsLabel != NULL);
+
+ mLinksetsButton = findChild<LLButton>("view_and_edit_linksets");
+ llassert(mLinksetsButton != NULL);
+ mLinksetsButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this));
+
+ mFreezeLabel = findChild<LLTextBase>("freeze_label");
+ llassert(mFreezeLabel != NULL);
+
+ mFreezeButton = findChild<LLButton>("enter_frozen_mode");
+ llassert(mFreezeButton != NULL);
+ mFreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onFreezeClicked, this));
+
+ mPathfindingStatus = findChild<LLTextBase>("pathfinding_status");
+ llassert(mPathfindingStatus != NULL);
+
mCharacterWidthSlider = findChild<LLSliderCtrl>("character_width");
llassert(mCharacterWidthSlider != NULL);
mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this));
@@ -113,6 +134,12 @@ BOOL LLFloaterPathfindingConsole::postBuild()
mPathTestingStatus = findChild<LLTextBase>("path_test_status");
llassert(mPathTestingStatus != NULL);
+
+ mClearPathButton = findChild<LLButton>("clear_path");
+ llassert(mClearPathButton != NULL);
+ mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this));
+
+ updateOnPathfindingServerStatus();
updatePathTestStatus();
return LLFloater::postBuild();
@@ -237,8 +264,8 @@ void LLFloaterPathfindingConsole::setRenderWorld(BOOL pIsRenderWorld)
mShowWorldCheckBox->set(pIsRenderWorld);
}
-LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::getRenderHeatmapType() const
-{
+LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::getRenderHeatmapType() const
+{
ERenderHeatmapType renderHeatmapType;
switch (mShowNavMeshWalkabilityComboBox->getValue().asInteger())
@@ -265,10 +292,10 @@ LLFloaterPathfindingConsole::ERenderHeatmapType LLFloaterPathfindingConsole::get
}
return renderHeatmapType;
-}
-
-void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType)
-{
+}
+
+void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRenderHeatmapType)
+{
LLSD comboBoxValue;
switch (pRenderHeatmapType)
@@ -295,7 +322,7 @@ void LLFloaterPathfindingConsole::setRenderHeatmapType(ERenderHeatmapType pRende
}
return mShowNavMeshWalkabilityComboBox->setValue(comboBoxValue);
-}
+}
F32 LLFloaterPathfindingConsole::getCharacterWidth() const
{
@@ -390,13 +417,22 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mShowExclusionVolumesCheckBox(NULL),
mShowWorldCheckBox(NULL),
mPathfindingStatus(NULL),
+ mViewCharactersButton(NULL),
mEditTestTabContainer(NULL),
+ mUnfreezeLabel(NULL),
+ mUnfreezeButton(NULL),
+ mLinksetsLabel(NULL),
+ mLinksetsButton(NULL),
+ mFreezeLabel(NULL),
+ mFreezeButton(NULL),
mCharacterWidthSlider(NULL),
mCharacterTypeRadioGroup(NULL),
mPathTestingStatus(NULL),
+ mClearPathButton(NULL),
mNavMeshCnt(0),
mHasStartPoint(false),
- mHasEndPoint(false)
+ mHasEndPoint(false),
+ mIsRegionFrozen(false)
{
mSelfHandle.bind(this);
@@ -478,6 +514,21 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
}
}
}
+
+ updateOnPathfindingServerStatus();
+}
+
+std::string LLFloaterPathfindingConsole::getCurrentRegionCapabilityURL() const
+{
+ std::string capURL("");
+
+ LLViewerRegion *region = gAgent.getRegion();
+ if (region != NULL)
+ {
+ capURL = region->getCapability("RetrieveNavMeshSrc");
+ }
+
+ return capURL;
}
void LLFloaterPathfindingConsole::onShowWalkabilitySet()
@@ -573,6 +624,20 @@ void LLFloaterPathfindingConsole::onViewCharactersClicked()
LLFloaterPathfindingCharacters::openCharactersViewer();
}
+void LLFloaterPathfindingConsole::onUnfreezeClicked()
+{
+ mIsRegionFrozen = false;
+ updateOnPathfindingServerStatus();
+ llwarns << "functionality has not yet been implemented to set unfrozen state" << llendl;
+}
+
+void LLFloaterPathfindingConsole::onFreezeClicked()
+{
+ mIsRegionFrozen = true;
+ updateOnPathfindingServerStatus();
+ llwarns << "functionality has not yet been implemented to set frozen state" << llendl;
+}
+
void LLFloaterPathfindingConsole::onViewEditLinksetClicked()
{
LLFloaterPathfindingLinksets::openLinksetsEditor();
@@ -585,6 +650,68 @@ void LLFloaterPathfindingConsole::onClearPathClicked()
updatePathTestStatus();
}
+void LLFloaterPathfindingConsole::updateOnPathfindingServerStatus()
+{
+ std::string capURL = getCurrentRegionCapabilityURL();
+
+ if (capURL.empty())
+ {
+ mShowNavMeshCheckBox->setEnabled(FALSE);
+ mShowNavMeshWalkabilityComboBox->setEnabled(FALSE);
+ mShowWalkablesCheckBox->setEnabled(FALSE);
+ mShowStaticObstaclesCheckBox->setEnabled(FALSE);
+ mShowMaterialVolumesCheckBox->setEnabled(FALSE);
+ mShowExclusionVolumesCheckBox->setEnabled(FALSE);
+ mShowWorldCheckBox->setEnabled(FALSE);
+ mViewCharactersButton->setEnabled(FALSE);
+ mEditTestTabContainer->setEnabled(FALSE);
+ mUnfreezeLabel->setEnabled(FALSE);
+ mUnfreezeButton->setEnabled(FALSE);
+ mLinksetsLabel->setEnabled(FALSE);
+ mLinksetsButton->setEnabled(FALSE);
+ mFreezeLabel->setEnabled(FALSE);
+ mFreezeButton->setEnabled(FALSE);
+ mCharacterWidthSlider->setEnabled(FALSE);
+ mCharacterTypeRadioGroup->setEnabled(FALSE);
+ mClearPathButton->setEnabled(FALSE);
+
+ mEditTestTabContainer->selectTab(0);
+ }
+ else
+ {
+ mShowNavMeshCheckBox->setEnabled(TRUE);
+ mShowNavMeshWalkabilityComboBox->setEnabled(TRUE);
+ mShowWalkablesCheckBox->setEnabled(TRUE);
+ mShowStaticObstaclesCheckBox->setEnabled(TRUE);
+ mShowMaterialVolumesCheckBox->setEnabled(TRUE);
+ mShowExclusionVolumesCheckBox->setEnabled(TRUE);
+ mShowWorldCheckBox->setEnabled(TRUE);
+ mViewCharactersButton->setEnabled(TRUE);
+ mEditTestTabContainer->setEnabled(TRUE);
+ mCharacterWidthSlider->setEnabled(TRUE);
+ mCharacterTypeRadioGroup->setEnabled(TRUE);
+ mClearPathButton->setEnabled(TRUE);
+ if (mIsRegionFrozen)
+ {
+ mUnfreezeLabel->setEnabled(TRUE);
+ mUnfreezeButton->setEnabled(TRUE);
+ mLinksetsLabel->setEnabled(FALSE);
+ mLinksetsButton->setEnabled(FALSE);
+ mFreezeLabel->setEnabled(FALSE);
+ mFreezeButton->setEnabled(FALSE);
+ }
+ else
+ {
+ mUnfreezeLabel->setEnabled(FALSE);
+ mUnfreezeButton->setEnabled(FALSE);
+ mLinksetsLabel->setEnabled(TRUE);
+ mLinksetsButton->setEnabled(TRUE);
+ mFreezeLabel->setEnabled(TRUE);
+ mFreezeButton->setEnabled(TRUE);
+ }
+ }
+}
+
void LLFloaterPathfindingConsole::generatePath()
{
if (mHasStartPoint && mHasEndPoint)
diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h
index 726bf36636..10fcf26795 100644
--- a/indra/newview/llfloaterpathfindingconsole.h
+++ b/indra/newview/llfloaterpathfindingconsole.h
@@ -41,6 +41,7 @@ class LLTextBase;
class LLCheckBoxCtrl;
class LLTabContainer;
class LLComboBox;
+class LLButton;
class LLFloaterPathfindingConsole
: public LLFloater
@@ -113,15 +114,20 @@ private:
virtual ~LLFloaterPathfindingConsole();
virtual void onOpen(const LLSD& pKey);
+ std::string getCurrentRegionCapabilityURL() const;
void onShowWalkabilitySet();
void onShowWorldToggle();
void onCharacterWidthSet();
void onCharacterTypeSwitch();
void onViewCharactersClicked();
+ void onUnfreezeClicked();
+ void onFreezeClicked();
void onViewEditLinksetClicked();
void onClearPathClicked();
+ void updateOnPathfindingServerStatus();
+
void generatePath();
void updatePathTestStatus();
@@ -134,10 +140,19 @@ private:
LLCheckBoxCtrl *mShowExclusionVolumesCheckBox;
LLCheckBoxCtrl *mShowWorldCheckBox;
LLTextBase *mPathfindingStatus;
+ LLButton *mViewCharactersButton;
LLTabContainer *mEditTestTabContainer;
+ LLTextBase *mUnfreezeLabel;
+ LLButton *mUnfreezeButton;
+ LLTextBase *mLinksetsLabel;
+ LLButton *mLinksetsButton;
+ LLTextBase *mFreezeLabel;
+ LLButton *mFreezeButton;
LLSliderCtrl *mCharacterWidthSlider;
LLRadioGroup *mCharacterTypeRadioGroup;
LLTextBase *mPathTestingStatus;
+ LLButton *mClearPathButton;
+ bool mIsRegionFrozen;
LLNavMeshDownloadObserver mNavMeshDownloadObserver[10];
int mCurrentMDO;
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 4a41736972..b608e513d5 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 @@
<floater
open_positioning="cascading"
can_tear_off="false"
- height="330"
+ height="352"
layout="topleft"
name="floater_pathfinding_console"
help_topic="floater_pathfinding_console"
@@ -10,12 +10,12 @@
save_rect="true"
single_instance="true"
title="Pathfinding edit / test"
- width="455">
+ width="456">
<floater.string name="navmesh_fetch_initial"></floater.string>
<floater.string name="navmesh_fetch_inprogress">Downloading the navmesh ...</floater.string>
<floater.string name="navmesh_fetch_complete_available">Navmesh received.</floater.string>
<floater.string name="navmesh_fetch_complete_none">No navmesh for region.</floater.string>
- <floater.string name="navmesh_region_not_enabled">Pathfinding is not enabled for this region.</floater.string>
+ <floater.string name="navmesh_region_not_enabled">This region is not enabled for pathfinding.</floater.string>
<floater.string name="navmesh_library_not_implemented">Cannot find pathing library implementation.</floater.string>
<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>
@@ -31,7 +31,7 @@
follows="left|top"
layout="topleft"
left="15"
- top="8"
+ top="9"
width="208">
Show:
</text>
@@ -41,7 +41,7 @@
layout="topleft"
left="14"
name="show_navmesh"
- top_pad="8"
+ top_pad="7"
width="90" />
<text
height="13"
@@ -54,14 +54,15 @@
layout="topleft"
left="35"
width="208">
- Show walkability heatmap:
+ Show walkability map:
</text>
<combo_box
- height="18"
+ height="19"
layout="topleft"
left="34"
name="show_heatmap_mode"
- width="125">
+ top_pad="8"
+ width="156">
<combo_box.item
label="None"
name="show_heatmap_mode_none"
@@ -133,7 +134,7 @@
left="14"
height="0"
width="200"
- top_pad="7"
+ top_pad="12"
visible="true" />
<panel
border="false"
@@ -206,18 +207,18 @@
layout="topleft"
left="230"
top="35"
- height="276"
- width="215"
+ height="305"
+ width="214"
visible="true" />
<tab_container
follows="left|top"
layout="topleft"
tab_position="top"
name="edit_test_tab_container"
- left="226"
+ left="227"
top="14"
- height="298"
- width="220">
+ height="327"
+ width="218">
<panel
border="false"
bevel_style="none"
@@ -231,14 +232,16 @@
use_ellipses="false"
type="string"
text_color="LabelTextColor"
+ text_readonly_color="LabelDisabledColor"
length="1"
follows="left|top"
layout="topleft"
+ name="unfreeze_label"
left="16"
- top_pad="17"
+ top_pad="16"
height="13"
width="190">
- Permit object / terrain changes:
+ Allow object / terrain changes:
</text>
<button
follows="left|top"
@@ -255,10 +258,12 @@
use_ellipses="false"
type="string"
text_color="LabelTextColor"
+ text_readonly_color="LabelDisabledColor"
length="1"
follows="left|top"
layout="topleft"
left="16"
+ name="edit_linksets_label"
top_pad="23"
height="13"
width="190">
@@ -278,11 +283,13 @@
use_ellipses="false"
type="string"
text_color="LabelTextColor"
+ text_readonly_color="LabelDisabledColor"
length="1"
follows="left|top"
layout="topleft"
left="16"
line_spacing.multiple="1.5"
+ name="freeze_label"
top_pad="23"
height="26"
width="190">