forked from xiangwang25/whale-town-front-v2
Initial WhaleTown V2 frontend
This commit is contained in:
19
scenes/prefabs/items/NoticeBoard.gd
Normal file
19
scenes/prefabs/items/NoticeBoard.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user