Made a menu to select abilities and grant them (with a few hardcoded stuff)
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

This commit is contained in:
2026-04-19 11:37:55 +02:00
parent 9464fc7caa
commit 5a59d50be5
12 changed files with 164 additions and 114 deletions

View File

@@ -1,10 +1,28 @@
using Godot;
using Movementtests.systems;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png")]
[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);
}
}