Starting an inventory manager

This commit is contained in:
2026-04-20 11:41:22 +02:00
parent f9ca56e34a
commit 667d6b2588
9 changed files with 57 additions and 20 deletions

View File

@@ -1,11 +1,10 @@
using Godot;
using Movementtests.managers;
using Movementtests.systems;
[Tool, GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png")]
public partial class Inventory : Control
public partial class InventoryUI : Control
{
public PlayerController? Player { get; set; }
private AbilitySelection _startedFlyingSelection;
private AbilitySelection _whileFlyingSelection;
private AbilitySelection _stoppedFlyingSelection;
@@ -22,7 +21,6 @@ public partial class Inventory : Control
public void AddAbilityForEvent(WeaponSystem.WeaponEvent forEvent, string abilityName)
{
if (Player is null) return;
Player.GrantWeaponExplosionAbilityForEvent(forEvent, abilityName);
InventoryManager.Instance.AddAbilityForWeaponEvent(forEvent, abilityName);
}
}

View File

@@ -3,13 +3,10 @@
class_name InventoryWrapper
extends OverlaidMenu
@export var player: PlayerController
@onready var inventory: Control = %Inventory
func _ready() -> void:
if Engine.is_editor_hint(): return
inventory.Player = player
func _on_close_button_pressed() -> void:
close()