refactor: enhance GameStateStore integration and improve skill management
This commit is contained in:
@@ -12,12 +12,7 @@ public partial class Hud : Control
|
||||
[Export] public ProgressBar HealthBar { get; set; }
|
||||
[Export] public Label LivesLabel { get; set; }
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = GameManager.Instance;
|
||||
}
|
||||
private GameStateStore Store => GameStateStore.Instance;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
@@ -28,12 +23,12 @@ public partial class Hud : Control
|
||||
|
||||
private void SetCoinsLabel()
|
||||
{
|
||||
CoinsLabel.Text = Tr("COINS_LABEL") + ": " + _gameManager.GetCoins();
|
||||
CoinsLabel.Text = Tr("COINS_LABEL") + ": " + (Store?.GetTotalCoins() ?? 0);
|
||||
}
|
||||
|
||||
private void SetLivesLabel()
|
||||
{
|
||||
LivesLabel.Text = Tr("LIVES_LABEL") + ": " + _gameManager.GetLives();
|
||||
LivesLabel.Text = Tr("LIVES_LABEL") + ": " + (Store?.Player.Lives ?? 0);
|
||||
}
|
||||
|
||||
private void SetHealthBar()
|
||||
|
||||
Reference in New Issue
Block a user