Load screen with pausing

This commit is contained in:
2024-09-04 12:52:28 -07:00
parent bd6f57e7df
commit b21bcf0573
15 changed files with 202 additions and 75 deletions

View File

@@ -41,7 +41,7 @@ public partial class Game : Node3D, IGame
{
GameBinding = GameLogic.Bind();
GameBinding
.Handle((in GameLogic.Output.StartGame _) => { GameRepo.Resume(); })
.Handle((in GameLogic.Output.StartGame _) => { })
.Handle((in GameLogic.Output.SetPauseMode output) => { CallDeferred(nameof(SetPauseMode), output.IsPaused); })
.Handle((in GameLogic.Output.SetInventoryMode _) => { InventoryMenu.PopulateItems(_.Inventory); InventoryMenu.Show(); })
.Handle((in GameLogic.Output.HideInventory _) => { InventoryMenu.Hide(); InventoryMenu.ClearItems(); })

View File

@@ -60,7 +60,7 @@ public class GameRepo : IGameRepo
{
_inventoryItems = new AutoProp<List<InventoryItemInfo>>([]);
_isInventoryScreenOpened = new AutoProp<bool>(false);
_isPaused = new AutoProp<bool>(false);
_isPaused = new AutoProp<bool>(true);
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);
_equippedWeapon = new Weapon();
HPBarValue = new AutoProp<int>(0);

View File

@@ -12,7 +12,7 @@ namespace GameJamDungeon
{
public Playing()
{
this.OnEnter(() => { Output(new Output.StartGame()); Get<IGameRepo>().Resume(); });
this.OnEnter(() => { Output(new Output.StartGame()); });
OnAttach(() => Get<IGameRepo>().Ended += OnEnded);
OnDetach(() => Get<IGameRepo>().Ended -= OnEnded);