diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 12:46:30 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 12:46:30 -0300 |
| commit | fbc055308f093a6527781cb16ce896ac253219ab (patch) | |
| tree | d63357f7281784e03a12483fdd898a11293d8aa5 /scripts/input/InspectInputHandler.cs | |
| parent | 6842ccfd372601db6b5d3f678ab5ebf03ad2b206 (diff) | |
Modificado inspetor
Diffstat (limited to 'scripts/input/InspectInputHandler.cs')
| -rw-r--r-- | scripts/input/InspectInputHandler.cs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/input/InspectInputHandler.cs b/scripts/input/InspectInputHandler.cs index 60c10e4..ad76c62 100644 --- a/scripts/input/InspectInputHandler.cs +++ b/scripts/input/InspectInputHandler.cs @@ -5,6 +5,8 @@ using Godot; /// </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}, @@ -25,21 +27,18 @@ public partial class InspectInputHandler : BaseInputHandler private Inspector inspector; public override void Enter() { - inspector = new(map.Map_Data.Player.GridPosition) - { - ZIndex = 4 - }; - // Copiamos a câmera do jogador com todas as suas configurações - Camera2D camera = (Camera2D) map.Map_Data.Player.GetNode<Camera2D>("Camera2D").Duplicate(); - inspector.AddChild(camera); + SignalBus.Instance.EmitSignal(SignalBus.SignalName.EnterInspectionMode); + inspector = InspectorScene.Instantiate<Inspector>(); + + inspector.GridPosition = map.Map_Data.Player.GridPosition; map.AddChild(inspector); - camera.Enabled = true; - camera.MakeCurrent(); } public override void Exit() { inspector.QueueFree(); + + SignalBus.Instance.EmitSignal(SignalBus.SignalName.ExitInspectionMode); } public override Action GetAction(Player player) { |
