23 lines
508 B
GDScript
23 lines
508 B
GDScript
extends Control
|
|
class_name DialogueBox
|
|
|
|
signal DialogueStarted
|
|
signal DialogueEnded
|
|
|
|
@onready var label: Label = $ColorRect/MarginContainer/Label
|
|
|
|
# Public Methods
|
|
func OnDialogueTriggered(dialogue_name: String) -> void:
|
|
label.text = tr(dialogue_name)
|
|
visible = true
|
|
DialogueStarted.emit()
|
|
|
|
|
|
func _process(_delta: float) -> void:
|
|
if !visible:
|
|
return
|
|
|
|
if Input.is_action_just_pressed("player_interact") and !InputManager.ShouldIgnoreAction("player_interact"):
|
|
visible = false
|
|
DialogueEnded.emit()
|