basic Party Manager
This commit is contained in:
parent
c141e6a169
commit
6f1d5ea681
10 changed files with 158 additions and 8 deletions
22
scripts/ui/PartyHUD.cs
Normal file
22
scripts/ui/PartyHUD.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue