Lockable seeds
This commit is contained in:
parent
e03658e727
commit
a4c58bb245
19 changed files with 405 additions and 61 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Godot;
|
||||
using Newlon.Components.GUI.Seedpackets;
|
||||
using Newlon.Components.Level;
|
||||
|
||||
namespace Newlon.Components.GUI;
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ public partial class GridLoader : GridContainer
|
|||
{
|
||||
_plantCard = ResourceLoader.Load<PackedScene>(SEEDPACKED_UID);
|
||||
|
||||
var list = PlayerProgress.Instance.PlayerPlants;
|
||||
var list = GameRegistry.GetPlants();
|
||||
list.Sort((a, b) =>
|
||||
{
|
||||
return a.Order - b.Order;
|
||||
|
|
@ -22,7 +23,10 @@ public partial class GridLoader : GridContainer
|
|||
AddChild(slot);
|
||||
|
||||
slot.SetResource(resource);
|
||||
slot.SetHandler(new ChoosableHandler(slot));
|
||||
slot.SetForbidden(RuntimeLevelData.LevelResource.forbiddenPlants.Contains(resource.internal_id));
|
||||
slot.SetLocked(PlayerProgress.Instance.PlayerPlants.Contains(resource) == false);
|
||||
var handler = new ChoosableHandler(slot);
|
||||
slot.SetHandler(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue