Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Izocel committed Jan 1, 2025
1 parent 15f684a commit 9a1d60d
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Application/Application.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,14 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AppEngine.h" />
<ClInclude Include="Application.h" />
<ClInclude Include="Gui\Gui.h" />
<ClInclude Include="Instances\Bones.h" />
<ClInclude Include="Instances\C4Bomb.h" />
<ClInclude Include="Instances\Player.h" />
<ClInclude Include="Modules\AimBotModule.h" />
<ClInclude Include="Modules\Configs.h" />
<ClInclude Include="Modules\EspModule.h" />
<ClInclude Include="Modules\Module.h" />
<ClInclude Include="Modules\Modules.h" />
Expand Down
6 changes: 6 additions & 0 deletions Application/Application.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
<ClInclude Include="Instances\Bones.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AppEngine.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Modules\Configs.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Application.cpp">
Expand Down
1 change: 0 additions & 1 deletion Application/Gui/Gui.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include "Colors.h"
#include "../AppEngine.h"
#include "../../ImGui/imgui.h"

Expand Down
4 changes: 2 additions & 2 deletions Application/Modules/AimBotModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class AimBotModule : public Module
// Empty the old states first (insure next check are actual)
GetAsyncKeyState(VK_SHIFT);

if (config.aimAssist && GetAsyncKeyState(VK_SHIFT))
if (config.isAimActive && GetAsyncKeyState(VK_SHIFT))
{
WriteClient<Vector3>(dwViewAngles, target.distance.RelativeAngle());
}

if (config.clickAssist && GetAsyncKeyState(VK_SHIFT))
if (config.isClickActive && GetAsyncKeyState(VK_SHIFT))
{
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
Expand Down
6 changes: 4 additions & 2 deletions Application/Modules/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include "../AppEngine.h"
#include "../Gui/Gui.h"

using namespace Gui;
using namespace AppEngine;
using namespace AppEngine::GameRules;
using namespace Gui;

struct ModuleConfig
{
Expand All @@ -28,5 +28,7 @@ struct EspConfig : public ModuleConfig

struct AimConfig : public ModuleConfig
{
bool aimAssist, clickAssist;
bool isAimActive, isClickActive, showAimCircle;
Circle aimCircle;
Box searchBox;
};
2 changes: 1 addition & 1 deletion Application/Modules/EspModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class EspModule : public Module
DrawCircle(player.screenEye, headRadius, White50);

for (const auto &line : player.screenBones)
DrawLine(line.p1, line.p2, White75, 2.5f);
DrawLine(line.pStart, line.pEnd, White75, 2.5f);
}

void RenderPlayerBoxStats(Player &player)
Expand Down
12 changes: 6 additions & 6 deletions Application/Gui/Colors.h → Engine/Colors/Colors.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

typedef struct
struct GuiColor
{
float R;
float G;
float B;
float A;
} GuiColor;
float R = 255.f;
float G = 255.f;
float B = 255.f;
float A = 255.f;
};

const GuiColor Transparent{0, 0, 0, 0};

Expand Down
1 change: 1 addition & 0 deletions Engine/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <chrono>

#include "Memory.h"
#include "Colors/Colors.h"
#include "Math/ViewMatrix.h"
#include "Math/Vector.h"
#include "Math/Shapes.h"
Expand Down
2 changes: 2 additions & 0 deletions Engine/Engine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="Classes\Timer.h" />
<ClInclude Include="Colors\Colors.h" />
<ClInclude Include="Engine.h" />
<ClInclude Include="GameDumper\Dumps\animationsystem_dll.hpp" />
<ClInclude Include="GameDumper\Dumps\buttons.hpp" />
Expand All @@ -177,6 +178,7 @@
<ClInclude Include="GameDumper\Dumps\vphysics2_dll.hpp" />
<ClInclude Include="GameDumper\Dumps\worldrenderer_dll.hpp" />
<ClInclude Include="Math\Geo.h" />
<ClInclude Include="Math\Shapes.h" />
<ClInclude Include="Math\Vector.h" />
<ClInclude Include="Math\ViewMatrix.h" />
<ClInclude Include="Memory.h" />
Expand Down
6 changes: 6 additions & 0 deletions Engine/Engine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
<ClInclude Include="Classes\Timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Colors\Colors.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Math\Shapes.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram.cd" />
Expand Down
34 changes: 17 additions & 17 deletions Engine/Math/Shapes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@

namespace Shapes
{
struct Line
struct Box
{
Position p1;
Position p2;
Position pStart;
Dimension d;
Position pStop = {pStart.x + d.w, pStart.y + d.h};
GuiColor color;
GuiColor borderColor;
};

struct Rectangle
struct Line
{
Position p;
Dimension d;
Position pStart;
Position pEnd;
Dimension d = {pEnd.x - pStart.x, pEnd.y - pStart.y};
GuiColor color;
GuiColor borderColor;
};

class Circle
struct Circle
{
public:
Position p;
Dimension d;
float radius;
float diameter;

Circle(const Position &p, const float radius) : p(p), radius(radius)
{
d = Dimension{radius * 2, radius * 2};
diameter = radius * 2;
}
float r = 1;
Dimension d = {r * 2, r * 2};
GuiColor color;
GuiColor borderColor;
};
}
25 changes: 25 additions & 0 deletions Engine/Math/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ struct Position
{
return {this->x - other.x, this->y - other.y};
}
Position operator*(float other)
{
return {this->x * other, this->y * other};
}
Position operator/(float other)
{
return {this->x / other, this->y / other};
}

Position operator+(Position *other)
{
return {this->x + other->x, this->y + other->y};
}
Position operator-(Position *other)
{
return {this->x - other->x, this->y - other->y};
}
Position operator*(float *other)
{
return {this->x * *other, this->y * *other};
}
Position operator/(float *other)
{
return {this->x / *other, this->y / *other};
}
};

struct Vector3
Expand Down

0 comments on commit 9a1d60d

Please sign in to comment.