using ftt.Core.Managing;
using UnityEngine;
using UnityEngine.UI;

namespace UI
{
    public class StartMenu : MonoBehaviour
    {
        [SerializeField] Button playButton;
        [SerializeField] Button optionsButton;
        [SerializeField] Button creditsButton;
        [SerializeField] Button quitButton;

        // Start is called before the first frame update
        void Start()
        {
            EntrySetup();
        }

        void EntrySetup()
        {
            playButton.onClick.AddListener(Play);
            optionsButton.onClick.AddListener(Options);
            creditsButton.onClick.AddListener(Credits);
            quitButton.onClick.AddListener(Quit);
        }

        void Play()
        {
            UIManager.S.DisablePanels();
            GameManager.GetManager.SwitchGameState(GameStates.PLAYING);
        }

        void Options()
        {
            UIManager.S.EnablePanel("OptionsPauseMenu");
        }

        void Credits()
        {
            UIManager.S.EnablePanel("Credits");
        }

        void Quit()
        {
            Application.Quit();
        }
    }
}
