summaryrefslogtreecommitdiff
path: root/scripts/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Utils')
-rw-r--r--scripts/Utils/SignalBus.cs25
-rw-r--r--scripts/Utils/SignalBus.cs.uid1
2 files changed, 26 insertions, 0 deletions
diff --git a/scripts/Utils/SignalBus.cs b/scripts/Utils/SignalBus.cs
new file mode 100644
index 0000000..7408db2
--- /dev/null
+++ b/scripts/Utils/SignalBus.cs
@@ -0,0 +1,25 @@
+using Godot;
+using System;
+
+/// <summary>
+/// Objeto global com sinais, fortes sinais.
+/// </summary>
+public partial class SignalBus : Node
+{
+ /// <summary>
+ /// Pois é.
+ /// </summary>
+ public static SignalBus Instance { get; private set; }
+
+ public override void _Ready()
+ {
+ base._Ready();
+ Instance = this;
+ }
+ /// <summary>
+ /// Acionado sempre que uma mensagem for adicionada para o log.
+ /// </summary>
+ /// <param name="text">Mensagem.</param>
+ [Signal]
+ public delegate void messageSentEventHandler(string text);
+}
diff --git a/scripts/Utils/SignalBus.cs.uid b/scripts/Utils/SignalBus.cs.uid
new file mode 100644
index 0000000..cc03c87
--- /dev/null
+++ b/scripts/Utils/SignalBus.cs.uid
@@ -0,0 +1 @@
+uid://dmn16je604itc