r2mods/ilspy_dump/ror2_csproj/RoR2.UI.MainMenu/SubmenuMainMenuScreen.cs

42 lines
1.1 KiB
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
using UnityEngine.Serialization;
namespace RoR2.UI.MainMenu;
public class SubmenuMainMenuScreen : BaseMainMenuScreen
{
[FormerlySerializedAs("settingsPanelPrefab")]
public GameObject submenuPanelPrefab;
private GameObject submenuPanelInstance;
private HGHeaderNavigationController headerNavigationController;
private new void Awake()
{
submenuPanelInstance = Object.Instantiate(submenuPanelPrefab, base.transform);
submenuPanelInstance.GetComponent<HGHeaderNavigationController>().isPrimaryPlayer = true;
headerNavigationController = GetComponentInChildren<HGHeaderNavigationController>();
}
public override void OnEnter(MainMenuController mainMenuController)
{
submenuPanelInstance.SetActive(value: true);
headerNavigationController?.ChooseFirstHeader();
base.OnEnter(mainMenuController);
}
public override void OnExit(MainMenuController mainMenuController)
{
base.OnExit(mainMenuController);
}
public new void Update()
{
if (!submenuPanelInstance.activeSelf && (bool)myMainMenuController)
{
myMainMenuController.SetDesiredMenuScreen(myMainMenuController.titleMenuScreen);
}
}
}