Files
whale-town-front-v2/scenes/prefabs/items/NoticeBoard.gd

20 lines
528 B
GDScript

extends Area2D
class_name NoticeBoard
const NOTICE_DIALOG_SCENE: PackedScene = preload("res://scenes/ui/notice_dialog.tscn")
const NOTICE_DIALOG_NAME: String = "NoticeDialog"
const INTERACTION_COLLISION_LAYER: int = 2
func _ready() -> void:
collision_layer = INTERACTION_COLLISION_LAYER
collision_mask = 0
func interact() -> void:
var root: Window = get_tree().root
if root.has_node(NOTICE_DIALOG_NAME):
return
var dialog := NOTICE_DIALOG_SCENE.instantiate()
dialog.name = NOTICE_DIALOG_NAME
root.add_child(dialog)