Massive refactor (inventory menu still a little broken but its Good Enough)
This commit is contained in:
@@ -4,15 +4,10 @@ namespace GameJamDungeon;
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using DialogueManagerRuntime;
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGame>, INode3D
|
||||
{
|
||||
public void ToggleInventory();
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
@@ -34,17 +29,17 @@ public partial class Game : Node3D, IGame
|
||||
|
||||
[Dependency] public IAppRepo AppRepo => this.DependOn<IAppRepo>();
|
||||
|
||||
#region Nodes
|
||||
[Node] public IMap Map { get; set; } = default!;
|
||||
|
||||
[Node] public DialogueController DialogueController { get; set; } = default!;
|
||||
|
||||
[Node] public IPauseMenu PauseMenu { get; set; } = default!;
|
||||
[Node] public InGameUI InGameUI { get; set; } = default!;
|
||||
|
||||
[Node] public FloorClearMenu FloorClearMenu { get; set; } = default!;
|
||||
|
||||
[Node] public DeathMenu DeathMenu { get; set; } = default!;
|
||||
|
||||
[Node] public InGameUI InGameUI { get; set; } = default!;
|
||||
[Node] public IPauseMenu PauseMenu { get; set; } = default!;
|
||||
#endregion
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
@@ -53,9 +48,30 @@ public partial class Game : Node3D, IGame
|
||||
GameLogic.Set(GameRepo);
|
||||
GameLogic.Set(AppRepo);
|
||||
Instantiator = new Instantiator(GetTree());
|
||||
}
|
||||
|
||||
FloorClearMenu.TransitionCompleted += OnFloorClearTransitionCompleted;
|
||||
PauseMenu.TransitionCompleted += OnPauseMenuTransitioned;
|
||||
private void PlayerInventory_InventoryAtCapacity(string rejectedItem)
|
||||
{
|
||||
InGameUI.PlayerInfoUI.DisplayInventoryFullMessage(rejectedItem);
|
||||
}
|
||||
|
||||
private void OnInventoryAtCapacity(string rejectedItemName) => InGameUI.PlayerInfoUI.DisplayInventoryFullMessage(rejectedItemName);
|
||||
|
||||
private void InventoryMenu_CloseInventory() => GameLogic.Input(new GameLogic.Input.InventoryMenuToggle());
|
||||
|
||||
private void Map_DungeonFinishedGenerating()
|
||||
{
|
||||
GameRepo.SetPlayerGlobalPosition(Map.GetPlayerSpawnPoint());
|
||||
}
|
||||
|
||||
private void Map_DialogueChoiceMade()
|
||||
{
|
||||
GameRepo.Resume();
|
||||
}
|
||||
|
||||
private void Map_TeleportReached()
|
||||
{
|
||||
GameRepo.Pause();
|
||||
}
|
||||
|
||||
private void OnFloorClearTransitionCompleted()
|
||||
@@ -68,12 +84,6 @@ public partial class Game : Node3D, IGame
|
||||
GameLogic.Input(new GameLogic.Input.PauseMenuTransitioned());
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
GameLogic.Input(new GameLogic.Input.LoadNextFloor());
|
||||
GameRepo.Resume();
|
||||
}
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
GameBinding = GameLogic.Bind();
|
||||
@@ -92,6 +102,7 @@ public partial class Game : Node3D, IGame
|
||||
.Handle((in GameLogic.Output.HidePauseMenu _) => { PauseMenu.Hide(); })
|
||||
.Handle((in GameLogic.Output.ExitPauseMenu _) => { PauseMenu.FadeOut(); })
|
||||
.Handle((in GameLogic.Output.ShowFloorClearMenu _) => { FloorClearMenu.Show(); FloorClearMenu.FadeIn(); })
|
||||
.Handle((in GameLogic.Output.ExitFloorClearMenu _) => { FloorClearMenu.FadeOut(); })
|
||||
.Handle((in GameLogic.Output.SetInventoryMode _) => { InGameUI.ShowInventoryScreen(); })
|
||||
.Handle((in GameLogic.Output.HideInventory _) => { InGameUI.HideInventoryScreen(); })
|
||||
.Handle((in GameLogic.Output.ShowMiniMap _) => { InGameUI.ShowMiniMap(); })
|
||||
@@ -103,6 +114,14 @@ public partial class Game : Node3D, IGame
|
||||
GameLogic.Input(new GameLogic.Input.Initialize());
|
||||
|
||||
this.Provide();
|
||||
|
||||
FloorClearMenu.TransitionCompleted += OnFloorClearTransitionCompleted;
|
||||
PauseMenu.TransitionCompleted += OnPauseMenuTransitioned;
|
||||
Map.TeleportReached += Map_TeleportReached;
|
||||
Map.DialogueDecisionMade += Map_DialogueChoiceMade;
|
||||
Map.DungeonFinishedGenerating += Map_DungeonFinishedGenerating;
|
||||
InGameUI.InventoryMenu.ClosedMenu += InventoryMenu_CloseInventory;
|
||||
GameRepo.PlayerData.Inventory.InventoryAtCapacity += PlayerInventory_InventoryAtCapacity;
|
||||
}
|
||||
|
||||
public void ToggleInventory()
|
||||
@@ -143,5 +162,5 @@ public partial class Game : Node3D, IGame
|
||||
GetTree().Paused = isPaused;
|
||||
}
|
||||
|
||||
public void OnStart() => GameLogic.Input(new GameLogic.Input.Start());
|
||||
public void OnStart() => GameLogic.Input(new GameLogic.Input.StartGame());
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ script = ExtResource("4_f5pye")
|
||||
|
||||
[node name="InGameUI" parent="." instance=ExtResource("5_lxtnp")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
||||
[node name="InGameAudio" parent="." instance=ExtResource("6_qc71l")]
|
||||
|
||||
@@ -47,6 +46,7 @@ visible = false
|
||||
[node name="FloorClearMenu" parent="." instance=ExtResource("11_rya1n")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
modulate = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="PauseMenu" parent="." instance=ExtResource("12_yev8k")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
public static class Input
|
||||
{
|
||||
public readonly record struct Start;
|
||||
public readonly record struct StartGame;
|
||||
|
||||
public readonly record struct Initialize;
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
public readonly record struct GameOver;
|
||||
|
||||
public readonly record struct LoadNextFloor;
|
||||
|
||||
public readonly record struct FloorExitReached;
|
||||
|
||||
public readonly record struct FloorClearTransitioned;
|
||||
|
||||
public readonly record struct GoToNextFloor;
|
||||
|
||||
public readonly record struct PauseButtonPressed;
|
||||
|
||||
public readonly record struct PauseMenuTransitioned;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace GameJamDungeon
|
||||
|
||||
public readonly record struct ExitPauseMenu;
|
||||
|
||||
public readonly record struct SetInventoryMode(List<IInventoryItem> Inventory);
|
||||
public readonly record struct SetInventoryMode();
|
||||
|
||||
public readonly record struct HideInventory;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace GameJamDungeon
|
||||
|
||||
public readonly record struct ShowFloorClearMenu;
|
||||
|
||||
public readonly record struct HideFloorClearMenu;
|
||||
public readonly record struct ExitFloorClearMenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@startuml GameLogic
|
||||
state "GameLogic State" as GameJamDungeon_GameLogic_State {
|
||||
state "FloorCleared" as GameJamDungeon_GameLogic_State_FloorCleared
|
||||
state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted
|
||||
state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened
|
||||
state "MenuBackdrop" as GameJamDungeon_GameLogic_State_MenuBackdrop
|
||||
state "MinimapOpen" as GameJamDungeon_GameLogic_State_MinimapOpen
|
||||
@@ -10,9 +11,11 @@ state "GameLogic State" as GameJamDungeon_GameLogic_State {
|
||||
state "Resuming" as GameJamDungeon_GameLogic_State_Resuming
|
||||
}
|
||||
|
||||
GameJamDungeon_GameLogic_State_FloorCleared --> GameJamDungeon_GameLogic_State_FloorCleared : GoToNextFloor
|
||||
GameJamDungeon_GameLogic_State_GameStarted --> GameJamDungeon_GameLogic_State_Playing : Initialize
|
||||
GameJamDungeon_GameLogic_State_InventoryOpened --> GameJamDungeon_GameLogic_State_Playing : InventoryMenuToggle
|
||||
GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_MenuBackdrop : Initialize
|
||||
GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_Playing : Start
|
||||
GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_Playing : StartGame
|
||||
GameJamDungeon_GameLogic_State_MinimapOpen --> GameJamDungeon_GameLogic_State_Playing : MiniMapButtonReleased
|
||||
GameJamDungeon_GameLogic_State_Paused --> GameJamDungeon_GameLogic_State_Resuming : PauseButtonPressed
|
||||
GameJamDungeon_GameLogic_State_Playing --> GameJamDungeon_GameLogic_State_FloorCleared : FloorExitReached
|
||||
@@ -24,14 +27,16 @@ GameJamDungeon_GameLogic_State_Resuming --> GameJamDungeon_GameLogic_State_Playi
|
||||
|
||||
GameJamDungeon_GameLogic_State : OnIsPaused() → SetPauseMode
|
||||
GameJamDungeon_GameLogic_State_FloorCleared : OnEnter → ShowFloorClearMenu
|
||||
GameJamDungeon_GameLogic_State_FloorCleared : OnExit → HideFloorClearMenu
|
||||
GameJamDungeon_GameLogic_State_FloorCleared : OnExit → ExitFloorClearMenu
|
||||
GameJamDungeon_GameLogic_State_GameStarted : OnEnter → ShowFloorClearMenu
|
||||
GameJamDungeon_GameLogic_State_GameStarted : OnExit → ExitFloorClearMenu
|
||||
GameJamDungeon_GameLogic_State_GameStarted : OnInitialize → StartGame
|
||||
GameJamDungeon_GameLogic_State_InventoryOpened : OnEnter → SetInventoryMode
|
||||
GameJamDungeon_GameLogic_State_InventoryOpened : OnExit → HideInventory
|
||||
GameJamDungeon_GameLogic_State_MinimapOpen : OnEnter → ShowMiniMap
|
||||
GameJamDungeon_GameLogic_State_MinimapOpen : OnExit → HideMiniMap
|
||||
GameJamDungeon_GameLogic_State_Paused : OnEnter → ShowPauseMenu
|
||||
GameJamDungeon_GameLogic_State_Paused : OnExit → ExitPauseMenu
|
||||
GameJamDungeon_GameLogic_State_Playing : OnEnter → StartGame
|
||||
GameJamDungeon_GameLogic_State_Quit : OnEnter → ShowLostScreen
|
||||
GameJamDungeon_GameLogic_State_Resuming : OnExit → HidePauseMenu
|
||||
|
||||
|
||||
@@ -1,107 +1,57 @@
|
||||
using Chickensoft.Collections;
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
public interface IGameRepo : IDisposable
|
||||
{
|
||||
public void OnGameEnded();
|
||||
|
||||
event Action? Ended;
|
||||
|
||||
AutoProp<List<IInventoryItem>> InventoryItems { get; }
|
||||
|
||||
IAutoProp<bool> IsInventoryScreenOpened { get; }
|
||||
|
||||
IAutoProp<bool> IsPaused { get; }
|
||||
|
||||
void Pause();
|
||||
|
||||
void Resume();
|
||||
|
||||
IAutoProp<bool> IsPaused { get; }
|
||||
|
||||
IAutoProp<Vector3> PlayerGlobalPosition { get; }
|
||||
|
||||
PlayerData PlayerData { get; }
|
||||
|
||||
public void SetPlayerData(PlayerData playerData);
|
||||
|
||||
void SetPlayerGlobalPosition(Vector3 playerGlobalPosition);
|
||||
|
||||
void SetPlayerStatInfo(PlayerStatInfo playerStatInfo);
|
||||
|
||||
public void OnWeaponEquipped(Weapon equippedItem);
|
||||
|
||||
public void OnArmorEquipped(Armor equippedItem);
|
||||
|
||||
public void OnAccessoryEquipped(Accessory equippedItem);
|
||||
|
||||
public AutoProp<Weapon> EquippedWeapon { get; }
|
||||
|
||||
public AutoProp<Armor> EquippedArmor { get; }
|
||||
|
||||
public AutoProp<Accessory> EquippedAccessory { get; }
|
||||
|
||||
public int MaxItemSize { get; }
|
||||
|
||||
public AutoProp<PlayerStatInfo> PlayerStatInfo { get; }
|
||||
|
||||
public bool IsItemEquipped(IEquipable item);
|
||||
|
||||
public void EquipItem(IEquipable item);
|
||||
|
||||
public void UnequipItem(IEquipable item);
|
||||
|
||||
public int CurrentFloor { get; set; }
|
||||
|
||||
public void OnGameEnded();
|
||||
|
||||
event Action? Ended;
|
||||
}
|
||||
|
||||
public class GameRepo : IGameRepo
|
||||
{
|
||||
public event Action? Ended;
|
||||
|
||||
private readonly AutoProp<List<IInventoryItem>> _inventoryItems;
|
||||
private readonly AutoProp<bool> _isInventoryScreenOpened;
|
||||
|
||||
public AutoProp<List<IInventoryItem>> InventoryItems => _inventoryItems;
|
||||
|
||||
public IAutoProp<bool> IsInventoryScreenOpened => _isInventoryScreenOpened;
|
||||
|
||||
public IAutoProp<Vector3> PlayerGlobalPosition => _playerGlobalPosition;
|
||||
private readonly AutoProp<Vector3> _playerGlobalPosition;
|
||||
|
||||
public IAutoProp<bool> IsPaused => _isPaused;
|
||||
private readonly AutoProp<bool> _isPaused;
|
||||
|
||||
private AutoProp<Weapon> _equippedWeapon;
|
||||
public AutoProp<Weapon> EquippedWeapon => _equippedWeapon;
|
||||
|
||||
private AutoProp<Armor> _equippedArmor;
|
||||
|
||||
public AutoProp<Armor> EquippedArmor => _equippedArmor;
|
||||
|
||||
private AutoProp<Accessory> _equippedAccessory;
|
||||
|
||||
public AutoProp<Accessory> EquippedAccessory => _equippedAccessory;
|
||||
|
||||
public bool IsWithinDialogueSpace { get; set; }
|
||||
public PlayerData PlayerData => _playerData;
|
||||
private PlayerData _playerData;
|
||||
|
||||
public int MaxItemSize => 20;
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
private AutoProp<PlayerStatInfo> _playerStatInfo;
|
||||
|
||||
public AutoProp<PlayerStatInfo> PlayerStatInfo => _playerStatInfo;
|
||||
|
||||
public int CurrentFloor { get; set; } = -1;
|
||||
public int CurrentFloor { get; set; } = 0;
|
||||
|
||||
public GameRepo()
|
||||
{
|
||||
_inventoryItems = new AutoProp<List<IInventoryItem>>([]);
|
||||
_isInventoryScreenOpened = new AutoProp<bool>(false);
|
||||
_isPaused = new AutoProp<bool>(false);
|
||||
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);
|
||||
_equippedWeapon = new AutoProp<Weapon>(new Weapon());
|
||||
_equippedArmor = new AutoProp<Armor>(new Armor());
|
||||
_equippedAccessory = new AutoProp<Accessory>(new Accessory());
|
||||
_playerStatInfo = new AutoProp<PlayerStatInfo>(new PlayerStatInfo());
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@@ -118,37 +68,7 @@ public class GameRepo : IGameRepo
|
||||
|
||||
public void SetPlayerGlobalPosition(Vector3 playerGlobalPosition) => _playerGlobalPosition.OnNext(playerGlobalPosition);
|
||||
|
||||
public void SetPlayerStatInfo(PlayerStatInfo playerStatInfo) => _playerStatInfo.OnNext(playerStatInfo);
|
||||
|
||||
public void OnWeaponEquipped(Weapon equippedItem)
|
||||
{
|
||||
PlayerStatInfo.Value.BonusAttack -= _equippedWeapon.Value.WeaponInfo.Damage;
|
||||
PlayerStatInfo.Value.BonusAttack += equippedItem.WeaponInfo.Damage;
|
||||
_equippedWeapon.OnNext(equippedItem);
|
||||
}
|
||||
|
||||
public void OnArmorEquipped(Armor equippedItem)
|
||||
{
|
||||
PlayerStatInfo.Value.BonusDefense -= _equippedArmor.Value.ArmorInfo.Defense;
|
||||
PlayerStatInfo.Value.BonusDefense += equippedItem.ArmorInfo.Defense;
|
||||
_equippedArmor.OnNext(equippedItem);
|
||||
}
|
||||
|
||||
public void OnAccessoryEquipped(Accessory equippedItem)
|
||||
{
|
||||
PlayerStatInfo.Value.BonusAttack -= _equippedAccessory.Value.AccessoryInfo.ATKUp;
|
||||
PlayerStatInfo.Value.BonusDefense -= _equippedAccessory.Value.AccessoryInfo.DEFUp;
|
||||
PlayerStatInfo.Value.MaximumHP -= _equippedAccessory.Value.AccessoryInfo.MaxHPUp;
|
||||
PlayerStatInfo.Value.MaximumVT -= _equippedAccessory.Value.AccessoryInfo.MaxVTUp;
|
||||
PlayerStatInfo.Value.Luck -= _equippedAccessory.Value.AccessoryInfo.LUCKUp;
|
||||
|
||||
PlayerStatInfo.Value.BonusAttack += equippedItem.AccessoryInfo.ATKUp;
|
||||
PlayerStatInfo.Value.BonusDefense += equippedItem.AccessoryInfo.DEFUp;
|
||||
PlayerStatInfo.Value.MaximumHP += equippedItem.AccessoryInfo.MaxHPUp;
|
||||
PlayerStatInfo.Value.MaximumVT += equippedItem.AccessoryInfo.MaxVTUp;
|
||||
PlayerStatInfo.Value.Luck += equippedItem.AccessoryInfo.LUCKUp;
|
||||
_equippedAccessory.OnNext(equippedItem);
|
||||
}
|
||||
public void SetPlayerData(PlayerData playerData) => _playerData = playerData;
|
||||
|
||||
public void OnGameEnded()
|
||||
{
|
||||
@@ -156,42 +76,6 @@ public class GameRepo : IGameRepo
|
||||
Ended?.Invoke();
|
||||
}
|
||||
|
||||
public bool IsItemEquipped(IEquipable item)
|
||||
{
|
||||
if (item is Weapon)
|
||||
return EquippedWeapon.Value == item;
|
||||
|
||||
if (item is Armor)
|
||||
return EquippedArmor.Value == item;
|
||||
|
||||
if (item is Accessory)
|
||||
return EquippedAccessory.Value == item;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void EquipItem(IEquipable item)
|
||||
{
|
||||
if (item is Weapon weapon)
|
||||
OnWeaponEquipped(weapon);
|
||||
|
||||
if (item is Armor armor)
|
||||
OnArmorEquipped(armor);
|
||||
|
||||
if (item is Accessory accessory)
|
||||
OnAccessoryEquipped(accessory);
|
||||
}
|
||||
|
||||
public void UnequipItem(IEquipable item)
|
||||
{
|
||||
if (item == EquippedWeapon.Value)
|
||||
OnWeaponEquipped(new Weapon());
|
||||
if (item == EquippedArmor.Value)
|
||||
OnArmorEquipped(new Armor());
|
||||
if (item == EquippedAccessory.Value)
|
||||
OnAccessoryEquipped(new Accessory());
|
||||
}
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
@@ -200,10 +84,6 @@ public class GameRepo : IGameRepo
|
||||
{
|
||||
_playerGlobalPosition.OnCompleted();
|
||||
_playerGlobalPosition.Dispose();
|
||||
_inventoryItems.OnCompleted();
|
||||
_inventoryItems.Dispose();
|
||||
_isInventoryScreenOpened.OnCompleted();
|
||||
_isInventoryScreenOpened.Dispose();
|
||||
_isPaused.OnCompleted();
|
||||
_isPaused.Dispose();
|
||||
}
|
||||
|
||||
@@ -8,12 +8,17 @@ namespace GameJamDungeon
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record FloorCleared : State
|
||||
public partial record FloorCleared : State, IGet<Input.GoToNextFloor>
|
||||
{
|
||||
public FloorCleared()
|
||||
{
|
||||
this.OnEnter(() => { Get<IGameRepo>().Pause(); Output(new Output.ShowFloorClearMenu()); });
|
||||
this.OnExit(() => { Output(new Output.HideFloorClearMenu()); });
|
||||
this.OnExit(() => { Output(new Output.ExitFloorClearMenu()); });
|
||||
}
|
||||
|
||||
public Transition On(in Input.GoToNextFloor input)
|
||||
{
|
||||
return ToSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
src/game/state/states/GameLogic.State.GameStarted.cs
Normal file
27
src/game/state/states/GameLogic.State.GameStarted.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
|
||||
namespace GameJamDungeon
|
||||
{
|
||||
public partial class GameLogic
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record GameStarted : State, IGet<Input.Initialize>
|
||||
{
|
||||
public GameStarted()
|
||||
{
|
||||
this.OnEnter(() => { Get<IGameRepo>().Pause(); Output(new Output.ShowFloorClearMenu()); });
|
||||
this.OnExit(() => { Output(new Output.ExitFloorClearMenu()); });
|
||||
}
|
||||
|
||||
public Transition On(in Input.Initialize input)
|
||||
{
|
||||
Output(new Output.StartGame());
|
||||
return To<Playing>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace GameJamDungeon
|
||||
{
|
||||
public InventoryOpened()
|
||||
{
|
||||
this.OnEnter(() => { Get<IGameRepo>().Pause(); Output(new Output.SetInventoryMode(Get<IGameRepo>().InventoryItems.Value)); });
|
||||
this.OnEnter(() => { Get<IGameRepo>().Pause(); Output(new Output.SetInventoryMode()); });
|
||||
this.OnExit(() => { Get<IGameRepo>().Resume(); Output(new Output.HideInventory()); });
|
||||
}
|
||||
public Transition On(in Input.InventoryMenuToggle input) => To<Playing>();
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace GameJamDungeon
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record MenuBackdrop : State, IGet<Input.Start>, IGet<Input.Initialize>
|
||||
public partial record MenuBackdrop : State, IGet<Input.StartGame>, IGet<Input.Initialize>
|
||||
{
|
||||
public MenuBackdrop()
|
||||
{
|
||||
@@ -15,9 +15,9 @@ namespace GameJamDungeon
|
||||
OnDetach(() => Get<IAppRepo>().GameEntered -= OnGameEntered);
|
||||
}
|
||||
|
||||
public void OnGameEntered() => Input(new Input.Start());
|
||||
public void OnGameEntered() => Input(new Input.StartGame());
|
||||
|
||||
public Transition On(in Input.Start input) => To<Playing>();
|
||||
public Transition On(in Input.StartGame input) => To<Playing>();
|
||||
|
||||
public Transition On(in Input.Initialize input)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,6 @@ namespace GameJamDungeon
|
||||
{
|
||||
public Playing()
|
||||
{
|
||||
this.OnEnter(() => { Output(new Output.StartGame()); });
|
||||
|
||||
OnAttach(() => Get<IGameRepo>().Ended += OnEnded);
|
||||
OnDetach(() => Get<IGameRepo>().Ended -= OnEnded);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user