Gamepad support

This commit is contained in:
Rendo 2025-07-28 05:07:37 +05:00
commit ed369cf718
24 changed files with 240 additions and 78 deletions

View file

@ -22,9 +22,11 @@ public partial class GridLoader : GridContainer
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
AddChild(slot);
slot.SetResource(resource);
slot.SetForbidden(RuntimeLevelData.LevelResource.forbiddenPlants.Contains(resource.internal_id));
slot.SetLocked(PlayerProgress.Instance.PlayerPlants.Contains(resource) == false);
if (GetChildCount() == 1) slot.GrabFocus();
var handler = new ChoosableHandler(slot);
slot.SetHandler(handler);
}

View file

@ -1,4 +1,5 @@
using Godot;
using Newlon.Components.GUI.Seedpackets;
using Newlon.Components.Level;
namespace Newlon.Components.GUI;
@ -8,5 +9,6 @@ public partial class LevelRunButton : Button
public override void _Pressed()
{
RuntimeLevelData.Instance.SetLevelState(RuntimeLevelData.LevelStates.Pregame);
LevelGUIElements.Instance.SeedpacketsHotbar.GetChild<Seedpacket>(0).GrabFocus();
}
}