class ScannerHintInkGameController extends inkGameController
{
	private var m_messegeWidget : weak< inkText >;
	private var m_root : weak< inkWidget >;
	private editable var m_iconWidget : inkImageRef;
	private var m_OnShowMessegeCallback : CallbackHandle;
	private var m_OnMessegeUpdateCallback : CallbackHandle;
	private var m_OnVisionModeChangedCallback : CallbackHandle;

	protected event OnInitialize()
	{
		m_messegeWidget = ( ( inkText )( GetWidget( 'mainPanel/messege' ) ) );
		m_root = GetRootWidget();
		m_root.SetVisible( false );
		RegisterBlackboardCallbacks();
	}

	private function GetOwner() : GameObject
	{
		return ( ( GameObject )( GetOwnerEntity() ) );
	}

	private function RegisterBlackboardCallbacks()
	{
		var blackboard : IBlackboard;
		blackboard = GameInstance.GetBlackboardSystem( GetOwner().GetGame() ).Get( GetAllBlackboardDefs().HUD_Manager );
		if( blackboard )
		{
			m_OnShowMessegeCallback = blackboard.RegisterListenerBool( GetAllBlackboardDefs().HUD_Manager.ShowHudHintMessege, this, 'OnShowMessege' );
			m_OnMessegeUpdateCallback = blackboard.RegisterListenerString( GetAllBlackboardDefs().HUD_Manager.HudHintMessegeContent, this, 'OnMessegeUpdate' );
		}
		blackboard = GameInstance.GetBlackboardSystem( GetOwner().GetGame() ).GetLocalInstanced( GetPlayerControlledObject().GetEntityID(), GetAllBlackboardDefs().PlayerStateMachine );
		if( blackboard )
		{
			m_OnVisionModeChangedCallback = blackboard.RegisterListenerInt( GetAllBlackboardDefs().PlayerStateMachine.Vision, this, 'OnVisionModeChanged' );
		}
	}

	protected event OnShowMessege( value : Bool )
	{
		m_root.SetVisible( value );
	}

	protected event OnMessegeUpdate( value : String )
	{
		if( m_messegeWidget )
		{
			m_messegeWidget.SetLocalizedTextScript( value );
		}
	}

	protected event OnVisionModeChanged( value : Int32 )
	{
		var visionType : gameVisionModeType;
		visionType = ( ( gameVisionModeType )( value ) );
		if( visionType == gameVisionModeType.Default )
		{
			inkImageRef.SetTexturePart( m_iconWidget, 'left_shoulder' );
		}
		else if( visionType == gameVisionModeType.Focus )
		{
			inkImageRef.SetTexturePart( m_iconWidget, 'right_shoulder' );
		}
	}

}

