Files
MovementTests/menus/scenes/overlaid_menus/Inventory.cs
Minimata 5a59d50be5
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 26s
Create tag and build when new code gets to main / Export (push) Successful in 6m13s
Made a menu to select abilities and grant them (with a few hardcoded stuff)
2026-04-19 11:37:55 +02:00

29 lines
1.1 KiB
C#

using Godot;
using Movementtests.systems;
[Tool, GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png")]
public partial class Inventory : Control
{
public PlayerController? Player { get; set; }
private AbilitySelection _startedFlyingSelection;
private AbilitySelection _whileFlyingSelection;
private AbilitySelection _stoppedFlyingSelection;
public override void _Ready()
{
_startedFlyingSelection = GetNode<AbilitySelection>("%StartedFlying");
_whileFlyingSelection = GetNode<AbilitySelection>("%WhileFlying");
_stoppedFlyingSelection = GetNode<AbilitySelection>("%StoppedFlying");
_startedFlyingSelection.AbilityAdded += AddAbilityForEvent;
_whileFlyingSelection.AbilityAdded += AddAbilityForEvent;
_stoppedFlyingSelection.AbilityAdded += AddAbilityForEvent;
}
public void AddAbilityForEvent(WeaponSystem.WeaponEvent forEvent, string abilityName)
{
if (Player is null) return;
Player.GrantWeaponExplosionAbilityForEvent(forEvent, abilityName);
}
}