Skip to content

Commit a0be3cd

Browse files
committed
feat: third person support, by blocking out a quarter of the bitmap
1 parent ace127b commit a0be3cd

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

Aimmy2/AILogic/CaptureManager.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,27 @@ public void InitializeDxgiDuplication()
393393
_lastSrcStride = srcStride;
394394
_lastDstStride = dstStride;
395395
}
396+
397+
if (Dictionary.toggleState["Third Person Support"])
398+
{
399+
int width = w / 2;
400+
int height = h / 2;
401+
int startY = h - height;
402+
403+
byte* dstPtr = (byte*)mapDest.Scan0;
404+
for (int y = startY; y < h; y++)
405+
{
406+
byte* rowPtr = dstPtr + (y * dstStride);
407+
for (int x = 0; x < width; x++)
408+
{
409+
int pixelOffset = x * 4;
410+
rowPtr[pixelOffset] = 0; // R
411+
rowPtr[pixelOffset + 1] = 0; // G
412+
rowPtr[pixelOffset + 2] = 0; // B
413+
rowPtr[pixelOffset + 3] = 255; // A
414+
}
415+
}
416+
}
396417
}
397418

398419
UpdateCache(currentBitmap, detectionBox);
@@ -484,7 +505,22 @@ public Bitmap GDIScreen(Rectangle detectionBox)
484505
detectionBox.Size,
485506
CopyPixelOperation.SourceCopy
486507
);
508+
509+
if (Dictionary.toggleState["Third Person Support"])
510+
{
511+
int width = screenCaptureBitmap.Width / 2;
512+
int height = screenCaptureBitmap.Height / 2;
513+
int startY = screenCaptureBitmap.Height - height;
514+
515+
using (var brush = new SolidBrush(System.Drawing.Color.Black))
516+
{
517+
g.FillRectangle(brush, 0, startY, width, height);
518+
}
519+
}
487520
}
521+
522+
523+
488524
return screenCaptureBitmap;
489525
}
490526
catch (Exception ex)

Aimmy2/Class/Dictionary.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static class Dictionary
5858
{ "Anti Recoil", false },
5959
{ "FOV", false },
6060
{ "Dynamic FOV", false },
61+
{ "Third Person Support", false },
6162
{ "Masking", false },
6263
{ "Show Detected Player", false },
6364
{ "Cursor Check", false },

Aimmy2/Class/UI.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public class UI
7676

7777
// FOV
7878
public ATitle? AT_FOV { get; set; }
79-
//--
80-
public ADropdown D_FOVSTYLE { get; set; }
81-
//--
8279
public AToggle? T_FOV { get; set; }
83-
8480
public AToggle? T_DynamicFOV { get; set; }
81+
public AToggle? T_ThirdPersonSupport { get; set; }
8582
public AKeyChanger? C_DynamicFOV { get; set; }
83+
//--
84+
public ADropdown D_FOVSTYLE { get; set; }
85+
//--
8686
public AColorChanger? CC_FOVColor { get; set; }
8787
public ASlider? S_FOVSize { get; set; }
8888
public ASlider? S_DynamicFOVSize { get; set; }

Aimmy2/UISections/AimMenuControl.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ private void LoadFOVConfig()
419419
})
420420
.AddToggle("FOV", t => uiManager.T_FOV = t)
421421
.AddToggle("Dynamic FOV", t => uiManager.T_DynamicFOV = t)
422+
.AddToggle("Third Person Support", t => uiManager.T_ThirdPersonSupport = t)
422423
.AddKeyChanger("Dynamic FOV Keybind", k => uiManager.C_DynamicFOV = k)
423424
.AddDropdown("FOV Style", d =>
424425
{

0 commit comments

Comments
 (0)