You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
641 B

  1. extends Control
  2. func _ready():
  3. # $ChoicesBox.hide()
  4. # $LogPanel.hide()
  5. on_dialogue_start()
  6. $YarnRunner.say_func = funcref(self, "on_new_line")
  7. $YarnRunner.choices_func = funcref(self, "on_choices")
  8. yield($YarnRunner.run_all(), "completed")
  9. on_dialogue_end()
  10. func on_dialogue_start():
  11. $LogPanel.show()
  12. $ChoicesBox.show()
  13. $LogPanel.clear()
  14. $ChoicesBox.clear()
  15. func on_new_line(line):
  16. yield($LogPanel.on_new_line(line["text"]), "completed")
  17. func on_choices(choices_list):
  18. print(choices_list)
  19. return yield($ChoicesBox.on_choices(choices_list), "completed")
  20. func on_dialogue_end():
  21. pass
  22. # $ChoicesBox.hide()
  23. # $LogPanel.hide()