refactor: enhance GameStateStore integration and improve skill management
This commit is contained in:
@@ -18,7 +18,7 @@ public partial class Marketplace : Control
|
||||
[Export] public PackedScene MarketplaceButtonScene { get; set; }
|
||||
[Export] public PackedScene SkillButtonScene { get; set; }
|
||||
|
||||
private GameManager GameManager => GameManager.Instance;
|
||||
private GameStateStore Store => GameStateStore.Instance;
|
||||
private SkillManager SkillManager => SkillManager.Instance;
|
||||
private readonly List<Button> _unlockButtons = [];
|
||||
private readonly List<SkillButton> _skillButtons = [];
|
||||
@@ -33,7 +33,7 @@ public partial class Marketplace : Control
|
||||
|
||||
foreach (var skill in skillsToUnlock) CreateUpgradeButton(skill);
|
||||
|
||||
var unlockedSkills = GameManager.GetUnlockedSkills();
|
||||
var unlockedSkills = Store.GetAllUnlockedSkills();
|
||||
foreach (var skill in unlockedSkills) CreateSkillButton(skill);
|
||||
|
||||
SkillUnlockerComponent.SkillUnlocked += OnSkillUnlocked;
|
||||
@@ -113,7 +113,7 @@ public partial class Marketplace : Control
|
||||
|
||||
private void OnUpgradeButtonPressed(SkillData skill)
|
||||
{
|
||||
if (GameManager.IsSkillUnlocked(skill))
|
||||
if (Store.IsSkillUnlocked(skill))
|
||||
{
|
||||
if (skill.Level < skill.MaxLevel)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user