forked from harper/spooktober-vnj
Added mapping tool, reworked scene structure, and added test data.
This commit is contained in:
@@ -2,5 +2,17 @@ extends Resource
|
||||
class_name Dialogue
|
||||
|
||||
@export var character: Character
|
||||
@export_multiline() var dialogue: String
|
||||
@export_multiline() var dialogue_str: String
|
||||
@export var choices: Array[Choice]
|
||||
|
||||
func _init(chr : String, str1:String, choices1:Array[Choice]):
|
||||
# there's probably a better way to do this but idk yet
|
||||
character = load("res://characters/"+chr+".tres")
|
||||
dialogue_str = str1
|
||||
choices = choices1
|
||||
|
||||
static func load_dict(dict: Dictionary) -> Dialogue:
|
||||
var chs : Array[Choice] = []
|
||||
for ch : Dictionary in dict["chs"]:
|
||||
chs.append(Choice.load_dict(ch))
|
||||
return new(dict["chr"], dict["d"], chs)
|
||||
|
||||
Reference in New Issue
Block a user