Fix labels

This commit is contained in:
2024-09-08 15:42:08 -07:00
parent a47d1306b9
commit 1dfc61f003
242 changed files with 5502 additions and 383 deletions

View File

@@ -75,7 +75,7 @@ public partial class Game : Node3D, IGame
var currentFloor = Floors.ElementAt(_currentFloor);
currentFloor.CallDeferred(MethodName.QueueFree, []);
if (GameRepo.EquippedWeapon.Info != null && ((WeaponInfo)GameRepo.EquippedWeapon.Info).WeaponTags.Contains(WeaponTag.BreaksOnChange))
if (GameRepo.EquippedWeapon.WeaponInfo != null && GameRepo.EquippedWeapon.WeaponInfo.WeaponTags.Contains(WeaponTag.BreaksOnChange))
{
GameRepo.InventoryItems.Value.Remove(GameRepo.EquippedWeapon);
GameRepo.OnWeaponEquipped(new Weapon());

View File

@@ -8,7 +8,7 @@ namespace GameJamDungeon
{
public readonly record struct StartGame();
public readonly record struct SetInventoryMode(List<InventoryItem> Inventory);
public readonly record struct SetInventoryMode(List<IInventoryItem> Inventory);
public readonly record struct HideInventory();

View File

@@ -9,7 +9,7 @@ public interface IGameRepo : IDisposable
{
event Action? Ended;
AutoProp<List<InventoryItem>> InventoryItems { get; }
AutoProp<List<IInventoryItem>> InventoryItems { get; }
IAutoProp<bool> IsInventoryScreenOpened { get; }
@@ -48,10 +48,10 @@ public class GameRepo : IGameRepo
{
public event Action? Ended;
private readonly AutoProp<List<InventoryItem>> _inventoryItems;
private readonly AutoProp<List<IInventoryItem>> _inventoryItems;
private readonly AutoProp<bool> _isInventoryScreenOpened;
public AutoProp<List<InventoryItem>> InventoryItems => _inventoryItems;
public AutoProp<List<IInventoryItem>> InventoryItems => _inventoryItems;
public IAutoProp<bool> IsInventoryScreenOpened => _isInventoryScreenOpened;
@@ -84,7 +84,7 @@ public class GameRepo : IGameRepo
public GameRepo()
{
_inventoryItems = new AutoProp<List<InventoryItem>>([]);
_inventoryItems = new AutoProp<List<IInventoryItem>>([]);
_isInventoryScreenOpened = new AutoProp<bool>(false);
_isPaused = new AutoProp<bool>(false);
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);