path-264: Locking avatar in place when pathing floater is up.

meow-7.2.2
prep 2012-03-01 17:33:45 -05:00
parent 91fdd33f76
commit c4ddaf67cb
3 changed files with 35 additions and 5 deletions

View File

@ -88,6 +88,7 @@
#include "llworld.h"
#include "llworldmap.h"
#include "stringize.h"
#include "llfloaterpathfindingconsole.h"
using namespace LLVOAvatarDefines;
@ -399,6 +400,12 @@ void LLAgent::ageChat()
//-----------------------------------------------------------------------------
void LLAgent::moveAt(S32 direction, bool reset)
{
LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get();
if ( pWindow && pWindow->getHeartBeat() )
{
return;
}
mMoveTimer.reset();
LLFirstUse::notMoving(false);
@ -427,6 +434,11 @@ void LLAgent::moveAt(S32 direction, bool reset)
//-----------------------------------------------------------------------------
void LLAgent::moveAtNudge(S32 direction)
{
LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get();
if ( pWindow && pWindow->getHeartBeat() )
{
return;
}
mMoveTimer.reset();
LLFirstUse::notMoving(false);
@ -648,6 +660,12 @@ void LLAgent::setFlying(BOOL fly)
// static
void LLAgent::toggleFlying()
{
LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get();
if ( pWindow && pWindow->getHeartBeat() )
{
return;
}
if ( gAgent.mAutoPilot )
{
LLToolPie::instance().stopClickToWalk();
@ -2706,6 +2724,12 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
void LLAgent::sendWalkRun(bool running)
{
LLFloaterPathfindingConsole* pWindow = LLFloaterPathfindingConsole::getInstanceHandle().get();
if ( pWindow->getHeartBeat() )
{
return;
}
LLMessageSystem* msgsys = gMessageSystem;
if (msgsys)
{

View File

@ -149,7 +149,7 @@ BOOL LLFloaterPathfindingConsole::postBuild()
void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey)
{
LLFloater::onOpen(pKey);
setHeartBeat( true );
//make sure we have a pathing system
if ( !LLPathingLib::getInstance() )
{
@ -250,6 +250,7 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting)
}
LLPathingLib::getInstance()->cleanupResidual();
LLFloater::onClose(pIsAppQuitting);
setHeartBeat( false );
}
BOOL LLFloaterPathfindingConsole::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down)
@ -540,7 +541,8 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed)
mNavMeshCnt(0),
mHasStartPoint(false),
mHasEndPoint(false),
mNeighboringRegion( CURRENT_REGION )
mNeighboringRegion( CURRENT_REGION ),
mHeartBeat( false )
{
mSelfHandle.bind(this);

View File

@ -111,6 +111,9 @@ public:
void setHasNavMeshReceived();
void setHasNoNavMesh();
bool getHeartBeat() const { return mHeartBeat;}
void setHeartBeat( bool state ) { mHeartBeat=state; }
protected:
private:
@ -168,9 +171,10 @@ private:
U32 mNeighboringRegion;
//Container that is populated and subsequently submitted to the LLPathingSystem for processing
LLPathingLib::PathingPacket mPathData;
bool mHasStartPoint;
bool mHasEndPoint;
U32 mShapeRenderFlags;
bool mHasStartPoint;
bool mHasEndPoint;
U32 mShapeRenderFlags;
bool mHeartBeat;
static LLHandle<LLFloaterPathfindingConsole> sInstanceHandle;
};