Add rudimentary dialogue system.

This commit is contained in:
yagigreg committed 2026-10-18 00:53:22 -05:00
1 parent 8f2083bd9f
commit c56a32555e
6 files changed
+68 -4

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
[gd_scene format=3 uid="uid://bla1cfndgad0"]
[ext_resource type="Script" uid="uid://byj4ibepgm6oa" path="res://dialogue.gd" id="1_tgtc2"]
[node name="Dialogue" type="Control" unique_id=1025022375]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tgtc2")
[node name="Panel" type="Panel" parent="." unique_id=1878574619]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.179
anchor_top = 0.683
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -230.12001
offset_top = -493.76
offset_right = -230.0
offset_bottom = -494.0
grow_horizontal = 0
grow_vertical = 0
[node name="Text" type="RichTextLabel" parent="Panel" unique_id=1494828842]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 11.0
offset_right = -11.0
offset_bottom = 4.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
+1
View File
@@ -43,6 +43,7 @@ offset_left = 150.0
offset_top = 105.0
offset_right = 1102.0
offset_bottom = 652.0
bbcode_enabled = true
text = ">> Pharaoh OS 2000 Boot Sequence
>> WARN: Detected anomalies!
>> WARN: Memory integrity at %d%%!
+15
View File
@@ -0,0 +1,15 @@
class_name Dialogue
extends Control
func show_text(text: String) -> Dialogue:
visible = true
$Panel/Text.text = "[font_size=28]%s" % text
return self
func dismiss_after(secs: float) -> Dialogue:
await get_tree().create_timer(secs).timeout
return dismiss()
func dismiss() -> Dialogue:
visible = false
return self
+1
View File
@@ -0,0 +1 @@
uid://byj4ibepgm6oa
+1
View File
@@ -25,6 +25,7 @@ func _ready() -> void:
spawn_point = position
DisplayServer.window_set_title("JUMPS EQUALS JUMPS")
give_objective("sarc", 0, "Open the Sarcophagus")
%Dialogue.show_text("Hello world!").dismiss_after(2)
func refresh_dash(new_dashes):
if new_dashes:
+11 -4
View File
@@ -18,6 +18,7 @@
[ext_resource type="Script" uid="uid://d3rx82psovcpp" path="res://music_button.gd" id="14_70uel"]
[ext_resource type="Script" uid="uid://oyyhhy1gemg0" path="res://objectives_label.gd" id="14_ikiii"]
[ext_resource type="PackedScene" uid="uid://dr8h8xij3qw2h" path="res://pharaoh.tscn" id="15_hiqwa"]
[ext_resource type="PackedScene" uid="uid://bla1cfndgad0" path="res://Dialogue.tscn" id="19_26xuy"]
[ext_resource type="PackedScene" uid="uid://bcu7ftukipiyy" path="res://OldComputer.tscn" id="19_cbp6q"]
[node name="World" type="Node2D" unique_id=1327991900]
@@ -406,8 +407,9 @@ script = ExtResource("3_wse8f")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 605.0
offset_bottom = 274.0
offset_top = 586.0
offset_right = -1097.0
offset_bottom = 2.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
@@ -434,12 +436,17 @@ texture_pressed = ExtResource("13_70uel")
texture_disabled = ExtResource("13_70uel")
script = ExtResource("14_70uel")
[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")]
[node name="Dialogue" parent="CanvasLayer" unique_id=1025022375 instance=ExtResource("19_26xuy")]
unique_name_in_owner = true
offset_left = 228.0
offset_top = 499.0
offset_right = 231.0
offset_bottom = 491.0
[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")]
position = Vector2(192, 177.23824)
[node name="Pharaoh2" parent="." unique_id=1541178727 instance=ExtResource("15_hiqwa")]
unique_name_in_owner = true
position = Vector2(6338, -58.09474)
[node name="OldComputer" parent="." unique_id=1951254108 instance=ExtResource("19_cbp6q")]