summaryrefslogtreecommitdiff
path: root/scripts/GUI/LeaderboardItem.cs
blob: c05bf58718dfaef2332060d608bd169a66594553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Godot;

namespace TheLegendOfGustav.GUI;

public partial class LeaderboardItem : HBoxContainer
{
	[Export]
	public string PlayerName { get; set; } = "Jogador";
	[Export]
	public string Floor { get; set; } = "Andar Máximo";
	[Export]
	public string Kills { get; set; } = "Inimigos Mortos";
	[Export]
	public string Damage { get; set; } = "Dano tomado";

	private Label nameLabel;
	private Label floorLabel;
	private Label killsLabel;
	private Label damageLabel;


	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		nameLabel = GetNode<Label>("hdNome");
		floorLabel = GetNode<Label>("hdAndar");
		killsLabel = GetNode<Label>("hdkills");
		damageLabel = GetNode<Label>("hddamage");


		UpdateLabels();
	}

	public void UpdateLabels()
	{
		nameLabel.Text = PlayerName;
		floorLabel.Text = Floor;
		killsLabel.Text = Kills;
		damageLabel.Text = Damage;
	}
}