mirror of
https://github.com/whoswhip/Spectrum.git
synced 2026-12-06 01:28:42 +00:00
refactor: improve readability and cleanup code
This commit is contained in:
@@ -278,7 +278,7 @@ namespace Spectrum.Input
|
|||||||
|
|
||||||
_ = tcs.Task.ContinueWith(_ =>
|
_ = tcs.Task.ContinueWith(_ =>
|
||||||
{
|
{
|
||||||
try { ctr.Dispose(); } catch {}
|
try { ctr.Dispose(); } catch { }
|
||||||
UnsubscribeMakcu();
|
UnsubscribeMakcu();
|
||||||
}, TaskScheduler.Default);
|
}, TaskScheduler.Default);
|
||||||
|
|
||||||
@@ -367,7 +367,8 @@ namespace Spectrum.Input
|
|||||||
{
|
{
|
||||||
var states = MakcuMain.MakcuInstance.GetCurrentButtonStates();
|
var states = MakcuMain.MakcuInstance.GetCurrentButtonStates();
|
||||||
return states.TryGetValue(makcuBtn, out var pressed) && pressed;
|
return states.TryGetValue(makcuBtn, out var pressed) && pressed;
|
||||||
} catch {}
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
return (GetAsyncKeyState((int)key) & 0x8000) != 0; ;
|
return (GetAsyncKeyState((int)key) & 0x8000) != 0; ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using OpenCvSharp;
|
using OpenCvSharp;
|
||||||
using Spectrum.Detection;
|
using Spectrum.Detection;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Spectrum
|
namespace Spectrum
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ namespace Spectrum
|
|||||||
Vector2 canvasPos = ImGui.GetCursorScreenPos();
|
Vector2 canvasPos = ImGui.GetCursorScreenPos();
|
||||||
canvasPos.Y += 5;
|
canvasPos.Y += 5;
|
||||||
Vector2 canvasSize = ImGui.GetContentRegionAvail();
|
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.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.AddRect(canvasPos, size + canvasPos, ImGui.GetColorU32(new Vector4(0.17f, 0.17f, 0.20f, 1.0f)), 3f);
|
||||||
drawList.PushClipRect(canvasPos, canvasPos + size, true);
|
drawList.PushClipRect(canvasPos, canvasPos + size, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user