Skip to content

Commit

Permalink
ESP Togler keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Izocel committed Jan 2, 2025
1 parent ad96554 commit daab12c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Application/Modules/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ struct RootConfig : public ModuleConfig

struct EspConfig : public ModuleConfig
{
bool pBx, pName, pHealth, pArmor, pBxHealth, pBxArmor;
GuiColor pBxCol, pBxBorderCol, pHealthCol, pArmorCol, pBxHealthCol, pBxArmorCol;
Position pBxPosOffset, pBxDimOffset;
std::map<std::string, std::string> gameObjects;
GuiColor pBxCol, pBxBorderCol, pHealthCol, pArmorCol, pBxHealthCol, pBxArmorCol;

bool isSkeletonActive = true, isBoxActive = true, isStatsActive = true, isGameObjectsActive = true;
bool showHealth = true, showArmor = true, showName = true, showDistance = true;
bool showHealthBar = true, showArmorBar = true;
bool showHealthText = true, showArmorText = true;
};

struct AimConfig : public ModuleConfig
Expand Down
51 changes: 43 additions & 8 deletions Application/Modules/EspModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,50 @@

class EspModule : public Module
{
EspConfig config;

void Execute()
{
// uses F1 to toggle skeleton
if (GetAsyncKeyState(VK_F1) & 1)
config.isSkeletonActive = !config.isSkeletonActive;

// uses F2 to toggle box
if (GetAsyncKeyState(VK_F2) & 1)
config.isBoxActive = !config.isBoxActive;

// uses F3 to toggle stats
if (GetAsyncKeyState(VK_F3) & 1)
config.isStatsActive = !config.isStatsActive;

// uses F4 to toggle esp
if (GetAsyncKeyState(VK_F4) & 1)
config.isActive = !config.isActive;
}

void RenderPlayerSkeleton(Player &player)
{
if (!player.screenBones.size())
return;

for (const auto &line : player.screenBones)
DrawLine(line.pStart, line.pEnd, White75, 2.5f);
if (config.isSkeletonActive)
{
for (const auto &line : player.screenBones)
DrawLine(line.pStart, line.pEnd, White50, 2.5f);
}

const float headRadius = player.screenBox.d.h / 13;
const float headRadius = player.screenBox.d.h / 14;
const Position headPos = player.screenBones[0].pStart;

DrawFilledCircle(headPos, headRadius, White25);
DrawCircle(headPos, headRadius, White75, 2.5f);
DrawCircle(headPos, headRadius, White50, 2);
}

void RenderPlayerBoxStats(Player &player)
{
if (!config.isStatsActive)
return;

const float healthRatio = (float)player.health / player.maxHealth;
const float armorRatio = (float)player.armor / 100.0f;

Expand All @@ -47,6 +74,9 @@ class EspModule : public Module

void RenderPlayerBox(Player &player)
{
if (!config.isBoxActive)
return;

DrawRectangle(player.screenBox.pStart, player.screenBox.d, White50);
DrawTextual(player.screenBox.pStart + Position{0, -16}, player.name.data(), White50);
}
Expand All @@ -56,10 +86,15 @@ class EspModule : public Module
if (!C4Bomb.FuseChrono.IsRunning())
return;

const Position pos = ClientCenterPosition;
DrawTextual(pos, ("Time left: " + C4Bomb.FuseChrono.ToString()).data(), GetTimerColor(C4Bomb.FuseChrono));
DrawTextual({pos.x, pos.y + 16}, ("Defuse Kit: " + C4Bomb.DefuseKitChrono.ToString()).data(), GetTimerColor(C4Bomb.DefuseKitChrono));
DrawTextual({pos.x, pos.y + 32}, ("Defuse: " + C4Bomb.DefuseChrono.ToString()).data(), GetTimerColor(C4Bomb.DefuseChrono));
const Position boxPos{8, ClientDimension.h - 80};
const Position textStart{boxPos.x + 4, boxPos.y + 4};

// Draw the box based on text size
DrawFilledRectangle(boxPos, {180, 64}, Black50);

DrawTextual(textStart, ("Time left: " + C4Bomb.FuseChrono.ToString()).data(), GetTimerColor(C4Bomb.FuseChrono));
DrawTextual({textStart.x, textStart.y + 16}, ("Defuse Kit: " + C4Bomb.DefuseKitChrono.ToString()).data(), GetTimerColor(C4Bomb.DefuseKitChrono));
DrawTextual({textStart.x, textStart.y + 32}, ("Defuse: " + C4Bomb.DefuseChrono.ToString()).data(), GetTimerColor(C4Bomb.DefuseChrono));
}

public:
Expand Down

0 comments on commit daab12c

Please sign in to comment.