void GradientLine(int x, int y, int w, int h, Color c1, Color c2)
{
g_pSurface->FilledRect(x, y, w, h, c1);
BYTE first = c2.red;
BYTE second = c2.green;
BYTE third = c2.blue;
for (int i = 0; i < w; i++)
{
float fi = i, fw = w;
float a = fi / fw;
DWORD ia = a * 255;
g_pSurface->FilledRect(x + i, y, 1, h, Color(first, second, third, ia));
}
}
if (c_config::get().skeet100watermark)
{
static unsigned int s, v, i;
static float h, r, g, b, f, p, q, t;
h = g_pGlobalVars->realtime * 0.1f;
s = 1;
v = 1;
i = floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
q = v * (1 - f * s);
t = v * (1 - (1 - f) * s);
switch (i % 6)
{
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
r = round(r * 255), g = round(g * 255), b = round(b * 255);
std::stringstream ss;
std::stringstream rr;
int width, height;
g_pEngine->GetScreenSize(width, height); // owowowo
//getting the user
char path[MAX_PATH], * name = NULL;
GetEnvironmentVariable((LPCTSTR)"USERPROFILE", (LPSTR)path, (DWORD)MAX_PATH);
name = &path[std::strlen(path) - 1];
for (; *name != '\\'; --name);
++name;
//fps
static int fps, old_tick_count;
if ((g_pGlobalVars->tickcount - old_tick_count) > 50) {
fps = static_cast<int>(1.f / g_pGlobalVars->frametime);
old_tick_count = g_pGlobalVars->tickcount;
}
//incoming
auto net_channel = g_pEngine->GetNetChannelInfo();
auto local_player = reinterpret_cast<C_BaseEntity*>(g_pEntityList->GetClientEntity(g_pEngine->GetLocalPlayer()));
std::string incoming = local_player ? std::to_string((int)(net_channel->GetLatency(FLOW_INCOMING) * 1000)) : "0";
//rectangles and all that shit
g_pSurface->FilledRect(width - 290, 12, 260, 30, Color(40, 40, 40, 225));
g_pSurface->FilledRect(width - 285, 17, 250, 20, Color(10, 10, 10, 225));
g_pSurface->OutlinedRect(width - 285, 17, 250, 20, Color(200, 200, 200, 50));
g_pSurface->OutlinedRect(width - 290, 12, 260, 30, Color(200, 200, 200, 50));
GradientLine(width - 284, 17, 142, 1, Color(g, b, r, 255), Color(r, g, b, 255));
GradientLine(width - 162, 17, 126, 1, Color(r, g, b, 255), Color(b, r, g, 255));
g_pSurface->DrawT(width - 279, 20.5, Color(255, 255, 255), Globals::CourierNew, false, "game");
g_pSurface->DrawT(width - 250, 20.5, Color(221, 160, 221), Globals::CourierNew, false, " sense"); // lost 30 mins when i could double space that ez fix
g_pSurface->DrawT(width - 205, 20.5, Color(255, 255, 255), Globals::CourierNew, false, " |");
g_pSurface->DrawT(width - 190, 20.5, Color(255, 255, 255), Globals::CourierNew, false, name);
g_pSurface->DrawT(width - 160, 20.5, Color(255, 255, 255), Globals::CourierNew, false, " |");
ss << fps;
RECT TextSize = g_pSurface->GetTextSizeRect(Globals::CourierNew, ss.str().c_str());
g_pSurface->DrawT(width - 140, 20.5, Color(255, 255, 255), Globals::CourierNew, false, ss.str().c_str());
g_pSurface->DrawT(width - 125, 20.5, Color(255, 255, 255), Globals::CourierNew, false, " fps");
g_pSurface->DrawT(width - 105, 20.5, Color(255, 255, 255), Globals::CourierNew, false, " |");
rr << incoming;
RECT Uau = g_pSurface->GetTextSizeRect(Globals::CourierNew, rr.str().c_str());
g_pSurface->DrawT(width - 80, 20.5, Color(255, 255, 255), Globals::CourierNew, false, rr.str().c_str());
g_pSurface->DrawT(width - 65, 20.5, Color(255, 255, 255), Globals::CourierNew, false, " ms");
}