mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-05 07:35:55 +00:00
Game state manager and restored inventory
This commit is contained in:
parent
f0f49f8fb4
commit
a0ec2f3d74
27 changed files with 1283 additions and 1175 deletions
|
|
@ -1,12 +1,10 @@
|
|||
using Godot;
|
||||
using Cirno.Scripts.Utils;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.UI;
|
||||
|
||||
public partial class PauseMenu : Control
|
||||
{
|
||||
[Export]
|
||||
public StringName PauseActionName = "pause";
|
||||
|
||||
[ExportGroup("Scenes")]
|
||||
[Export]
|
||||
public string MainMenuScene { get; private set; }
|
||||
|
|
@ -43,9 +41,9 @@ public partial class PauseMenu : Control
|
|||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (_gameManager.GameState == GameState.Paused && Input.IsActionJustPressed(PauseActionName))
|
||||
if (GameStateManager.Instance.GameState is GameState.Paused && GlobalInputManager.IsPauseJustPressed())
|
||||
{
|
||||
_gameManager.Unpause();
|
||||
GameStateManager.Instance.Unpause();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -56,12 +54,12 @@ public partial class PauseMenu : Control
|
|||
|
||||
private void ResumeButtonOnPressed()
|
||||
{
|
||||
_gameManager.Unpause();
|
||||
GameStateManager.Instance.Unpause();
|
||||
}
|
||||
|
||||
private void QuitButtonOnPressed()
|
||||
{
|
||||
_gameManager.Unpause();
|
||||
GameStateManager.Instance.Unpause();
|
||||
GlobalState.Instance.ChangeCursor(true);
|
||||
GlobalState.Instance.GotoScene(MainMenuScene);
|
||||
//GetTree().ChangeSceneToFile(MainMenuScene);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue