summaryrefslogtreecommitdiff
path: root/scripts/InputHandling
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-18 12:06:59 -0300
commit5146895cf537dd69867da612abed5b4abaf805cd (patch)
tree70212352a07922b58db99ba2564f76ca072af200 /scripts/InputHandling
parenteacdd15612c70ff86f3446982c46a09272249936 (diff)
ME ELIMINE AAAAAAAAAAAAAAAAAAAAAAAAAAAA
Diffstat (limited to 'scripts/InputHandling')
-rw-r--r--scripts/InputHandling/InputHandler.cs30
-rw-r--r--scripts/InputHandling/InspectInputHandler.cs16
-rw-r--r--scripts/InputHandling/InventoryInputHandler.cs36
3 files changed, 41 insertions, 41 deletions
diff --git a/scripts/InputHandling/InputHandler.cs b/scripts/InputHandling/InputHandler.cs
index 3c39587..e230a01 100644
--- a/scripts/InputHandling/InputHandler.cs
+++ b/scripts/InputHandling/InputHandler.cs
@@ -23,38 +23,38 @@ public enum InputHandlers
public partial class InputHandler : Node
{
[Export]
- private InputHandlers StartingInputHandler { get; set; }
+ private InputHandlers startingInputHandler;
- private Godot.Collections.Dictionary<InputHandlers, BaseInputHandler> InputHandlerDict { get; set; } = [];
+ private Godot.Collections.Dictionary<InputHandlers, BaseInputHandler> inputHandlerDict = [];
- private BaseInputHandler SelectedInputHandler { get; set; }
+ private BaseInputHandler selectedInputHandler;
public override void _Ready()
{
base._Ready();
// Controles para quando o jogador está vivo e jogando normalmente.
- InputHandlerDict.Add(InputHandlers.MainGame, GetNode<MainGameInputHandler>("MainGameInputHandler"));
+ inputHandlerDict.Add(InputHandlers.MainGame, GetNode<MainGameInputHandler>("MainGameInputHandler"));
// Controles para quando o jogador está morto.
- InputHandlerDict.Add(InputHandlers.GameOver, GetNode<GameOverInputHandler>("GameOverInputHandler"));
+ inputHandlerDict.Add(InputHandlers.GameOver, GetNode<GameOverInputHandler>("GameOverInputHandler"));
// Controles para observar o cenário
- InputHandlerDict.Add(InputHandlers.Inspect, GetNode<InspectInputHandler>("InspectInputHandler"));
+ inputHandlerDict.Add(InputHandlers.Inspect, GetNode<InspectInputHandler>("InspectInputHandler"));
// Controles para pegar um item do chão.
- InputHandlerDict.Add(InputHandlers.Pickup, GetNode<PickupInputHandler>("PickupInputHandler"));
+ inputHandlerDict.Add(InputHandlers.Pickup, GetNode<PickupInputHandler>("PickupInputHandler"));
// Controles para quando o inventário for aberto.
- InputHandlerDict.Add(InputHandlers.Inventory, GetNode<InventoryInputHandler>("InventoryInputHandler"));
+ inputHandlerDict.Add(InputHandlers.Inventory, GetNode<InventoryInputHandler>("InventoryInputHandler"));
// Controles para quando o jogador precisar escolher um alvo de feitiço.
- InputHandlerDict.Add(InputHandlers.CastSpell, GetNode<CastSpellInputHandler>("CastSpellInputHandler"));
+ inputHandlerDict.Add(InputHandlers.CastSpell, GetNode<CastSpellInputHandler>("CastSpellInputHandler"));
// Controles para quando o menu de feitiços for aberto.
- InputHandlerDict.Add(InputHandlers.SpellMenu, GetNode<SpellMenuInputHandler>("SpellMenuInputHandler"));
+ inputHandlerDict.Add(InputHandlers.SpellMenu, GetNode<SpellMenuInputHandler>("SpellMenuInputHandler"));
- SetInputHandler(StartingInputHandler);
+ SetInputHandler(startingInputHandler);
SignalBus.Instance.CommandInputHandler += SetInputHandler;
}
public Action GetAction(Player player)
{
- return SelectedInputHandler.GetAction(player);
+ return selectedInputHandler.GetAction(player);
}
public override void _Notification(int what)
@@ -73,8 +73,8 @@ public partial class InputHandler : Node
/// <param name="inputhandler">Estado do jogo.</param>
public void SetInputHandler(InputHandlers inputhandler)
{
- SelectedInputHandler?.Exit();
- SelectedInputHandler = InputHandlerDict[inputhandler];
- SelectedInputHandler.Enter();
+ selectedInputHandler?.Exit();
+ selectedInputHandler = inputHandlerDict[inputhandler];
+ selectedInputHandler.Enter();
}
}
diff --git a/scripts/InputHandling/InspectInputHandler.cs b/scripts/InputHandling/InspectInputHandler.cs
index 90734f9..6e13c2f 100644
--- a/scripts/InputHandling/InspectInputHandler.cs
+++ b/scripts/InputHandling/InspectInputHandler.cs
@@ -10,7 +10,7 @@ namespace TheLegendOfGustav.InputHandling;
/// </summary>
public partial class InspectInputHandler : BaseInputHandler
{
- private static readonly PackedScene InspectorScene = GD.Load<PackedScene>("res://scenes/Inspector.tscn");
+ private static readonly PackedScene inspectorScene = GD.Load<PackedScene>("res://scenes/Inspector.tscn");
private static readonly Godot.Collections.Dictionary<string, Vector2I> directions = new()
{
@@ -28,23 +28,23 @@ public partial class InspectInputHandler : BaseInputHandler
/// Preciso disso
/// </summary>
[Export]
- private Map.Map Map { get; set; }
+ private Map.Map map;
- private Inspector Inspector { get; set; }
+ private Inspector inspector;
public override void Enter()
{
SignalBus.Instance.EmitSignal(SignalBus.SignalName.EnterInspectionMode);
- Inspector = InspectorScene.Instantiate<Inspector>();
+ inspector = inspectorScene.Instantiate<Inspector>();
- Inspector.GridPosition = Map.MapData.Player.GridPosition;
+ inspector.GridPosition = map.MapData.Player.GridPosition;
- Map.AddChild(Inspector);
+ map.AddChild(inspector);
}
public override void Exit()
{
- Inspector.QueueFree();
+ inspector.QueueFree();
SignalBus.Instance.EmitSignal(SignalBus.SignalName.ExitInspectionMode);
}
@@ -56,7 +56,7 @@ public partial class InspectInputHandler : BaseInputHandler
{
if (Input.IsActionJustPressed(direction.Key))
{
- Inspector.Walk(direction.Value);
+ inspector.Walk(direction.Value);
}
}
diff --git a/scripts/InputHandling/InventoryInputHandler.cs b/scripts/InputHandling/InventoryInputHandler.cs
index 390e545..1eb7f3a 100644
--- a/scripts/InputHandling/InventoryInputHandler.cs
+++ b/scripts/InputHandling/InventoryInputHandler.cs
@@ -12,41 +12,41 @@ public partial class InventoryInputHandler : BaseInputHandler
[Export]
- private Map.Map Map { get; set; }
+ private Map.Map map;
- private InventoryMenu InventoryMenu { get; set; }
- private ConsumableItem ActivationItem { get; set; } = null;
- private ConsumableItem DropItem { get; set; } = null;
+ private InventoryMenu inventoryMenu;
+ private ConsumableItem activationItem = null;
+ private ConsumableItem dropItem = null;
public override void Enter()
{
- InventoryMenu = inventoryScene.Instantiate<InventoryMenu>();
- Map.MapData.Player.AddChild(InventoryMenu);
- InventoryMenu.Initialize(Map.MapData.Player.Inventory);
- InventoryMenu.ItemSelected += OnItemActivate;
- InventoryMenu.ItemDrop += OnItemDrop;
+ inventoryMenu = inventoryScene.Instantiate<InventoryMenu>();
+ map.MapData.Player.AddChild(inventoryMenu);
+ inventoryMenu.Initialize(map.MapData.Player.Inventory);
+ inventoryMenu.ItemSelected += OnItemActivate;
+ inventoryMenu.ItemDrop += OnItemDrop;
}
public override void Exit()
{
- ActivationItem = null;
- DropItem = null;
- InventoryMenu.QueueFree();
+ activationItem = null;
+ dropItem = null;
+ inventoryMenu.QueueFree();
}
public override Action GetAction(Player player)
{
Action action = null;
- if (ActivationItem != null)
+ if (activationItem != null)
{
- action = new ItemAction(player, ActivationItem);
+ action = new ItemAction(player, activationItem);
Close();
}
- if (DropItem != null)
+ if (dropItem != null)
{
- action = new DropAction(player, DropItem);
+ action = new DropAction(player, dropItem);
Close();
}
@@ -65,11 +65,11 @@ public partial class InventoryInputHandler : BaseInputHandler
private void OnItemActivate(ConsumableItem item)
{
- ActivationItem = item;
+ activationItem = item;
}
private void OnItemDrop(ConsumableItem item)
{
- DropItem = item;
+ dropItem = item;
}
} \ No newline at end of file