Made dialog a separate view

This commit is contained in:
2024-06-24 12:04:29 -07:00
parent 89b82333bb
commit 223b4aa1dc
7 changed files with 1568 additions and 67 deletions

View File

@@ -26,13 +26,15 @@ class Say:
var text
var subject : Node2D = null
var done = false
var stop = true
var started = false
var t
func step_type():
return "Say " + text
func init(scene):
super(scene)
subject.play_animation("talk", 0)
#subject.play_animation("talk", 0)
func do(delta):
if !started:
@@ -43,15 +45,18 @@ class Say:
subject.add_child(t)
var label: Label = subject.find_child("talk-label")
label.set_text(text)
subject.find_child("label-root").show()
print ("SHOWING")
#label.set_text(text)
#subject.find_child("label-root").show()
await scene.find_child("dialogue").say(text)
print ("SHOWING" + text)
await t.timeout
print ("HIDING")
print ("HIDING" + text)
subject.remove_child(t)
subject.find_child("label-root").hide()
subject.stop_animation()
subject.play_animation_raw("idle_" + subject.facing)
if stop:
await scene.find_child("dialogue").done_say()
#subject.find_child("label-root").hide()
#subject.stop_animation()
#subject.play_animation_raw("idle_" + subject.facing)
done = true
started = true
@@ -327,10 +332,11 @@ func walk_path(subject, path):
walk_to.path = path
return walk_to
func say(subject, text):
func say(subject, text, stop=true):
var say = Say.new()
say.subject = subject
say.text = text
say.stop = stop
return say
func walk_to_deferred(named_from, named_to):