fixed da dialogue

This commit is contained in:
2024-09-07 17:05:10 -07:00
parent 872f246a23
commit f223102525
11 changed files with 88 additions and 91 deletions

12
src/dialog/Dialog.tres Normal file
View File

@@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="DialogueResource" load_steps=2 format=3 uid="uid://dlbsw423e12au"]
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_resource.gd" id="1_p1wx7"]
[resource]
script = ExtResource("1_p1wx7")
using_states = PackedStringArray()
titles = {}
character_names = PackedStringArray()
first_title = ""
lines = {}
raw_text = ""

12
src/dialog/Dialog.tscn Normal file
View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://kt5fg0it26cf"]
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_label.gd" id="1_bkcfu"]
[node name="Dialog" type="RichTextLabel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_bkcfu")
skip_pause_at_abbreviations = PackedStringArray("Mr", "Mrs", "Ms", "Dr", "etc", "eg", "ex")

View File

@@ -0,0 +1,15 @@
[remap]
importer="dialogue_manager_compiler_12"
type="Resource"
uid="uid://lao0opxww3ib"
path="res://.godot/imported/Dialogue.dialogue-176033575bc12c347010f3a30b2e302a.tres"
[deps]
source_file="res://src/dialog/Dialogue.dialogue"
dest_files=["res://.godot/imported/Dialogue.dialogue-176033575bc12c347010f3a30b2e302a.tres"]
[params]
defaults=true

View File

@@ -1,42 +0,0 @@
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 DialogueStart = "start";
[Dependency]
public IGameRepo GameRepo => this.DependOn<IGameRepo>();
public override void _Ready()
{
AreaEntered += DialogueTest_AreaEntered;
AreaExited += DialogueTest_AreaExited;
}
private void DialogueTest_AreaExited(Area3D area)
{
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

@@ -1,29 +1,9 @@
[gd_scene load_steps=5 format=3 uid="uid://xb02opiwelet"]
[gd_scene format=3 uid="uid://b8n8hbe4kdyfw"]
[ext_resource type="Script" path="res://src/dialog/DialogueTest.cs" id="1_6offx"]
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_label.gd" id="1_v3yy4"]
[ext_resource type="Resource" uid="uid://bw086h2dmhraf" path="res://src/dialog/TestDialogue.dialogue" id="2_c26a0"]
[sub_resource type="BoxShape3D" id="BoxShape3D_dhaer"]
size = Vector3(2, 2, 2)
[node name="Panel" type="Area3D"]
collision_layer = 0
collision_mask = 128
script = ExtResource("1_6offx")
DialogueResource = ExtResource("2_c26a0")
[node name="DialogueTest" type="RichTextLabel" parent="."]
[node name="DialogueTest" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
scroll_active = false
scroll_following = true
script = ExtResource("1_v3yy4")
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)
shape = SubResource("BoxShape3D_dhaer")

View File

@@ -1,15 +0,0 @@
[remap]
importer="dialogue_manager_compiler_12"
type="Resource"
uid="uid://bw086h2dmhraf"
path="res://.godot/imported/TestDialogue.dialogue-ef49d7fb6d53dc49d01e69ca7037845f.tres"
[deps]
source_file="res://src/dialog/TestDialogue.dialogue"
dest_files=["res://.godot/imported/TestDialogue.dialogue-ef49d7fb6d53dc49d01e69ca7037845f.tres"]
[params]
defaults=true