Added Grant Blevins
This commit is contained in:
18
client/Scripts/Component/Interactable.gd
Normal file
18
client/Scripts/Component/Interactable.gd
Normal file
@ -0,0 +1,18 @@
|
||||
extends Area2D
|
||||
|
||||
signal interacted
|
||||
|
||||
func _ready():
|
||||
connect("body_entered", self, "_on_body_enter")
|
||||
connect("body_exited", self, "_on_body_exit")
|
||||
|
||||
func _on_body_enter(body):
|
||||
if body.has_method("add_interactable"):
|
||||
body.add_interactable(self)
|
||||
|
||||
func _on_body_exit(body):
|
||||
if body.has_method("remove_interactable"):
|
||||
body.remove_interactable(self)
|
||||
|
||||
func interact():
|
||||
emit_signal("interacted")
|
@ -30,11 +30,11 @@ func start_dialog(record : String):
|
||||
|
||||
func start_dialog_did(dialog_id : int):
|
||||
gui = get_node("/root/World/GUI")
|
||||
|
||||
nid = 1
|
||||
did = dialog_id
|
||||
|
||||
process_message(story_reader.get_text(did, nid))
|
||||
if not gui.is_in_dialog():
|
||||
nid = 1
|
||||
did = dialog_id
|
||||
|
||||
process_message(story_reader.get_text(did, nid))
|
||||
|
||||
func has_next_node():
|
||||
return story_reader.has_slot(did, nid, 0)
|
||||
|
Reference in New Issue
Block a user