mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 06:18:54 +00:00
Interaction manager and hud
This commit is contained in:
parent
b1afc7af1c
commit
5271b84923
20 changed files with 539 additions and 29 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using Cirno.Scripts;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Resources.DebugMenu;
|
||||
using Godot.Collections;
|
||||
|
|
|
|||
|
|
@ -54,19 +54,24 @@ public partial class InventoryMenu : TabContainer
|
|||
|
||||
//ItemActivated += OnItemSelected;
|
||||
|
||||
GameManager.Instance.GameStateChange += state =>
|
||||
// TODO: Move this on the game manager/controller side
|
||||
if (GameManager.Instance is not null)
|
||||
{
|
||||
switch (state)
|
||||
GameManager.Instance.GameStateChange += state =>
|
||||
{
|
||||
case GameState.Inventory:
|
||||
CallDeferred(MethodName.ShowInventory);
|
||||
break;
|
||||
default:
|
||||
CallDeferred(MethodName.HideInventory);
|
||||
//HideInventory();
|
||||
break;
|
||||
}
|
||||
};
|
||||
switch (state)
|
||||
{
|
||||
case GameState.Inventory:
|
||||
CallDeferred(MethodName.ShowInventory);
|
||||
break;
|
||||
default:
|
||||
CallDeferred(MethodName.HideInventory);
|
||||
//HideInventory();
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void HideInventory()
|
||||
|
|
|
|||
6
Scripts/UI/Selector3D.cs
Normal file
6
Scripts/UI/Selector3D.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
namespace Cirno.Scripts.UI;
|
||||
|
||||
public partial class Selector3D
|
||||
{
|
||||
|
||||
}
|
||||
1
Scripts/UI/Selector3D.cs.uid
Normal file
1
Scripts/UI/Selector3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://beow453jk88rq
|
||||
|
|
@ -24,11 +24,15 @@ public partial class StatusMenu : PanelContainer
|
|||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
InventoryManager.Instance.ItemAdded -= InstanceOnItemAdded;
|
||||
if (InventoryManager.Instance is not null)
|
||||
{
|
||||
InventoryManager.Instance.ItemAdded -= InstanceOnItemAdded;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeDeferred()
|
||||
{
|
||||
if (InventoryManager.Instance is null) return;
|
||||
var healthExpansions = InventoryManager.Instance.GetItemCount(HealthExpansionName);
|
||||
var shieldExpansions = InventoryManager.Instance.GetItemCount(ShieldExpansionName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue