beta-1.0
This commit is contained in:
22
Scripts/UI/dialogue_box.gd
Normal file
22
Scripts/UI/dialogue_box.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user