mirror of
https://github.com/whoswhip/Spectrum.git
synced 2026-12-06 01:28:42 +00:00
feat: add configurable aimpoint types
This commit is contained in:
@@ -316,6 +316,12 @@ namespace Spectrum
|
|||||||
Circle,
|
Circle,
|
||||||
Rectangle
|
Rectangle
|
||||||
}
|
}
|
||||||
|
public enum AimpointType
|
||||||
|
{
|
||||||
|
Crosshair,
|
||||||
|
Dot,
|
||||||
|
Circle
|
||||||
|
}
|
||||||
public enum CaptureMethod
|
public enum CaptureMethod
|
||||||
{
|
{
|
||||||
GDI,
|
GDI,
|
||||||
@@ -390,6 +396,7 @@ namespace Spectrum
|
|||||||
public Vector4 FOVColor { get; set; } = new Vector4(0.0f, 1.0f, 0.0f, 1.0f);
|
public Vector4 FOVColor { get; set; } = new Vector4(0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
public bool DrawAimPoint { get; set; } = true;
|
public bool DrawAimPoint { get; set; } = true;
|
||||||
public Vector4 AimPointColor { get; set; } = new Vector4(1.0f, 0.0f, 0.0f, 1.0f);
|
public Vector4 AimPointColor { get; set; } = new Vector4(1.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
public AimpointType AimPointType { get; set; } = AimpointType.Dot;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Data Collection Settings
|
#region Data Collection Settings
|
||||||
|
|||||||
@@ -184,11 +184,22 @@ namespace Spectrum.Detection
|
|||||||
int targetY = groupY + bounds.Y;
|
int targetY = groupY + bounds.Y;
|
||||||
|
|
||||||
if (config.DrawAimPoint)
|
if (config.DrawAimPoint)
|
||||||
|
{
|
||||||
|
if (config.AimPointType == AimpointType.Crosshair)
|
||||||
{
|
{
|
||||||
renderer!.AddLine(new System.Numerics.Vector2(targetX - 10, targetY), new System.Numerics.Vector2(targetX + 10, targetY), config.AimPointColor, 2);
|
renderer!.AddLine(new System.Numerics.Vector2(targetX - 10, targetY), new System.Numerics.Vector2(targetX + 10, targetY), config.AimPointColor, 2);
|
||||||
renderer!.AddLine(new System.Numerics.Vector2(targetX, targetY - 10), new System.Numerics.Vector2(targetX, targetY + 10), config.AimPointColor, 2);
|
renderer!.AddLine(new System.Numerics.Vector2(targetX, targetY - 10), new System.Numerics.Vector2(targetX, targetY + 10), config.AimPointColor, 2);
|
||||||
renderer!.AddCircle(new System.Numerics.Vector2(targetX, targetY), 5, config.AimPointColor, 20);
|
renderer!.AddCircle(new System.Numerics.Vector2(targetX, targetY), 5, config.AimPointColor, 20);
|
||||||
}
|
}
|
||||||
|
else if (config.AimPointType == AimpointType.Dot)
|
||||||
|
{
|
||||||
|
renderer!.AddCircleFilled(new System.Numerics.Vector2(targetX, targetY), 5, config.AimPointColor, 20);
|
||||||
|
}
|
||||||
|
else if (config.AimPointType == AimpointType.Circle)
|
||||||
|
{
|
||||||
|
renderer!.AddCircle(new System.Numerics.Vector2(targetX, targetY), 10, config.AimPointColor, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (config.AutoLabel && drawing != null)
|
if (config.AutoLabel && drawing != null)
|
||||||
{
|
{
|
||||||
@@ -233,13 +244,9 @@ namespace Spectrum.Detection
|
|||||||
drawing?.Dispose();
|
drawing?.Dispose();
|
||||||
|
|
||||||
if (!AutoLabeling.Started && (config.CollectData || config.AutoLabel))
|
if (!AutoLabeling.Started && (config.CollectData || config.AutoLabel))
|
||||||
{
|
|
||||||
AutoLabeling.StartLabeling();
|
AutoLabeling.StartLabeling();
|
||||||
}
|
|
||||||
else if (AutoLabeling.Started && !config.CollectData && !config.AutoLabel)
|
else if (AutoLabeling.Started && !config.CollectData && !config.AutoLabel)
|
||||||
{
|
|
||||||
AutoLabeling.StopLabeling();
|
AutoLabeling.StopLabeling();
|
||||||
}
|
|
||||||
|
|
||||||
if (config.DebugMode)
|
if (config.DebugMode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -322,6 +322,24 @@ namespace Spectrum
|
|||||||
ImGui.EndCombo();
|
ImGui.EndCombo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (DrawAimPoint)
|
||||||
|
{
|
||||||
|
AimpointType aimpointType = config.AimPointType;
|
||||||
|
ImGui.TextUnformatted("Aimpoint Type");
|
||||||
|
ImGui.SetNextItemWidth(-1);
|
||||||
|
if (ImGui.BeginCombo("##Aimpoint Type", aimpointType.ToString()))
|
||||||
|
{
|
||||||
|
foreach (AimpointType type in Enum.GetValues(typeof(AimpointType)))
|
||||||
|
{
|
||||||
|
bool isSelected = (type == aimpointType);
|
||||||
|
if (ImGui.Selectable(type.ToString(), isSelected))
|
||||||
|
config.AimPointType = type;
|
||||||
|
if (isSelected)
|
||||||
|
ImGui.SetItemDefaultFocus();
|
||||||
|
}
|
||||||
|
ImGui.EndCombo();
|
||||||
|
}
|
||||||
|
}
|
||||||
ImGuiExtensions.EndPane();
|
ImGuiExtensions.EndPane();
|
||||||
}
|
}
|
||||||
ImGuiExtensions.EndPaneGroup();
|
ImGuiExtensions.EndPaneGroup();
|
||||||
@@ -950,6 +968,15 @@ namespace Spectrum
|
|||||||
detectionDrawCommands.Add(drawList => drawList.AddCircle(center, radius, ImGui.GetColorU32(color), numSegments, thickness));
|
detectionDrawCommands.Add(drawList => drawList.AddCircle(center, radius, ImGui.GetColorU32(color), numSegments, thickness));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void AddCircleFilled(Vector2 center, float radius, Vector4 color, int numSegments = 0)
|
||||||
|
{
|
||||||
|
if (numSegments <= 0)
|
||||||
|
numSegments = (int)(Math.Max(1, radius / 2.0f));
|
||||||
|
lock (detectionDrawLock)
|
||||||
|
{
|
||||||
|
detectionDrawCommands.Add(drawList => drawList.AddCircleFilled(center, radius, ImGui.GetColorU32(color), numSegments));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void AddText(Vector2 pos, Vector4 color, string text, int fontSize = 16)
|
public void AddText(Vector2 pos, Vector4 color, string text, int fontSize = 16)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user