20 lines
604 B
GDScript
20 lines
604 B
GDScript
extends Area2D
|
|
|
|
@export var Address : String
|
|
@onready var Dialogue : Control = $Dialogue
|
|
|
|
@onready var InteractibleManager = $InteractibleManager
|
|
|
|
var Player : Node2D
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
Dialogue.DialogueLabel.text = Address
|
|
Player = get_tree().get_first_node_in_group("player")
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
if Input.is_action_pressed("interact") and InteractibleManager.selected and Player.ActiveContract == self:
|
|
Player.ActiveContract = null
|