class vehicleVcarRootLogicController extends inkLogicController
{

	protected event OnInitialize() {}

	protected event OnMounted() {}
}

class vehicleVcarGameController extends inkGameController
{
	private var activeVehicleBlackboard : weak< IBlackboard >;
	private var m_vehicleBlackboard : weak< IBlackboard >;
	private var m_mountBBConnectionId : CallbackHandle;
	private var m_speedBBConnectionId : CallbackHandle;
	private var m_rpmValueBBConnectionId : CallbackHandle;
	private var m_rpmMaxBBConnectionId : CallbackHandle;
	private var m_autopilotOnId : CallbackHandle;
	private var m_playerVehStateId : CallbackHandle;
	private var m_isInAutoPilot : Bool;
	private var m_isInCombat : Bool;
	private var m_wasCombat : Bool;
	private var m_rootWidget : weak< inkCanvas >;
	private var m_windowWidget : weak< inkCanvas >;
	private var m_speedTextWidget : weak< inkText >;
	private var m_rpmGaugeFullWidget : weak< inkImage >;
	private var m_rpmGaugeMaxSize : Vector2;
	private var m_interiorRootWidget : weak< inkCanvas >;
	private var m_interiorRPMWidget : weak< inkCanvas >;
	private var m_interiorFluff1Widget : weak< inkCanvas >;
	private var m_interiorFluff2Widget : weak< inkCanvas >;
	private var m_interiorFluff3Widget : weak< inkCanvas >;
	private var m_interiorFluff4Widget : weak< inkCanvas >;
	private var m_interiorFluff5Widget : weak< inkCanvas >;
	private var m_interiorFluff1Anim1Widget : weak< inkCanvas >;
	private var m_interiorFluff1Anim2Widget : weak< inkCanvas >;
	private var m_interiorFluff2Anim1Widget : weak< inkCanvas >;
	private var m_interiorFluff2Anim2Widget : weak< inkCanvas >;
	private var m_activeChunks : Int32;
	private var m_animFadeOutProxy : inkAnimProxy;
	private var m_anim_exterior_fadein : inkAnimDef;
	private var m_anim_exterior_fadeout : inkAnimDef;
	private var m_anim_interior_fadeout : inkAnimDef;
	private var m_anim_interior_rpm_fadein : inkAnimDef;
	private var m_anim_interior_fluff1_fadein : inkAnimDef;
	private var m_anim_interior_fluff2_fadein : inkAnimDef;
	private var m_anim_interior_fluff3_fadein : inkAnimDef;
	private var m_anim_interior_fluff4_fadein : inkAnimDef;
	private var m_anim_interior_fluff5_fadein : inkAnimDef;
	private var m_animFluffFadeInProxy : inkAnimProxy;
	private var m_anim_interior_fluff1_anim1 : inkAnimDef;
	private var m_anim_interior_fluff1_anim2 : inkAnimDef;
	private var m_anim_interior_fluff2_anim1 : inkAnimDef;
	private var m_anim_interior_fluff2_anim2 : inkAnimDef;
	private var m_fluff1animOptions1 : inkAnimOptions;
	private var m_fluff1animOptions2 : inkAnimOptions;
	private var m_fluff2animOptions1 : inkAnimOptions;
	private var m_fluff2animOptions2 : inkAnimOptions;
	private editable var m_isWindow : Bool;
	private editable var m_isInterior : Bool;
	private editable var m_hasSpeed : Bool;
	private editable var m_hasRPM : Bool;
	private editable var m_chunksNumber : Int32;
	private editable var m_dynamicRpmPath : CName;
	private editable var m_rpmPerChunk : Int32;
	private editable var m_hasRevMax : Bool;
	private editable var m_revMaxPath : CName;
	private editable var m_revMaxChunk : Int32;
	private editable var m_windowWidgetPath : CName;
	private editable var m_interiorWidgetPath : CName;
	private editable var m_interiorRPMWidgetPath : CName;
	private editable var m_interiorFluff1WidgetPath : CName;
	private editable var m_interiorFluff2WidgetPath : CName;
	private editable var m_interiorFluff3WidgetPath : CName;
	private editable var m_interiorFluff4WidgetPath : CName;
	private editable var m_interiorFluff5WidgetPath : CName;
	private editable var m_interiorFluff1Anim1WidgetPath : CName;
	private editable var m_interiorFluff1Anim2WidgetPath : CName;
	private editable var m_interiorFluff2Anim1WidgetPath : CName;
	private editable var m_interiorFluff2Anim2WidgetPath : CName;

	protected event OnInitialize()
	{
		var ownerObject : GameObject;
		var vehicle : VehicleObject;
		ownerObject = ( ( GameObject )( GetOwnerEntity() ) );
		vehicle = GetMountedVehicle( ownerObject );
		m_vehicleBlackboard = vehicle.GetBlackboard();
		m_rootWidget = ( ( inkCanvas )( GetRootWidget() ) );
		if( IsNameValid( m_interiorWidgetPath ) )
		{
			m_interiorRootWidget = ( ( inkCanvas )( GetWidget( m_interiorWidgetPath ) ) );
		}
		if( m_isWindow && IsNameValid( m_windowWidgetPath ) )
		{
			m_windowWidget = ( ( inkCanvas )( GetWidget( m_windowWidgetPath ) ) );
		}
		if( m_hasSpeed )
		{
			m_speedTextWidget = ( ( inkText )( GetWidget( 'maindashcontainer/dynamic/speed_text' ) ) );
		}
		if( m_isInterior )
		{
			if( m_hasRPM && IsNameValid( m_interiorRPMWidgetPath ) )
			{
				m_interiorRPMWidget = ( ( inkCanvas )( GetWidget( m_interiorRPMWidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff1WidgetPath ) )
			{
				m_interiorFluff1Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff1WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff2WidgetPath ) )
			{
				m_interiorFluff2Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff2WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff3WidgetPath ) )
			{
				m_interiorFluff3Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff3WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff4WidgetPath ) )
			{
				m_interiorFluff4Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff4WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff5WidgetPath ) )
			{
				m_interiorFluff5Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff5WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff1Anim1WidgetPath ) )
			{
				m_interiorFluff1Anim1Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff1Anim1WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff1Anim2WidgetPath ) )
			{
				m_interiorFluff1Anim2Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff1Anim2WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff2Anim1WidgetPath ) )
			{
				m_interiorFluff2Anim1Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff2Anim1WidgetPath ) ) );
			}
			if( IsNameValid( m_interiorFluff2Anim2WidgetPath ) )
			{
				m_interiorFluff2Anim2Widget = ( ( inkCanvas )( GetWidget( m_interiorFluff2Anim2WidgetPath ) ) );
			}
		}
		activeVehicleBlackboard = GetBlackboardSystem().Get( GetAllBlackboardDefs().UI_ActiveVehicleData );
		if( activeVehicleBlackboard )
		{
			m_playerVehStateId = activeVehicleBlackboard.RegisterListenerVariant( GetAllBlackboardDefs().UI_ActiveVehicleData.VehPlayerStateData, this, 'OnPlayerStateChanged' );
			m_mountBBConnectionId = activeVehicleBlackboard.RegisterListenerBool( GetAllBlackboardDefs().UI_ActiveVehicleData.IsPlayerMounted, this, 'OnActiveVehicleChanged' );
			if( m_vehicleBlackboard )
			{
				if( m_hasSpeed )
				{
					m_speedBBConnectionId = m_vehicleBlackboard.RegisterListenerFloat( GetAllBlackboardDefs().Vehicle.SpeedValue, this, 'OnSpeedValueChanegd' );
				}
				if( m_hasRPM )
				{
					m_rpmValueBBConnectionId = m_vehicleBlackboard.RegisterListenerFloat( GetAllBlackboardDefs().Vehicle.RPMValue, this, 'OnRpmValueChanged' );
					m_rpmMaxBBConnectionId = m_vehicleBlackboard.RegisterListenerFloat( GetAllBlackboardDefs().Vehicle.RPMMax, this, 'OnRpmMaxChanged' );
				}
				m_autopilotOnId = m_vehicleBlackboard.RegisterListenerBool( GetAllBlackboardDefs().Vehicle.IsAutopilotOn, this, 'OnAutopilotChanged' );
			}
		}
		PrepAnim();
		m_windowWidget.SetOpacity( 0.0 );
		m_windowWidget.SetVisible( false );
		m_interiorRPMWidget.SetOpacity( 0.0 );
		m_interiorRPMWidget.SetVisible( false );
		m_interiorFluff1Widget.SetOpacity( 0.0 );
		m_interiorFluff1Widget.SetVisible( false );
		m_interiorFluff2Widget.SetOpacity( 0.0 );
		m_interiorFluff2Widget.SetVisible( false );
		m_interiorFluff3Widget.SetOpacity( 0.0 );
		m_interiorFluff3Widget.SetVisible( false );
		m_interiorFluff4Widget.SetOpacity( 0.0 );
		m_interiorFluff4Widget.SetVisible( false );
		m_interiorFluff5Widget.SetOpacity( 0.0 );
		m_interiorFluff5Widget.SetVisible( false );
		m_interiorFluff1Anim1Widget.SetOpacity( 0.0 );
		m_interiorFluff1Anim1Widget.SetVisible( false );
		m_interiorFluff1Anim2Widget.SetOpacity( 0.0 );
		m_interiorFluff1Anim2Widget.SetVisible( false );
		m_interiorFluff2Anim1Widget.SetOpacity( 0.0 );
		m_interiorFluff2Anim1Widget.SetVisible( false );
		m_interiorFluff2Anim2Widget.SetOpacity( 0.0 );
		m_interiorFluff2Anim2Widget.SetVisible( false );
		RegisterDebugCommand( 'OnActivateTest' );
	}

	protected event OnActivateTest( value : Bool )
	{
		if( activeVehicleBlackboard )
		{
			activeVehicleBlackboard.SetBool( GetAllBlackboardDefs().UI_ActiveVehicleData.IsPlayerMounted, value );
		}
	}

	protected event OnUninitialize()
	{
		if( activeVehicleBlackboard )
		{
			activeVehicleBlackboard.UnregisterListenerVariant( GetAllBlackboardDefs().UI_ActiveVehicleData.VehPlayerStateData, m_playerVehStateId );
			activeVehicleBlackboard.UnregisterListenerBool( GetAllBlackboardDefs().UI_ActiveVehicleData.IsPlayerMounted, m_mountBBConnectionId );
			if( m_vehicleBlackboard )
			{
				m_vehicleBlackboard.UnregisterListenerFloat( GetAllBlackboardDefs().Vehicle.SpeedValue, m_speedBBConnectionId );
				m_vehicleBlackboard.UnregisterListenerFloat( GetAllBlackboardDefs().Vehicle.RPMValue, m_rpmValueBBConnectionId );
				m_vehicleBlackboard.UnregisterListenerFloat( GetAllBlackboardDefs().Vehicle.RPMMax, m_rpmMaxBBConnectionId );
				m_vehicleBlackboard.UnregisterListenerBool( GetAllBlackboardDefs().Vehicle.IsAutopilotOn, m_autopilotOnId );
			}
		}
	}

	protected event OnActiveVehicleChanged( isPlayerMounted : Bool ) {}

	protected event OnSpeedValueChanegd( speedValue : Float )
	{
		if( m_hasSpeed )
		{
			if( speedValue < 0.0 )
			{
				m_speedTextWidget.SetText( IntToString( RoundMath( ( speedValue * 3.5999999 ) / 1.60930002 ) * -1 ) );
			}
			else
			{
				m_speedTextWidget.SetText( IntToString( RoundMath( ( speedValue * 3.5999999 ) / 1.40929997 ) ) );
			}
		}
	}

	protected event OnRpmValueChanged( rpmValue : Float )
	{
		drawRPMGaugeFull( rpmValue );
	}

	public function drawRPMGaugeFull( rpmValue : Float )
	{
		var rpm : Int32;
		var level : Float;
		var levelInt : Int32;
		if( m_hasRPM )
		{
			if( m_rpmPerChunk == 0 )
			{
				m_rpmPerChunk = 1;
			}
			rpm = ( ( Int32 )( rpmValue ) );
			levelInt = rpm / m_rpmPerChunk;
			level = ( ( Float )( rpm / m_rpmPerChunk ) );
			levelInt = ( ( Int32 )( level ) );
			EvaluateRPMMeterWidget( levelInt );
		}
	}

	protected event OnRpmMaxChanged( rpmMax : Float )
	{
		var rpm : Int32;
		var level : Float;
		var levelInt : Int32;
		if( m_hasRPM )
		{
			rpm = ( ( Int32 )( rpmMax ) );
			levelInt = rpm / m_rpmPerChunk;
			level = ( ( Float )( rpm / m_rpmPerChunk ) );
			levelInt = ( ( Int32 )( level ) );
			EvaluateRPMMeterWidget( levelInt );
		}
	}

	private function EvaluateRPMMeterWidget( currentAmountOfChunks : Int32 )
	{
		if( currentAmountOfChunks == m_activeChunks )
		{
			return;
		}
		if( currentAmountOfChunks > m_activeChunks )
		{
			AddChunk();
		}
		else if( currentAmountOfChunks < m_activeChunks )
		{
			RemoveChunk();
		}
		m_activeChunks = currentAmountOfChunks;
	}

	private function AddChunk()
	{
		var chunkToActivate : String;
		var widgetToShow : weak< inkImage >;
		var i : Int32;
		if( IsNameValid( m_dynamicRpmPath ) )
		{
			for( i = 1; i <= m_activeChunks; i += 1 )
			{
				chunkToActivate = NameToString( m_dynamicRpmPath ) + IntToString( i );
				widgetToShow = ( ( inkImage )( GetWidget( StringToName( chunkToActivate ) ) ) );
				widgetToShow.SetVisible( true );
				if( m_hasRevMax && ( i >= m_revMaxChunk ) )
				{
					widgetToShow = ( ( inkImage )( GetWidget( m_revMaxPath ) ) );
					widgetToShow.SetOpacity( 1.0 );
				}
				else
				{
					widgetToShow = ( ( inkImage )( GetWidget( m_revMaxPath ) ) );
					widgetToShow.SetOpacity( 0.0 );
				}
			}
		}
	}

	private function RemoveChunk()
	{
		var chunkToRemove : String;
		var widgetToHide : weak< inkImage >;
		var i : Int32;
		if( IsNameValid( m_dynamicRpmPath ) )
		{
			for( i = m_chunksNumber; i > m_activeChunks; i -= 1 )
			{
				chunkToRemove = NameToString( m_dynamicRpmPath ) + IntToString( i );
				widgetToHide = ( ( inkImage )( GetWidget( StringToName( chunkToRemove ) ) ) );
				widgetToHide.SetVisible( false );
			}
		}
	}

	private function PrepAnim()
	{
		var fadeInterp : inkAnimTransparency;
		m_anim_exterior_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 0.69999999 );
		fadeInterp.SetDuration( 1.0 );
		m_anim_exterior_fadein.AddInterpolator( fadeInterp );
		m_anim_exterior_fadeout = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.69999999 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 0.5 );
		m_anim_exterior_fadeout.AddInterpolator( fadeInterp );
		m_anim_interior_fadeout = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 0.5 );
		m_anim_interior_fadeout.AddInterpolator( fadeInterp );
		m_anim_interior_rpm_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 0.80000001 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_rpm_fadein.AddInterpolator( fadeInterp );
		m_anim_interior_fluff1_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 1.0 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_fluff1_fadein.AddInterpolator( fadeInterp );
		m_anim_interior_fluff2_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 1.10000002 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_fluff2_fadein.AddInterpolator( fadeInterp );
		m_anim_interior_fluff3_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 1.5 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_fluff3_fadein.AddInterpolator( fadeInterp );
		m_anim_interior_fluff4_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 1.29999995 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_fluff4_fadein.AddInterpolator( fadeInterp );
		m_anim_interior_fluff5_fadein = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartDelay( 1.79999995 );
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 0.1 );
		m_anim_interior_fluff5_fadein.AddInterpolator( fadeInterp );
	}

	private function PrepFluffLoopAnim()
	{
		var fadeInterp : inkAnimTransparency;
		m_anim_interior_fluff1_anim1 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 3.0 );
		m_anim_interior_fluff1_anim1.AddInterpolator( fadeInterp );
		fadeInterp.SetStartDelay( 5.5 );
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 2.0 );
		m_anim_interior_fluff1_anim1.AddInterpolator( fadeInterp );
		m_anim_interior_fluff1_anim2 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 2.5 );
		m_anim_interior_fluff1_anim2.AddInterpolator( fadeInterp );
		fadeInterp.SetStartDelay( 3.5 );
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 3.0 );
		m_anim_interior_fluff1_anim2.AddInterpolator( fadeInterp );
		m_anim_interior_fluff2_anim1 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 4.0 );
		m_anim_interior_fluff2_anim1.AddInterpolator( fadeInterp );
		fadeInterp.SetStartDelay( 7.5 );
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 3.0 );
		m_anim_interior_fluff2_anim1.AddInterpolator( fadeInterp );
		m_anim_interior_fluff2_anim2 = new inkAnimDef;
		fadeInterp = new inkAnimTransparency;
		fadeInterp.SetStartTransparency( 0.0 );
		fadeInterp.SetEndTransparency( 1.0 );
		fadeInterp.SetDuration( 2.0 );
		m_anim_interior_fluff2_anim2.AddInterpolator( fadeInterp );
		fadeInterp.SetStartDelay( 6.5 );
		fadeInterp.SetStartTransparency( 1.0 );
		fadeInterp.SetEndTransparency( 0.0 );
		fadeInterp.SetDuration( 3.0 );
		m_anim_interior_fluff2_anim2.AddInterpolator( fadeInterp );
		m_fluff1animOptions1.loopType = inkanimLoopType.Cycle;
		m_fluff1animOptions1.loopCounter = 10000;
		m_fluff1animOptions2.loopType = inkanimLoopType.Cycle;
		m_fluff1animOptions2.loopCounter = 10000;
		m_fluff2animOptions1.loopType = inkanimLoopType.Cycle;
		m_fluff2animOptions1.loopCounter = 10000;
		m_fluff2animOptions2.loopType = inkanimLoopType.Cycle;
		m_fluff2animOptions2.loopCounter = 10000;
	}

	protected event OnAutopilotChanged( autopilotOn : Bool )
	{
		m_isInAutoPilot = autopilotOn;
	}

	protected event OnPlayerStateChanged( data : Variant )
	{
		var newData : VehEntityPlayerStateData;
		var entID : EntityID;
		var vehEntityID : EntityID;
		var playerState : Int32;
		newData = ( ( VehEntityPlayerStateData )data );
		vehEntityID = newData.entID;
		entID = GetOwnerEntity().GetEntityID();
		playerState = newData.state;
		if( entID == vehEntityID )
		{
			if( ( playerState == ( ( Int32 )( gamePSMVehicle.Driving ) ) ) || ( playerState == ( ( Int32 )( gamePSMVehicle.Passenger ) ) ) )
			{
				m_windowWidget.PlayAnimation( m_anim_exterior_fadein );
				m_windowWidget.SetVisible( true );
				if( !( m_wasCombat ) )
				{
					m_interiorRPMWidget.PlayAnimation( m_anim_interior_rpm_fadein );
					m_interiorRPMWidget.SetVisible( true );
					m_interiorFluff1Widget.PlayAnimation( m_anim_interior_fluff1_fadein );
					m_interiorFluff1Widget.SetVisible( true );
					m_interiorFluff1Anim1Widget.SetVisible( true );
					m_interiorFluff1Anim2Widget.SetVisible( true );
					m_animFluffFadeInProxy = m_interiorFluff2Widget.PlayAnimation( m_anim_interior_fluff2_fadein );
					m_interiorFluff2Widget.SetVisible( true );
					m_interiorFluff2Anim1Widget.SetVisible( true );
					m_interiorFluff2Anim2Widget.SetVisible( true );
					m_interiorFluff3Widget.PlayAnimation( m_anim_interior_fluff3_fadein );
					m_interiorFluff3Widget.SetVisible( true );
					m_interiorFluff4Widget.PlayAnimation( m_anim_interior_fluff4_fadein );
					m_interiorFluff4Widget.SetVisible( true );
					m_interiorFluff5Widget.PlayAnimation( m_anim_interior_fluff5_fadein );
					m_interiorFluff5Widget.SetVisible( true );
					m_animFluffFadeInProxy.RegisterToCallback( inkanimEventType.OnFinish, this, 'OnAnimFluffFadeInFinshed' );
				}
			}
			if( playerState == ( ( Int32 )( gamePSMVehicle.Combat ) ) )
			{
				m_windowWidget.PlayAnimation( m_anim_exterior_fadeout );
				m_wasCombat = true;
			}
			else if( playerState == ( ( Int32 )( gamePSMVehicle.Transition ) ) )
			{
				m_animFadeOutProxy = m_windowWidget.PlayAnimation( m_anim_exterior_fadeout );
				m_interiorRPMWidget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff1Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff2Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff3Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff4Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff5Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff1Anim1Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff1Anim2Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff2Anim1Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff2Anim2Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff1Anim1Widget.StopAllAnimations();
				m_interiorFluff1Anim1Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff1Anim2Widget.StopAllAnimations();
				m_interiorFluff1Anim2Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff2Anim1Widget.StopAllAnimations();
				m_interiorFluff2Anim1Widget.PlayAnimation( m_anim_interior_fadeout );
				m_interiorFluff2Anim2Widget.StopAllAnimations();
				m_interiorFluff2Anim2Widget.PlayAnimation( m_anim_interior_fadeout );
				m_animFadeOutProxy.RegisterToCallback( inkanimEventType.OnFinish, this, 'OnAnimFadeOutFinshed' );
				m_wasCombat = false;
			}
		}
	}

	protected event OnAnimFadeOutFinshed( anim : inkAnimProxy )
	{
		m_windowWidget.SetVisible( false );
		m_interiorRPMWidget.SetVisible( false );
		m_interiorFluff1Widget.SetVisible( false );
		m_interiorFluff2Widget.SetVisible( false );
		m_interiorFluff3Widget.SetVisible( false );
		m_interiorFluff4Widget.SetVisible( false );
		m_interiorFluff5Widget.SetVisible( false );
		m_interiorFluff1Anim1Widget.SetVisible( false );
		m_interiorFluff1Anim2Widget.SetVisible( false );
		m_interiorFluff2Anim1Widget.SetVisible( false );
		m_interiorFluff2Anim2Widget.SetVisible( false );
	}

	protected event OnAnimFluffFadeInFinshed( anim : inkAnimProxy )
	{
		PrepFluffLoopAnim();
		m_interiorFluff1Anim1Widget.PlayAnimationWithOptions( m_anim_interior_fluff1_anim1, m_fluff1animOptions1 );
		m_interiorFluff1Anim2Widget.PlayAnimationWithOptions( m_anim_interior_fluff1_anim2, m_fluff1animOptions2 );
		m_interiorFluff2Anim1Widget.PlayAnimationWithOptions( m_anim_interior_fluff2_anim1, m_fluff2animOptions1 );
		m_interiorFluff2Anim2Widget.PlayAnimationWithOptions( m_anim_interior_fluff2_anim2, m_fluff2animOptions2 );
	}

}

