Dialogue system; ask user if they want to teleport to next floor
This commit is contained in:
@@ -3,11 +3,15 @@ namespace GameJamDungeon;
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using DialogueManagerRuntime;
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, INode3D;
|
||||
public interface IGame : IProvide<IGameRepo>, INode3D
|
||||
{
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Game : Node3D, IGame
|
||||
@@ -42,6 +46,8 @@ public partial class Game : Node3D, IGame
|
||||
|
||||
[Node] public AnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
[Node] public DialogueController DialogueController { get; set; } = default!;
|
||||
|
||||
private List<IDungeonFloor> Floors;
|
||||
|
||||
private int _currentFloor = -1;
|
||||
@@ -58,8 +64,17 @@ public partial class Game : Node3D, IGame
|
||||
}
|
||||
|
||||
private void OnTeleportEntered(Node3D body)
|
||||
{
|
||||
GameRepo.Pause();
|
||||
DialogueManager.GetCurrentScene = (() => this);
|
||||
DialogueManager.ShowDialogueBalloonScene(DialogueController.DialogueBalloon, DialogueController.DialogueResource, "floor_exit");
|
||||
DialogueManager.DialogueEnded += (Resource resource) => { GameRepo.Resume(); };
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
GameLogic.Input(new GameLogic.Input.LoadNextFloor());
|
||||
GameRepo.Resume();
|
||||
}
|
||||
|
||||
public void OnResolved()
|
||||
|
||||
Reference in New Issue
Block a user