class SceneScreenUIAnimationsData extends IScriptable
{
	[ category = "Animations" ]
	instanceeditable inlined var m_customAnimations : WidgetAnimationManager;
	[ category = "Animations" ]
	const instanceeditable var m_onSpawnAnimations : array< CName >;
	[ category = "Library" ]
	instanceeditable var m_defaultLibraryItemName : CName;
	[ category = "Library" ]
	instanceeditable var m_defaultLibraryItemAnchor : inkEAnchor;
	default m_defaultLibraryItemAnchor = inkEAnchor.Fill;
}

class SceneScreen extends GameObject
{
	[ category = "Animations" ]
	instanceeditable inlined var m_uiAnimationsData : SceneScreenUIAnimationsData;
	protected var m_blackboard : IBlackboard;

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		super.OnRequestComponents( ri );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		CreateBlackboard();
		super.OnTakeControl( ri );
	}

	protected event OnChangeUIAnimEvent( evt : ChangeUIAnimEvent )
	{
		SendDataToUIBlackboard( evt.animName );
	}

	protected function SendDataToUIBlackboard( animName : CName )
	{
		GetBlackboard().SetName( GetAllBlackboardDefs().UI_SceneScreen.AnimName, animName );
		GetBlackboard().FireCallbacks();
	}

	public const virtual function GetBlackboard() : IBlackboard
	{
		return m_blackboard;
	}

	protected virtual function CreateBlackboard()
	{
		m_blackboard = IBlackboard.Create( GetAllBlackboardDefs().UI_SceneScreen );
	}

	public const function GetUIAnimationData() : SceneScreenUIAnimationsData
	{
		return m_uiAnimationsData;
	}

}

class ChangeUIAnimEvent extends Event
{
	editable var animName : CName;

	public constexpr function GetFriendlyDescription() : String
	{
		return "Change Anim On UI";
	}

}

