bottle service

This commit is contained in:
2023-02-05 21:29:38 +01:00
parent a0b7737b94
commit 9c156b2f8f
4 changed files with 92 additions and 7 deletions
+36
View File
@@ -0,0 +1,36 @@
extends CanvasLayer
@onready var bottle_service = $Control/BottleService
var timer = 0
const clear_time = 5
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func message(msg: String, title: String = ""):
var popup = RichTextLabel.new()
popup.custom_minimum_size = Vector2(200,100)
popup.threaded = true
popup.push_bold()
popup.append_text(title)
popup.pop()
popup.newline()
popup.append_text(msg)
var close = Button.new()
close.text = ""
close.size = Vector2(20, 31)
close.position = Vector2(175, 0)
close.pressed.connect(_on_close_pressed.bind(close))
popup.add_child(close)
bottle_service.add_child(popup)
timer = 0
func _process(delta):
timer += delta
func _on_bottle_service_child_entered_tree(node):
pass # Replace with function body.
func _on_close_pressed(node):
node.get_parent().queue_free()