diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
| commit | c6bbb834f7758027c0df338f1520f34fad3befea (patch) | |
| tree | 1818cd23c24be16fbe19b16dd0a510874d440d83 /scripts/input/InspectInputHandler.cs | |
| parent | f1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (diff) | |
Organização
Diffstat (limited to 'scripts/input/InspectInputHandler.cs')
| -rw-r--r-- | scripts/input/InspectInputHandler.cs | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/scripts/input/InspectInputHandler.cs b/scripts/input/InspectInputHandler.cs deleted file mode 100644 index ad76c62..0000000 --- a/scripts/input/InspectInputHandler.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Godot; - -/// <summary> -/// TODO: Esta solução é nojenta e precisa ser retrabalhada. -/// </summary> -public partial class InspectInputHandler : BaseInputHandler -{ - private static readonly PackedScene InspectorScene = GD.Load<PackedScene>("res://scenes/Inspector.tscn"); - - private readonly Godot.Collections.Dictionary<string, Vector2I> directions = new() - { - {"walk-up", Vector2I.Up}, - {"walk-down", Vector2I.Down}, - {"walk-left", Vector2I.Left}, - {"walk-right", Vector2I.Right}, - {"walk-up-right", Vector2I.Up + Vector2I.Right}, - {"walk-up-left", Vector2I.Up + Vector2I.Left}, - {"walk-down-right", Vector2I.Down + Vector2I.Right}, - {"walk-down-left", Vector2I.Down + Vector2I.Left}, - }; - /// <summary> - /// Preciso disso - /// </summary> - [Export] - private Map map; - - private Inspector inspector; - - public override void Enter() { - SignalBus.Instance.EmitSignal(SignalBus.SignalName.EnterInspectionMode); - inspector = InspectorScene.Instantiate<Inspector>(); - - inspector.GridPosition = map.Map_Data.Player.GridPosition; - - map.AddChild(inspector); - } - - public override void Exit() { - inspector.QueueFree(); - - SignalBus.Instance.EmitSignal(SignalBus.SignalName.ExitInspectionMode); - } - public override Action GetAction(Player player) - { - Action action = null; - foreach (var direction in directions) { - if (Input.IsActionJustPressed(direction.Key)) { - inspector.Walk(direction.Value); - } - } - - if (Input.IsActionJustPressed("quit")) { - GetParent<InputHandler>().SetInputHandler(InputHandlers.MainGame); - } - - return action; - } -}
\ No newline at end of file |
