Created EventManager

This will be a class to handle events, such as custom events implemented
in GDScript/Chat Commands, as well as Twitch Events, such as Raids,
Shoutouts, etc, etc.
This commit is contained in:
Mario Steele 2026-02-28 02:55:51 -06:00
parent 491bc94c0d
commit 3f887a4e0e
2 changed files with 30 additions and 0 deletions

29
lib/event_manager.gd Normal file
View file

@ -0,0 +1,29 @@
extends Node
var ol: OverlayWindow
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
ol = get_tree().root.get_node("MainWin")
func test_notification(msg: String) -> void:
var lbl = Label.new()
lbl.label_settings = LabelSettings.new()
lbl.label_settings.font_size = 75
lbl.label_settings.font_color = Color.DODGER_BLUE
lbl.text = msg
lbl.modulate.a = 0
lbl.ready.connect(func() -> void:
var half: Vector2 = lbl.size / 2
lbl.position = Vector2(get_tree().root.size / 2) - half
var tw := create_tween()
tw.tween_property(lbl, "modulate:a", 1.0, 0.5)
tw.tween_interval(2.5)
tw.parallel().tween_property(lbl, "position:y", get_tree().root.size.y + 10, 3.0)
tw.parallel().tween_property(lbl, "modulate:a", 0, 3.0)
await tw.finished
lbl.queue_free()
)
add_child(lbl)

1
lib/event_manager.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://cvjhecj1me4xl