summaryrefslogtreecommitdiff
path: root/scripts/input/InventoryInputHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/input/InventoryInputHandler.cs')
-rw-r--r--scripts/input/InventoryInputHandler.cs65
1 files changed, 0 insertions, 65 deletions
diff --git a/scripts/input/InventoryInputHandler.cs b/scripts/input/InventoryInputHandler.cs
deleted file mode 100644
index 98f8576..0000000
--- a/scripts/input/InventoryInputHandler.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using Godot;
-
-public partial class InventoryInputHandler : BaseInputHandler
-{
- private static readonly PackedScene inventoryScene = GD.Load<PackedScene>("res://scenes/GUI/invetory_menu.tscn");
-
- private InventoryMenu inventoryMenu;
-
- ConsumableItem activationItem = null;
- ConsumableItem dropItem = null;
-
- [Export]
- private Map map;
-
- public override void Enter() {
- inventoryMenu = inventoryScene.Instantiate<InventoryMenu>();
- map.Map_Data.Player.AddChild(inventoryMenu);
- inventoryMenu.Initialize(map.Map_Data.Player.inventory);
- inventoryMenu.ItemSelected += OnItemActivate;
- inventoryMenu.ItemDrop += OnItemDrop;
- }
-
- public override void Exit() {
- activationItem = null;
- dropItem = null;
- inventoryMenu.QueueFree();
- }
-
- public override Action GetAction(Player player)
- {
- Action action = null;
-
- if (activationItem != null) {
- action = new ItemAction(player, activationItem);
- Close();
- }
-
- if (dropItem != null) {
- action = new DropAction(player, dropItem);
- Close();
- }
-
- if (Input.IsActionJustPressed("quit")) {
- Close();
- }
-
- return action;
- }
-
- private void Close() {
- GetParent<InputHandler>().SetInputHandler(InputHandlers.MainGame);
- }
-
- private void ActivateItem() {
-
- }
-
- private void OnItemActivate(ConsumableItem item) {
- activationItem = item;
- }
-
- private void OnItemDrop(ConsumableItem item) {
- dropItem = item;
- }
-} \ No newline at end of file