using NaughtyAttributes;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class MainMenuManager : MonoBehaviour {
	public enum MenuMode {
		MainMenu,
		PauseMenu,
	}
	
	[SerializeField] [Required]
	Text titleLable;
	[SerializeField] string[] titleOptions;
	[SerializeField] [Required]
	Button startButton;
	MenuMode mode;

	void Awake() => mode = MenuMode.MainMenu;

	void Start() {
		if (titleOptions.Length > 0)
			titleLable.text = titleOptions[Random.Range(0, titleOptions.Length)];
	}

	public void SetMenuMode(MenuMode mode) {
		this.mode = mode;

		startButton.gameObject.SetActive(mode == MenuMode.MainMenu);
	}

	public void ResetMenuState() {
		//TODO Reset selected button
	}
	
	public void GoToScene(int sceneNb) => SceneManager.LoadScene(sceneNb);

	public void QuitGame() => Application.Quit(0);
}
