using Intrepid.Gameplay.Codex.Visual;
using Intrepid.Utilities;
using Sirenix.OdinInspector;
using UnityEngine;

namespace Intrepid.Gameplay.Codex.UI.Components
{
    public abstract class CodexComponentUI : MonoBehaviour, IWindowLifecycle
    {
        public abstract void ApplyCodexVisuals(CodexVisualContext ctx);

        public virtual void BeforeOpen()
        {
        }
        
        public virtual void AfterOpen()
        {
        }
        
        public virtual void BeforeClose()
        {
        }

        public virtual void AfterClose()
        {
        }
        
        public virtual void EnableInput()
        {
        }
        
        public virtual void DisableInput()
        {
        }

        [GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
        private void SetVisualsBasedOn(PictorialProtocolTag protocol)
        {
            ApplyCodexVisuals(new CodexVisualContext(protocol, 0));
        }
    }
}