refactor: enhance GameStateStore integration and improve skill management

This commit is contained in:
2026-03-19 02:33:07 +01:00
parent 3e36e48e97
commit eeefca4d4e
31 changed files with 260 additions and 419 deletions

View File

@@ -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()