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("%StartedFlying"); _whileFlyingSelection = GetNode("%WhileFlying"); _stoppedFlyingSelection = GetNode("%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); } }