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.
 
 

26 lines
632 B

  1. extends BasisInteraction
  2. class_name TalkInteraction
  3. var is_talking = false
  4. export var yarnScript : Resource
  5. var yarnRunner := YarnRunner.new()
  6. func on_interact():
  7. if not is_talking:
  8. yarnRunner.say_func = funcref(Controller.speech_panel.text, "on_new_line")
  9. yarnRunner.choices_func = funcref(Controller.speech_panel.choices, "on_choices")
  10. yarnRunner.yarnScript = self.yarnScript
  11. is_talking = true
  12. Controller.speech_panel.show()
  13. Controller.player_input_enabled = false
  14. yield(yarnRunner.run_all(), "completed")
  15. Controller.player_input_enabled = true
  16. Controller.speech_panel.hide()
  17. is_talking = false