mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-06 06:35:53 +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,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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue