fixed da dialogue
This commit is contained in:
@@ -109,7 +109,7 @@ Throw={
|
||||
|
||||
[internationalization]
|
||||
|
||||
locale/translations_pot_files=PackedStringArray("res://src/dialog/TestDialogue.dialogue")
|
||||
locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialogue", "res://src/dialog/TestDialogue.dialogue")
|
||||
|
||||
[layer_names]
|
||||
|
||||
|
||||
12
src/dialog/Dialog.tres
Normal file
12
src/dialog/Dialog.tres
Normal 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
12
src/dialog/Dialog.tscn
Normal 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")
|
||||
15
src/dialog/Dialogue.dialogue.import
Normal file
15
src/dialog/Dialogue.dialogue.import
Normal 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
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://33ek675mfb5n"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://33ek675mfb5n"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/Game.cs" id="1_ytcii"]
|
||||
[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="3_kk6ly"]
|
||||
@@ -9,7 +9,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://b3r0r22kc67bl" path="res://src/map/dungeon/floors/Floor2.tscn" id="7_1sm5s"]
|
||||
[ext_resource type="PackedScene" uid="uid://b40sstnic41dw" path="res://src/map/dungeon/floors/Floor3.tscn" id="8_87yk1"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3ek5i43cl0r5" path="res://src/map/Teleport.tscn" id="9_nwu7r"]
|
||||
[ext_resource type="PackedScene" uid="uid://xb02opiwelet" path="res://src/dialog/DialogueTest.tscn" id="10_kejri"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_fke5g"]
|
||||
|
||||
@@ -72,7 +71,7 @@ script = ExtResource("1_ytcii")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("3_kk6ly")]
|
||||
process_mode = 1
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.4456, 1.22144)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.74459, 1.22144)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_fke5g")
|
||||
@@ -124,6 +123,3 @@ unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 900, 900, 900)
|
||||
disable_mode = 2
|
||||
|
||||
[node name="Panel" parent="." instance=ExtResource("10_kejri")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.42724, 0.203153, -2.07301)
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dvnc26rebk6o0"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dvnc26rebk6o0"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/floors/Overworld.cs" id="1_5hmt3"]
|
||||
[ext_resource type="Resource" uid="uid://lao0opxww3ib" path="res://src/dialog/Dialogue.dialogue" id="2_k62pf"]
|
||||
[ext_resource type="PackedScene" uid="uid://c10nhqq8su6pp" path="res://src/items/weapons/models/RareSword.tscn" id="2_ni2nx"]
|
||||
[ext_resource type="PackedScene" uid="uid://d4l4qutp8x40c" path="res://src/npc/goddess/Goddess.tscn" id="3_4sm8u"]
|
||||
[ext_resource type="PackedScene" uid="uid://xb02opiwelet" path="res://src/dialog/DialogueTest.tscn" id="4_thkm7"]
|
||||
[ext_resource type="PackedScene" uid="uid://kt5fg0it26cf" path="res://src/dialog/Dialog.tscn" id="4_thkm7"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_46qk4"]
|
||||
size = Vector3(1.96582, 2.5011, 2.21289)
|
||||
|
||||
[node name="Overworld" type="Node3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.63488, -5.13176)
|
||||
script = ExtResource("1_5hmt3")
|
||||
Dialogue = ExtResource("2_k62pf")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.82007, 0.766602, -1.46094)
|
||||
@@ -29,5 +34,13 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.8356, -2.30799)
|
||||
transform = Transform3D(1.4, 0, 0, 0, 1.4, 0, 0, 0, 1.4, -8.84798, -2.93175, -3.9493)
|
||||
|
||||
[node name="Panel" parent="Goddess" instance=ExtResource("4_thkm7")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0604029, 0.440545, 0.961159)
|
||||
collision_layer = 2
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="NPCBox" type="Area3D" parent="Goddess/Panel"]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 128
|
||||
collision_mask = 128
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Goddess/Panel/NPCBox"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.8395, -1.94114, -8.99061)
|
||||
shape = SubResource("BoxShape3D_46qk4")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using DialogueManagerRuntime;
|
||||
using GameJamDungeon;
|
||||
using Godot;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
@@ -7,8 +9,32 @@ public partial class Overworld : Node3D, IDungeonFloor
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Dependency]
|
||||
public IGameRepo GameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
[Node] public Area3D NPCBox { get; set; } = default!;
|
||||
|
||||
[Export] public Resource Dialogue { get; set; }
|
||||
|
||||
public void InitializeDungeon()
|
||||
{
|
||||
NPCBox.AreaEntered += NPCBox_AreaEntered;
|
||||
NPCBox.AreaExited += NPCBox_AreaExited;
|
||||
}
|
||||
|
||||
private void NPCBox_AreaExited(Area3D area)
|
||||
{
|
||||
GameRepo.IsWithinDialogueSpace = false;
|
||||
}
|
||||
|
||||
private void NPCBox_AreaEntered(Area3D area)
|
||||
{
|
||||
GameRepo.IsWithinDialogueSpace = true;
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (Input.IsActionJustPressed("ui_accept") && GameRepo.IsWithinDialogueSpace)
|
||||
DialogueManager.ShowDialogueBalloon(Dialogue, "start");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user