Fix menus between floors
This commit is contained in:
@@ -24,6 +24,12 @@ public partial class GameState
|
||||
|
||||
public readonly record struct FloorExitEntered;
|
||||
|
||||
public readonly record struct AskForTeleport;
|
||||
|
||||
public readonly record struct UseTeleport;
|
||||
|
||||
public readonly record struct CloseTeleport;
|
||||
|
||||
public readonly record struct GameOver;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public partial class GameState
|
||||
|
||||
public readonly record struct LoadNextFloor;
|
||||
|
||||
public readonly record struct OpenTeleportScreen;
|
||||
|
||||
public readonly record struct OpenFloorExitScreen;
|
||||
|
||||
public readonly record struct OpenDebugMenu;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class GameState
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record AskForTeleportScreen : State, IGet<Input.UseTeleport>, IGet<Input.CloseTeleport>
|
||||
{
|
||||
public AskForTeleportScreen()
|
||||
{
|
||||
OnAttach(() => Get<IGameRepo>().Pause());
|
||||
}
|
||||
|
||||
public Transition On(in Input.ReturnToMainMenu input)
|
||||
{
|
||||
return To<MainMenu>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.UseTeleport input)
|
||||
{
|
||||
Output(new Output.OpenFloorExitScreen());
|
||||
return To<FloorExitScreen>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.CloseTeleport input)
|
||||
{
|
||||
return To<InGame>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,8 @@ public partial class GameState
|
||||
|
||||
public Transition On(in Input.FloorExitEntered input)
|
||||
{
|
||||
Output(new Output.OpenFloorExitScreen());
|
||||
return To<FloorExitScreen>();
|
||||
Output(new Output.OpenTeleportScreen());
|
||||
return To<AskForTeleportScreen>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.GameOver input)
|
||||
|
||||
Reference in New Issue
Block a user