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

@ -311,39 +311,6 @@ public partial class Hud : CanvasLayer
}
}
// public void RemoveInventoryItem(string itemKey, int currentAmount)
// {
// if (_items.TryGetValue(itemKey, out var itm))
// {
// if (currentAmount <= 0)
// {
// itm.Container.QueueFree();
// _items.Remove(itemKey);
// }
// else
// {
// if (itm.Item.UiType == UiItemType.IconText)
// {
// itm.Label.Text = currentAmount.ToString();
// }
// }
// }
// else
// {
// GD.Print($"Tried to remove item {itemKey} but it was not found");
// }
//
// // var containerItem = _items.FirstOrDefault(x => x.Item == item);
// // if (containerItem == null)
// // {
// // GD.Print($"Tried to remove item {item.ItemName} but it was not found");
// // return;
// // }
// //
// // containerItem.Container.QueueFree();
//
// }
private void SpawnDebugMenu()
{
ClearPauseMenu();
@ -364,7 +331,7 @@ public partial class Hud : CanvasLayer
menu.MenuClosed += () =>
{
DebugMenuHolder.Visible = false;
if (GameManager.Instance.GameState is GameState.Paused)
if (GameStateManager.Instance.GameState is GameState.Paused)
{
SpawnPauseMenu();
}