void LLFloaterMove::setMovementMode(const EMovementMode mode)
{
	mCurrentMode = mode;
	gAgent.setFlying(MM_FLY == mode);

	// attempts to set avatar flying can not set it real flying in some cases.
	// For ex. when avatar fell down & is standing up.
	// So, no need to continue processing FLY mode. See EXT-1079
	if (MM_FLY == mode && !gAgent.getFlying())
	{
		return;
	}

	switch (mode)
	{
	case MM_RUN:
		gAgent.setAlwaysRun();
		gAgent.setRunning();
//MK
		if (gRRenabled)
		{
			if (gAgent.mRRInterface.mContainsRun || gAgent.mRRInterface.mContainsAlwaysRun) 
			{
				gAgent.clearRunning();
				gAgent.clearAlwaysRun();
			}
		}
//mk
		break;
	case MM_WALK:
		gAgent.clearAlwaysRun();
		gAgent.clearRunning();
		break;
	default:
		//do nothing for other modes (MM_FLY)
		break;
	}
	// tell the simulator.
	gAgent.sendWalkRun(gAgent.getAlwaysRun());
	
	updateButtonsWithMovementMode(mode);
//MK
		if (gRRenabled && mode == MM_RUN)
		{
			if (gAgent.mRRInterface.mContainsRun || gAgent.mRRInterface.mContainsAlwaysRun) 
			{
				updateButtonsWithMovementMode(MM_WALK);
			}
		}
//mk

	bool bHideModeButtons = MM_FLY == mode
		|| (isAgentAvatarValid() && gAgentAvatarp->isSitting());

	showModeButtons(!bHideModeButtons);

}
void LLFloaterMove::setAlwaysRunModeImpl(bool run)
{
	if (!gAgent.getFlying())
	{
		updateButtonsWithMovementMode(run ? MM_RUN : MM_WALK);
	}
}
Exemple #3
0
void LLFloaterMove::setMovementMode(const EMovementMode mode)
{
	mCurrentMode = mode;
	gAgent.setFlying(MM_FLY == mode);

	// attempts to set avatar flying can not set it real flying in some cases.
	// For ex. when avatar fell down & is standing up.
	// So, no need to continue processing FLY mode. See EXT-1079
	if (MM_FLY == mode && !gAgent.getFlying())
	{
		return;
	}

	switch (mode)
	{
	case MM_RUN:
		gAgent.setAlwaysRun();
//		gAgent.setRunning();
		break;
	case MM_WALK:
		gAgent.clearAlwaysRun();
//		gAgent.clearRunning();
		break;
	default:
		//do nothing for other modes (MM_FLY)
		break;
	}
	// tell the simulator.
//	gAgent.sendWalkRun(gAgent.getAlwaysRun());
//	
//	updateButtonsWithMovementMode(mode);
//
//	bool bHideModeButtons = MM_FLY == mode
//		|| (isAgentAvatarValid() && gAgentAvatarp->isSitting());
// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i
	// Running may have been restricted so update walk-vs-run from the agent's actual running state
	if ( (MM_WALK == mode) || (MM_RUN == mode) )
		mCurrentMode = (gAgent.getRunning()) ? MM_RUN : MM_WALK;

	updateButtonsWithMovementMode(mCurrentMode);

	bool bHideModeButtons = (MM_FLY == mCurrentMode) || (isAgentAvatarValid() && gAgentAvatarp->isSitting());
// [/RLVa:KB]

	showModeButtons(!bHideModeButtons);

}
void LLFloaterMove::setFlyingModeImpl(BOOL fly)
{
	updateButtonsWithMovementMode(fly ? MM_FLY : (gAgent.getAlwaysRun() ? MM_RUN : MM_WALK));
}