class ApartmentScreenInkGameController extends LcdScreenInkGameController
{
	protected var m_backgroundFrameWidget : weak< inkImage >;

	public override function Refresh( state : EDeviceStatus )
	{
		m_messegeRecord = GetOwner().GetMessageRecord();
		super.Refresh( state );
	}

	protected override function SetupWidgets()
	{
		if( !( m_isInitialized ) )
		{
			m_defaultUI = ( ( inkCanvas )( GetWidget( 'default_ui' ) ) );
			m_backgroundFrameWidget = ( ( inkImage )( GetWidget( 'default_ui/main_content_panel/background_canvas/background_frame' ) ) );
			m_messegeWidget = ( ( inkText )( GetWidget( 'default_ui/main_content_panel/messege_text' ) ) );
			m_mainDisplayWidget = ( ( inkVideo )( GetWidget( 'main_display' ) ) );
			m_backgroundWidget = ( ( inkLeafWidget )( GetWidget( 'default_ui/main_content_panel/background_canvas/messege_background' ) ) );
			m_rootWidget.SetAnchor( inkEAnchor.Fill );
		}
	}

	protected override function RegisterBlackboardCallbacks( blackboard : IBlackboard )
	{
		super.RegisterBlackboardCallbacks( blackboard );
	}

	protected override function GetOwner() : ApartmentScreen
	{
		return ( ( ApartmentScreen )( GetOwnerEntity() ) );
	}

	protected override function ResolveMessegeRecord( record : weak< ScreenMessageData_Record > )
	{
		var textParams : inkTextParams;
		super.ResolveMessegeRecord( record );
		if( m_backgroundFrameWidget != NULL )
		{
			m_backgroundFrameWidget.SetTintColor( GetColorFromArray( record.BackgroundColor() ) );
			m_backgroundFrameWidget.SetOpacity( record.BackgroundOpacity() );
		}
		if( GetOwner().GetCurrentRentStatus() == ERentStatus.OVERDUE && GetOwner().ShouldShowOverdueValue() )
		{
			textParams = new inkTextParams;
			textParams.AddNumber( "DAYS_COUNT", GetOwner().GetCurrentOverdueValue() );
			textParams.AddLocalizedString( "DAYS", "LocKey#6344" );
			m_messegeWidget.SetTextParameters( textParams );
		}
	}

}

