Add NotificationManager and NotificationLabel for age advancement notifications; refactor scripts into Components directory

This commit is contained in:
2025-08-23 04:54:45 +02:00
parent 5719c3f920
commit 9cf707945b
26 changed files with 96 additions and 68 deletions

View File

@@ -0,0 +1,20 @@
using Godot;
namespace ParasiticGod.Scripts;
[GlobalClass]
public partial class NotificationLabel : Label
{
public void ShowNotification(string text)
{
Text = text;
PivotOffset = Size / 2;
GlobalPosition = GetViewportRect().Size / 2;
var tween = CreateTween();
tween.TweenProperty(this, "modulate:a", 1.0f, 0.5f).From(0.0f);
tween.TweenInterval(2.5f);
tween.TweenProperty(this, "modulate:a", 0.0f, 1.0f);
tween.Finished += QueueFree;
}
}