2023-03-28 13:16:30 -04:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
using System.IO;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
using TMPro;
|
|
|
|
using RPGCreationKit;
|
|
|
|
using RPGCreationKit.SaveSystem;
|
|
|
|
using UnityEngine.InputSystem;
|
|
|
|
using UnityEngine.EventSystems;
|
|
|
|
|
|
|
|
namespace RPGCreationKit
|
|
|
|
{
|
|
|
|
public class MainMenuUI : MonoBehaviour
|
|
|
|
{
|
|
|
|
public PlayerInput input;
|
|
|
|
public LoadPanel loadPanel;
|
|
|
|
|
|
|
|
public GameObject mainMenuButtons;
|
|
|
|
public GameObject defaultSelected;
|
|
|
|
public GameObject previouslySelected;
|
2023-04-24 18:54:43 -04:00
|
|
|
public GameObject LoginControls;
|
|
|
|
public GameObject Loading;
|
2023-03-28 13:16:30 -04:00
|
|
|
|
|
|
|
private void Start()
|
|
|
|
{
|
|
|
|
Time.timeScale = 1.0f;
|
|
|
|
|
|
|
|
RckInput.LoadInputSave();
|
|
|
|
RckInput.SetPlayerInputInstance(input);
|
|
|
|
|
|
|
|
OnShowingUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void OnShowingUp()
|
|
|
|
{
|
|
|
|
mainMenuButtons.SetActive(true);
|
|
|
|
|
|
|
|
if (RckInput.isUsingGamepad)
|
|
|
|
{
|
|
|
|
if (previouslySelected != null)
|
|
|
|
EventSystem.current.SetSelectedGameObject(previouslySelected);
|
|
|
|
else
|
|
|
|
EventSystem.current.SetSelectedGameObject(defaultSelected);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void MainMenuButton_Load()
|
|
|
|
{
|
|
|
|
previouslySelected = EventSystem.current.currentSelectedGameObject;
|
|
|
|
|
|
|
|
mainMenuButtons.SetActive(false);
|
|
|
|
loadPanel.gameObject.SetActive(true);
|
|
|
|
|
|
|
|
if(RckInput.isUsingGamepad)
|
|
|
|
loadPanel.SelectFirstElementInList();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SelectedButton(GameObject btn)
|
|
|
|
{
|
|
|
|
previouslySelected = btn;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void MainMenuButton_NewGame()
|
|
|
|
{
|
2023-04-24 18:54:43 -04:00
|
|
|
mainMenuButtons.SetActive(false);
|
|
|
|
LoginControls.SetActive(false);
|
|
|
|
//Loading.SetActive(true);
|
|
|
|
|
|
|
|
LoadingScreenInfo.whatToLoad.Add("_CharacterCreation_");
|
|
|
|
|
|
|
|
SceneManager.LoadScene("_LoadingScreen_");
|
|
|
|
//SceneManager.LoadScene("_CharacterCreation_");
|
2023-03-28 13:16:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void MainMenuButton_Exit()
|
|
|
|
{
|
|
|
|
Application.Quit();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|