This commit is contained in:
2026-05-31 14:36:07 +02:00
parent b4ac00dcdd
commit 69c941b0e1
41 changed files with 39 additions and 324 deletions

39
Scripts/Gui/Gui.cs Normal file
View File

@@ -0,0 +1,39 @@
using System.Globalization;
using Godot;
using GodotUtilities;
using NodeWar.Scripts.Globals;
namespace NodeWar.Scripts.Gui;
[Scene]
public partial class Gui : Control
{
[Node]
private Label _infoLabel;
[Node]
private Label _energyGeneration;
[Node]
private Label _energyConsumption;
[Node]
private Label _energyStorage;
public override void _Ready()
{
_energyGeneration.Text = 1f.ToString(CultureInfo.InvariantCulture);
_energyConsumption.Text = 0f.ToString(CultureInfo.InvariantCulture);
_energyStorage.Text = 100f.ToString(CultureInfo.InvariantCulture);
Autoloads.EventBus.SelectionChanged += text => _infoLabel.Text = text;
}
public override void _Notification(int what)
{
if (what == NotificationSceneInstantiated)
{
WireNodes();
}
}
}