Almanach
This commit is contained in:
parent
008fa31dd4
commit
b932e82555
39 changed files with 575 additions and 78 deletions
36
scripts/components/gui/almanach/AlmanachGrid.cs
Normal file
36
scripts/components/gui/almanach/AlmanachGrid.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Godot;
|
||||
using Newlon.Components.GUI.Seedpackets;
|
||||
|
||||
public partial class AlmanachGrid : GridContainer
|
||||
{
|
||||
private PackedScene _plantCard;
|
||||
[Export]
|
||||
private bool _zombies;
|
||||
public override void _Ready()
|
||||
{
|
||||
_plantCard = ResourceLoader.Load<PackedScene>("res://scenes/gui/seedpacket.tscn");
|
||||
|
||||
if (_zombies)
|
||||
{
|
||||
foreach (var resource in GameRegistry.GetZombies())
|
||||
{
|
||||
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
|
||||
AddChild(slot);
|
||||
|
||||
slot.SetResource(resource);
|
||||
slot.SetHandler(new AlmanachHandler(slot));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var resource in GameRegistry.GetPlants())
|
||||
{
|
||||
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
|
||||
AddChild(slot);
|
||||
|
||||
slot.SetResource(resource);
|
||||
slot.SetHandler(new AlmanachHandler(slot));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
scripts/components/gui/almanach/AlmanachGrid.cs.uid
Normal file
1
scripts/components/gui/almanach/AlmanachGrid.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://0mvmfvwe1bc7
|
||||
Loading…
Add table
Add a link
Reference in a new issue