Things are mostly fixed, but dialogue isn't disappearing

This commit is contained in:
2024-09-07 16:34:31 -07:00
parent b470a9d2fe
commit 872f246a23
9 changed files with 92 additions and 75 deletions

View File

@@ -1,23 +1,42 @@
using Godot;
using DialogueManagerRuntime;
using GameJamDungeon;
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
[Meta(typeof(IAutoNode))]
public partial class DialogueTest : Area3D
{
public override void _Notification(int what) => this.Notify(what);
[Export]
public Resource DialogueResource;
[Export]
public string DialougeStart = "start";
public string DialogueStart = "start";
public override void _Process(double delta)
[Dependency]
public IGameRepo GameRepo => this.DependOn<IGameRepo>();
public override void _Ready()
{
if (Input.IsActionJustPressed(GameInputs.Attack))
OnTalk();
AreaEntered += DialogueTest_AreaEntered;
AreaExited += DialogueTest_AreaExited;
}
public void OnTalk()
private void DialogueTest_AreaExited(Area3D area)
{
DialogueManager.ShowDialogueBalloon(DialogueResource, DialougeStart);
GameRepo.IsWithinDialogueSpace = false;
}
private void DialogueTest_AreaEntered(Area3D area)
{
GameRepo.IsWithinDialogueSpace = true;
}
public override void _UnhandledInput(InputEvent @event)
{
if (Input.IsActionJustPressed("ui_accept") && GameRepo.IsWithinDialogueSpace)
DialogueManager.ShowDialogueBalloon(DialogueResource, DialogueStart);
}
}

View File

@@ -8,6 +8,8 @@
size = Vector3(2, 2, 2)
[node name="Panel" type="Area3D"]
collision_layer = 0
collision_mask = 128
script = ExtResource("1_6offx")
DialogueResource = ExtResource("2_c26a0")
@@ -17,11 +19,10 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
text = "Test"
scroll_active = false
scroll_following = true
script = ExtResource("1_v3yy4")
skip_pause_at_abbreviations = PackedStringArray("eg", "ex")
skip_pause_at_abbreviations = PackedStringArray()
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.254547, -0.166077, -1.29401)