Made a menu to select abilities and grant them (with a few hardcoded stuff)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user