added a talking rock

This commit is contained in:
2024-09-07 14:12:04 -04:00
parent 1573768619
commit 55a291e2ae
79 changed files with 14358 additions and 17 deletions

9
Scripts/actionable.gd Normal file
View File

@@ -0,0 +1,9 @@
extends Area2D
@export var dialouge_res: DialogueResource
@export var dialouge_start: String = "start"
func action() -> void:
DialogueManager.show_example_dialogue_balloon(dialouge_res, dialouge_start)

21
Scripts/dialouge.gd Normal file
View File

@@ -0,0 +1,21 @@
extends CanvasLayer
@export(String, FILE, "*.json",) var d_file
var dia = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
start()
func start():
dia = load_dialouge()
$NinePatchRect/Title.text = dia[0]['name']
$NinePatchRect/Title.text = dia[0]['text']
func load_dialouge():
var file = file.new()
if file.file_exists(d_file):
file.open(d_file, file.READ)
return parse_json(file.get_as_text())