PATH-198: Hooking up the path status indicator to some existing state information.
parent
d62017ddaa
commit
69b732185e
|
|
@ -97,9 +97,13 @@ BOOL LLFloaterPathfindingConsole::postBuild()
|
|||
mCharacterWidthSlider->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterWidthSet, this));
|
||||
|
||||
mCharacterTypeRadioGroup = findChild<LLRadioGroup>("character_type");
|
||||
llassert(mCharacterTypeRadioGroup != NULL);
|
||||
llassert(mCharacterTypeRadioGroup != NULL);
|
||||
mCharacterTypeRadioGroup->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onCharacterTypeSwitch, this));
|
||||
|
||||
mPathTestingStatus = findChild<LLTextBase>("path_test_status");
|
||||
llassert(mPathTestingStatus != NULL);
|
||||
updatePathTestStatus();
|
||||
|
||||
return LLFloater::postBuild();
|
||||
}
|
||||
|
||||
|
|
@ -125,6 +129,7 @@ BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, E
|
|||
mHasEndPoint = true;
|
||||
}
|
||||
generatePath();
|
||||
updatePathTestStatus();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -316,6 +321,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
|
|||
mEditTestTabContainer(NULL),
|
||||
mCharacterWidthSlider(NULL),
|
||||
mCharacterTypeRadioGroup(NULL),
|
||||
mPathTestingStatus(NULL),
|
||||
mNavMeshCnt(0),
|
||||
mHasStartPoint(false),
|
||||
mHasEndPoint(false)
|
||||
|
|
@ -421,6 +427,7 @@ void LLFloaterPathfindingConsole::onShowWorldToggle()
|
|||
void LLFloaterPathfindingConsole::onCharacterWidthSet()
|
||||
{
|
||||
generatePath();
|
||||
updatePathTestStatus();
|
||||
}
|
||||
|
||||
void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
|
||||
|
|
@ -451,7 +458,7 @@ void LLFloaterPathfindingConsole::onCharacterTypeSwitch()
|
|||
llassert(0);
|
||||
break;
|
||||
}
|
||||
|
||||
updatePathTestStatus();
|
||||
}
|
||||
|
||||
void LLFloaterPathfindingConsole::onViewCharactersClicked()
|
||||
|
|
@ -468,6 +475,7 @@ void LLFloaterPathfindingConsole::onClearPathClicked()
|
|||
{
|
||||
mHasStartPoint = false;
|
||||
mHasEndPoint = false;
|
||||
updatePathTestStatus();
|
||||
}
|
||||
|
||||
void LLFloaterPathfindingConsole::generatePath()
|
||||
|
|
@ -478,3 +486,33 @@ void LLFloaterPathfindingConsole::generatePath()
|
|||
LLPathingLib::getInstance()->generatePath(mPathData);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPathfindingConsole::updatePathTestStatus()
|
||||
{
|
||||
static const LLColor4 warningColor = LLUIColorTable::instance().getColor("DrYellow");
|
||||
|
||||
std::string statusText("");
|
||||
LLStyle::Params styleParams;
|
||||
|
||||
if (!mHasStartPoint && !mHasEndPoint)
|
||||
{
|
||||
statusText = getString("pathing_choose_start_and_end_points");
|
||||
styleParams.color = warningColor;
|
||||
}
|
||||
else if (!mHasStartPoint && mHasEndPoint)
|
||||
{
|
||||
statusText = getString("pathing_choose_start_point");
|
||||
styleParams.color = warningColor;
|
||||
}
|
||||
else if (mHasStartPoint && !mHasEndPoint)
|
||||
{
|
||||
statusText = getString("pathing_choose_end_point");
|
||||
styleParams.color = warningColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
statusText = getString("pathing_path_valid");
|
||||
}
|
||||
|
||||
mPathTestingStatus->setText((LLStringExplicit)statusText, styleParams);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ private:
|
|||
void onClearPathClicked();
|
||||
|
||||
void generatePath();
|
||||
void updatePathTestStatus();
|
||||
|
||||
LLRootHandle<LLFloaterPathfindingConsole> mSelfHandle;
|
||||
LLCheckBoxCtrl *mShowNavMeshCheckBox;
|
||||
|
|
@ -121,6 +122,7 @@ private:
|
|||
LLTabContainer *mEditTestTabContainer;
|
||||
LLSliderCtrl *mCharacterWidthSlider;
|
||||
LLRadioGroup *mCharacterTypeRadioGroup;
|
||||
LLTextBase *mPathTestingStatus;
|
||||
|
||||
LLNavMeshDownloadObserver mNavMeshDownloadObserver[10];
|
||||
int mCurrentMDO;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
<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_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>
|
||||
<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>
|
||||
<text
|
||||
height="13"
|
||||
word_wrap="true"
|
||||
|
|
@ -360,13 +364,13 @@
|
|||
word_wrap="true"
|
||||
use_ellipses="false"
|
||||
type="string"
|
||||
text_color="DrYellow"
|
||||
text_color="LabelTextColor"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
layout="topleft"
|
||||
name="path_test_status"
|
||||
top_pad="15"
|
||||
width="190">
|
||||
Result: No path found.
|
||||
</text>
|
||||
<button
|
||||
follows="left|top"
|
||||
|
|
|
|||
Loading…
Reference in New Issue