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

@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using Cirno.Scripts.Utils;
using Godot;
namespace Cirno.Scripts.Components.Actors;
@ -25,7 +26,7 @@ public partial class KeyboardInputProvider : InputProvider
[Export] private StringName _nextWeaponActionName = "next_weapon";
[Export] private StringName _previousWeaponActionName = "previous_weapon";
[Export] private StringName _inventoryActionName = "inventory";
[Export] private StringName _pauseActionName = "pause";
[Export] private StringName _freezeActionName = "Freeze";
[Export] private StringName _reloadActionName = "Reload";
@ -54,20 +55,7 @@ public partial class KeyboardInputProvider : InputProvider
GD.Print("Mouse aim provider is null");
}
if (GameManager.Instance is null)
{
GD.Print("No GameManager found for keyboard inputprovider");
}
else
{
GameManager.Instance.GameStateChange += InstanceOnGameStateChange;
}
if (GameController.Instance is not null)
{
GameController.Instance.GameStateChange += InstanceOnGameStateChange;
}
GameStateManager.Instance.GameStateChange += InstanceOnGameStateChange;
_enabled = true;
}
@ -178,7 +166,7 @@ public partial class KeyboardInputProvider : InputProvider
public override bool GetPauseJustPressed()
{
return GetActionJustPressed(_pauseActionName);
return GlobalInputManager.IsPauseJustPressed();
}
public override bool GetFreezeJustPressed()