Added mapping tool, reworked scene structure, and added test data.

This commit is contained in:
2026-09-06 16:50:32 -07:00
parent ab632f455d
commit a7ba813c81
20 changed files with 350 additions and 12 deletions
+18
View File
@@ -1,7 +1,25 @@
extends Resource
class_name DialogueScene
static var baseLoc : String= "res://dialogue/resources/"
@export var dialogue: Array[Dialogue]
func get_scene() -> Array[Dialogue]:
return self.dialogue
func _init(dia : Array[Dialogue]) -> void:
dialogue = dia
static func load_dict(dict : Dictionary) -> DialogueScene:
var dia : Array[Dialogue]= []
for d :Dictionary in dict["d"]:
dia.append(Dialogue.load_dict(d))
return new(dia)
static func load_scene(loc: String) -> DialogueScene:
var f = FileAccess.open(baseLoc + loc, FileAccess.READ)
if f != null:
var ret = DialogueScene.load_dict(JSON.parse_string(f.get_as_text()))
f.close()
return ret
return null