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
+25 -1
View File
@@ -2,4 +2,28 @@ extends Resource
class_name Choice
@export var response: String
@export var scene: DialogueScene
@export var targets: Array[ChoiceTarget]
func get_target()->DialogueScene:
for target : ChoiceTarget in targets:
if target.condition_events.is_empty():
if !target.target_event.is_empty():
Game.log_event_data(target.target_event)
return target.target_scene
if Game.has_all_events_data(target.condition_events):
if !target.target_event.is_empty():
Game.log_event_data(target.target_event)
return target.target_scene
print(error_string(ERR_INVALID_PARAMETER) +
" in Choice.get_target(), check that there is a target with an empty condition_events in targets")
return null
func _init(str1 : String, targs : Array[ChoiceTarget]):
response = str1
targets = targs
static func load_dict(dict : Dictionary) -> Choice:
var ts : Array[ChoiceTarget] = []
for tar : Dictionary in dict["t"]:
ts.append(ChoiceTarget.load_dict(tar))
return new(dict["r"], ts)