Untitled

Anonymous
plain_text
02/23/2026 6:49 PM
1.1 KB
8
Indexable
# -------------------------------------------------
# Post-reward reinteraction helper (drop into any scene)
# -------------------------------------------------
var _reinteract_lock := false

func _show_reinteraction_line(speaker: String, text: String, portrait: Texture2D) -> void:
	if _reinteract_lock:
		return
	_reinteract_lock = true

	if player != null:
		player.set_can_move(false)

	if dialogue_ui != null:
		dialogue_ui.show_dialogue(speaker, text, portrait, [])

		# Wait until typewriter finishes (E can speed it up via DialogueUI)
		while dialogue_ui != null and dialogue_ui.is_typing():
			await get_tree().process_frame

		# Now wait for the dialogue to be closed (E closes it in your DialogueUI)
		while dialogue_ui != null and dialogue_ui.is_open():
			await get_tree().process_frame

	if player != null:
		player.set_can_move(true)

	_reinteract_lock = false
Editor is loading...
Leave a Comment