Game state manager and restored inventory

This commit is contained in:
Marco 2025-06-25 15:36:50 +02:00
commit a0ec2f3d74
27 changed files with 1283 additions and 1175 deletions

View file

@ -3,6 +3,7 @@ using System;
using Cirno.Scripts;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Resources.DebugMenu;
using Cirno.Scripts.Utils;
using Godot.Collections;
using DebugMapSelectData = Cirno.Scripts.Resources.DebugMenu.DebugMapSelectData;
@ -26,9 +27,9 @@ public partial class DebugMenu : MenuBase
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
if (GameManager.Instance is not null)
if (GameStateManager.Instance is not null)
{
GameManager.Instance.GameStateChange += OnGameStateChange;
GameStateManager.Instance.GameStateChange += OnGameStateChange;
}
DefaultSelectedButton.GrabFocus();
@ -63,7 +64,7 @@ public partial class DebugMenu : MenuBase
{
if (state is not GameState.Paused)
{
GameManager.Instance.GameStateChange -= OnGameStateChange;
GameStateManager.Instance.GameStateChange -= OnGameStateChange;
CloseMenu();
}
@ -91,9 +92,9 @@ public partial class DebugMenu : MenuBase
private void ButtonOnPressed(DebugMapSelectResource scene)
{
if (GameManager.Instance is not null)
if (GameStateManager.Instance is not null)
{
GameManager.Instance.Unpause();
GameStateManager.Instance.Unpause();
}
GlobalState.Instance.GoToScene(scene.ScenePath, scene.StartData);
}