22 lines
573 B
C#
22 lines
573 B
C#
using Godot;
|
|
using System.Linq;
|
|
|
|
public partial class PartyHUD : CanvasLayer
|
|
{
|
|
[Export] public NodePath PartyManagerPath { get; set; }
|
|
private PartyManager? _party;
|
|
private Label _label = null!;
|
|
|
|
public override void _Ready()
|
|
{
|
|
_label = GetNode<Label>("PartyLabel");
|
|
_party = GetNodeOrNull<PartyManager>(PartyManagerPath);
|
|
if (_party == null) GD.PrintErr("PartyHUD: PartyManagerPath not set.");
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (_party == null) return;
|
|
_label.Text = "Party: " + string.Join(", ", _party.PartyCreatureIds.Take(6));
|
|
}
|
|
}
|