-
Автор темы
- #1
C++:
inline Vector2D vecDisplaySize = {};
`` void Visuals :: VelocityInfo ()
{
static float groundvelocity = 0;
if (! g_LocalPlayer ||! g_LocalPlayer-> IsAlive ())
return;
if (! g_Options.velocity_info)
return;
int x, y;
g_EngineClient-> GetScreenSize (x, y);
Vector vecVelocity = g_LocalPlayer-> m_vecVelocity ();
float currentVelocity = sqrt (vecVelocity.x * vecVelocity.x + vecVelocity.y * vecVelocity.y);
bool in_air = g_LocalPlayer-> m_fFlags () & IN_JUMP || g_LocalPlayer-> m_fFlags () & IN_SPEED;
if (g_LocalPlayer-> m_fFlags () & FL_ONGROUND) {
groundvelocity = g_LocalPlayer-> m_vecVelocity (). Length2D () + 0.5;
Render :: Get (). RenderText (std :: to_string ((int) currentVelocity), ImVec2 (x / 2, y - y / 20 - 15), 25, Color (245, 245, 220, 255), true, g_VeloFont);
}
else
Render :: Get (). RenderText (std :: to_string ((int) currentVelocity) + "(" + std :: to_string ((int) groundvelocity) + ")", ImVec2 (x / 2, y - y / 20 - 15), 25, Color (245, 245, 220, 255), true, g_VeloFont);
static std :: vector <float> velData (240, 0);
velData.erase (velData.begin ());
velData.push_back (currentVelocity);
const int iIdealY = vecDisplaySize.y / 2 + g_Options.iYAdditive;
const int iIdealX = vecDisplaySize.x / 700 + g_Options.iXAdditive;
for (auto i = 0; i <velData.size () - 1; i ++)
{
int cur = velData.at (i);
int next = velData.at (i + 1);
const RECT linePos = {
iIdealX - 2 + ((g_Options.iVelocityGraphWidth / 2) - 8) - ((signed int) i - 1) * 5 * 0.175f,
iIdealY - 50 - (cur / g_Options.flVelocityGraphCompression),
iIdealX - 2 + ((g_Options.iVelocityGraphWidth / 2) - 8) - (signed int) i * 5 * 0.175f,
iIdealY - 50 - (next / g_Options.flVelocityGraphCompression)
};
Render :: Get (). Line (linePos.left, linePos.top, linePos.right, linePos.bottom, Color (200, 200, 200));
}
} `` [/ CODE] [/ CODE]