Add minimap to sidebar
This commit is contained in:
@@ -16,8 +16,6 @@ public partial class GameState
|
||||
|
||||
public readonly record struct InventoryButtonPressed;
|
||||
|
||||
public readonly record struct MiniMapButtonPressed;
|
||||
|
||||
public readonly record struct PauseButtonPressed;
|
||||
|
||||
public readonly record struct DebugButtonPressed;
|
||||
|
||||
@@ -12,10 +12,6 @@ public partial class GameState
|
||||
|
||||
public readonly record struct CloseInventoryMenu;
|
||||
|
||||
public readonly record struct OpenMiniMap;
|
||||
|
||||
public readonly record struct CloseMiniMap;
|
||||
|
||||
public readonly record struct OpenPauseScreen;
|
||||
|
||||
public readonly record struct ClosePauseScreen;
|
||||
|
||||
@@ -10,7 +10,6 @@ public partial class GameState
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record InGame : State,
|
||||
IGet<Input.InventoryButtonPressed>,
|
||||
IGet<Input.MiniMapButtonPressed>,
|
||||
IGet<Input.PauseButtonPressed>,
|
||||
IGet<Input.DebugButtonPressed>,
|
||||
IGet<Input.FloorExitEntered>,
|
||||
@@ -22,12 +21,6 @@ public partial class GameState
|
||||
return To<InventoryScreen>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.MiniMapButtonPressed input)
|
||||
{
|
||||
Output(new Output.OpenMiniMap());
|
||||
return To<MiniMapScreen>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.PauseButtonPressed input)
|
||||
{
|
||||
Output(new Output.OpenPauseScreen());
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class GameState
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record MiniMapScreen : State, IGet<Input.MiniMapButtonPressed>
|
||||
{
|
||||
public Transition On(in Input.MiniMapButtonPressed input)
|
||||
{
|
||||
Output(new Output.CloseMiniMap());
|
||||
return To<InGame>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,6 @@ public partial class InGameUILogic
|
||||
{
|
||||
public static class Input
|
||||
{
|
||||
public readonly record struct ShowMinimap;
|
||||
public readonly record struct HideMinimap;
|
||||
public readonly record struct ShowInventory;
|
||||
public readonly record struct HideInventory;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ public partial class InGameUILogic
|
||||
public readonly record struct AnnounceMessageOnMainScreen(string Message);
|
||||
public readonly record struct AnnounceMessageInInventory(string Message);
|
||||
public readonly record struct RemoveItemFromInventory(InventoryItem Item);
|
||||
public readonly record struct DisplayMinimap;
|
||||
public readonly record struct HideMinimap;
|
||||
public readonly record struct ShowInventory;
|
||||
public readonly record struct HideInventory;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@ public partial class InGameUILogic
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record Active : State, IGet<Input.ShowMinimap>, IGet<Input.ShowInventory>
|
||||
public partial record Active : State, IGet<Input.ShowInventory>
|
||||
{
|
||||
public Transition On(in Input.ShowMinimap input) => To<MinimapOpen>();
|
||||
public Transition On(in Input.ShowInventory input) => To<InventoryOpen>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using Chickensoft.Introspection;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class InGameUILogic
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record MinimapOpen : State, IGet<Input.HideMinimap>
|
||||
{
|
||||
public MinimapOpen()
|
||||
{
|
||||
OnAttach(() => { Get<IGameRepo>().Pause(); Output(new Output.DisplayMinimap()); });
|
||||
OnDetach(() => { Get<IGameRepo>().Resume(); Output(new Output.HideMinimap()); });
|
||||
}
|
||||
|
||||
public Transition On(in Input.HideMinimap input) => To<Active>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user