diff --git a/Zennysoft.Game.Ma/src/player/Player.cs b/Zennysoft.Game.Ma/src/player/Player.cs index a492f91a..ff87aa38 100644 --- a/Zennysoft.Game.Ma/src/player/Player.cs +++ b/Zennysoft.Game.Ma/src/player/Player.cs @@ -102,6 +102,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide private bool _healthTimerActive = true; + private bool _debugSprint = false; + private float _knockbackStrength = 0.0f; private Vector3 _knockbackDirection = Vector3.Zero; @@ -242,9 +244,9 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide if (@event.IsActionPressed(GameInputs.Attack)) Attack(); if (@event.IsActionPressed(GameInputs.Sprint)) - Settings.MoveSpeed *= 2; - if (@event.IsActionReleased(GameInputs.Sprint)) - Settings.MoveSpeed /= 2; + _debugSprint = true; + else if (@event.IsActionReleased(GameInputs.Sprint)) + _debugSprint = false; } public void PlayTestAnimation() @@ -350,6 +352,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide transform.Basis = new Basis(Vector3.Up, Settings.RotationSpeed * -rawInput.X * delta) * transform.Basis; var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z).Normalized(); var velocity = Basis * moveDirection * Settings.MoveSpeed * Settings.Acceleration; + if (_debugSprint) + velocity *= 2; _knockbackStrength *= 0.9f; Transform = Transform with { Basis = transform.Basis }; Velocity = velocity + (_knockbackDirection * _knockbackStrength); diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs index 380172f2..c0721824 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/InventoryMenu.cs @@ -60,12 +60,6 @@ public partial class InventoryMenu : Control, IInventoryMenu private IItemSlot _currentlySelectedItem = null; private bool _enableMenuSound = false; - public override void _EnterTree() - { - SetProcessInput(false); - SetProcessUnhandledInput(false); - } - public void OnResolved() { ItemSlots = [ItemSlot1, ItemSlot2, ItemSlot3, ItemSlot4, ItemSlot5, ItemSlot6, ItemSlot7, ItemSlot8, ItemSlot9, ItemSlot10, ItemSlot11, ItemSlot12, ItemSlot13, ItemSlot14, ItemSlot15, ItemSlot16, ItemSlot17, ItemSlot18, ItemSlot19, ItemSlot20]; @@ -93,6 +87,7 @@ public partial class InventoryMenu : Control, IInventoryMenu DropButton.FocusEntered += ActionButtonFocusChanged; VisibilityChanged += InventoryMenu_VisibilityChanged; + SetProcessUnhandledInput(false); } private void ActionButtonFocusChanged() diff --git a/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs b/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs index b76c8655..8a86ea74 100644 --- a/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs +++ b/Zennysoft.Game.Ma/src/ui/load_next_level/LoadNextLevel.cs @@ -62,12 +62,6 @@ public partial class LoadNextLevel : Control, IFloorClearMenu ExitButton.Pressed += ExitButton_Pressed; } - public override void _Input(InputEvent @event) - { - if (_fadingIn) - GetViewport().SetInputAsHandled(); - } - private void CurrentFloorNumber_Sync(int _) => FloorNumber.Text = _map.CurrentFloorNumber.Value.ToString("D2"); private void EquipmentComponent_EquipmentChanged(EquipableItem obj)