diff --git a/Spectrum/Input/InputManager.cs b/Spectrum/Input/InputManager.cs index f10019b..88695c8 100644 --- a/Spectrum/Input/InputManager.cs +++ b/Spectrum/Input/InputManager.cs @@ -278,7 +278,7 @@ namespace Spectrum.Input _ = tcs.Task.ContinueWith(_ => { - try { ctr.Dispose(); } catch {} + try { ctr.Dispose(); } catch { } UnsubscribeMakcu(); }, TaskScheduler.Default); @@ -367,7 +367,8 @@ namespace Spectrum.Input { var states = MakcuMain.MakcuInstance.GetCurrentButtonStates(); return states.TryGetValue(makcuBtn, out var pressed) && pressed; - } catch {} + } + catch { } } return (GetAsyncKeyState((int)key) & 0x8000) != 0; ; } diff --git a/Spectrum/Program.cs b/Spectrum/Program.cs index ea878dc..d729d5b 100644 --- a/Spectrum/Program.cs +++ b/Spectrum/Program.cs @@ -1,6 +1,5 @@ using OpenCvSharp; using Spectrum.Detection; -using System.Runtime.InteropServices; namespace Spectrum { diff --git a/Spectrum/Renderer/Renderer.MovementPreviewWindow.cs b/Spectrum/Renderer/Renderer.MovementPreviewWindow.cs index 5c69c2c..57b9a93 100644 --- a/Spectrum/Renderer/Renderer.MovementPreviewWindow.cs +++ b/Spectrum/Renderer/Renderer.MovementPreviewWindow.cs @@ -51,16 +51,16 @@ namespace Spectrum Point current = _previewStartPoint; int steps = 0; int maxSteps = 10000; - + _previewPath.Add((current, 0.0)); while (true) { double distance = Math.Sqrt(Math.Pow(_previewEndPoint.X - current.X, 2) + Math.Pow(_previewEndPoint.Y - current.Y, 2)); - + if (distance < 2.0 || steps++ >= maxSteps) break; - + bool isInBox = boundingBox.Contains(current); Point nextPoint = InputManager.CalculateMovement(current, _previewEndPoint, config.Sensitivity, config.AimMovementType, isInBox); if (config.EmaSmoothening) @@ -70,7 +70,7 @@ namespace Spectrum _previewPath.Add((nextPoint, speed)); current = nextPoint; } - + if (_previewPath.Count > 0) { var lastPoint = _previewPath[^1].point; @@ -84,7 +84,7 @@ namespace Spectrum Vector2 canvasPos = ImGui.GetCursorScreenPos(); canvasPos.Y += 5; Vector2 canvasSize = ImGui.GetContentRegionAvail(); - Vector2 size = new Vector2(canvasSize.X, canvasSize.Y - 60); + Vector2 size = new(canvasSize.X, canvasSize.Y - 60); drawList.AddRectFilled(canvasPos, size + canvasPos, ImGui.GetColorU32(new Vector4(0.12f, 0.12f, 0.14f, 1.0f)), 3f); drawList.AddRect(canvasPos, size + canvasPos, ImGui.GetColorU32(new Vector4(0.17f, 0.17f, 0.20f, 1.0f)), 3f); drawList.PushClipRect(canvasPos, canvasPos + size, true);