nice crooked connections und energy UI
This commit is contained in:
29
Gui.cs
29
Gui.cs
@@ -1,13 +1,38 @@
|
||||
using System.Globalization;
|
||||
using Godot;
|
||||
using NodeWar;
|
||||
using GodotUtilities;
|
||||
|
||||
namespace NodeWar;
|
||||
|
||||
[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()
|
||||
{
|
||||
_infoLabel = GetNode<Label>("%InfoLabel");
|
||||
_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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user