Update hack.hpp
- Added a toggleable rainbow effect for boxes & names
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <cmath>
|
||||||
#include "../memory/memory.hpp"
|
#include "../memory/memory.hpp"
|
||||||
#include "../classes/globals.hpp"
|
#include "../classes/globals.hpp"
|
||||||
#include "../classes/render.hpp"
|
#include "../classes/render.hpp"
|
||||||
@@ -101,14 +102,40 @@ namespace hack {
|
|||||||
const COLORREF boxColor = RGB(175, 75, 75);
|
const COLORREF boxColor = RGB(175, 75, 75);
|
||||||
const COLORREF healthBarColor = RGB(255 - playerHealth, 55 + playerHealth * 2, 75);
|
const COLORREF healthBarColor = RGB(255 - playerHealth, 55 + playerHealth * 2, 75);
|
||||||
|
|
||||||
render::DrawBorderBox(
|
const float pi = 3.14159265358979323846f;
|
||||||
g::hdcBuffer,
|
|
||||||
screenHead.x - width / 2,
|
// Get the current time
|
||||||
screenHead.y,
|
DWORD currentTime = GetTickCount();
|
||||||
width,
|
|
||||||
height,
|
// Calculate the sinusoidal values for RGB colors
|
||||||
(localTeam == playerTeam ? RGB(75, 175, 75) : RGB(175, 75, 75))
|
float red = (sin(config::rainbow_speed * currentTime + 0) * 127.5f + 127.5f); // 0 phase shift
|
||||||
);
|
float green = (sin(config::rainbow_speed * currentTime + 2 * pi / 3) * 127.5f + 127.5f); // 2*pi/3 phase shift
|
||||||
|
float blue = (sin(config::rainbow_speed * currentTime + 4 * pi / 3) * 127.5f + 127.5f); // 4*pi/3 phase shift
|
||||||
|
|
||||||
|
// Convert the floating point values to integers for RGB color creation
|
||||||
|
COLORREF rainbowColor = RGB(static_cast<int>(red), static_cast<int>(green), static_cast<int>(blue));
|
||||||
|
|
||||||
|
if (config::rainbow) {
|
||||||
|
render::DrawBorderBox(
|
||||||
|
g::hdcBuffer,
|
||||||
|
screenHead.x - width / 2,
|
||||||
|
screenHead.y,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
(localTeam == playerTeam ? rainbowColor : rainbowColor)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
render::DrawBorderBox(
|
||||||
|
g::hdcBuffer,
|
||||||
|
screenHead.x - width / 2,
|
||||||
|
screenHead.y,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
(localTeam == playerTeam ? RGB(75, 175, 75) : RGB(175, 75, 75))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render::DrawBorderBox(
|
render::DrawBorderBox(
|
||||||
g::hdcBuffer,
|
g::hdcBuffer,
|
||||||
@@ -123,14 +150,28 @@ namespace hack {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
render::RenderText(
|
if (config::rainbow)
|
||||||
g::hdcBuffer,
|
{
|
||||||
screenHead.x + (width / 2 + 5),
|
render::RenderText(
|
||||||
screenHead.y,
|
g::hdcBuffer,
|
||||||
playerName.c_str(),
|
screenHead.x + (width / 2 + 5),
|
||||||
RGB(75, 75, 175),
|
screenHead.y,
|
||||||
10
|
playerName.c_str(),
|
||||||
);
|
rainbowColor,
|
||||||
|
10
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
render::RenderText(
|
||||||
|
g::hdcBuffer,
|
||||||
|
screenHead.x + (width / 2 + 5),
|
||||||
|
screenHead.y,
|
||||||
|
playerName.c_str(),
|
||||||
|
RGB(75, 75, 175),
|
||||||
|
10
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render::RenderText(
|
render::RenderText(
|
||||||
g::hdcBuffer,
|
g::hdcBuffer,
|
||||||
|
|||||||
Reference in New Issue
Block a user