void Visuals::DrawFOV()
{
auto pWeapon = g_LocalPlayer->m_hActiveWeapon();
if (!pWeapon)
return;
int WeaponID = Settings::Aimbot::GetWeaponType(pWeapon);
//auto settings = g_Options.legitbot_items[pWeapon->m_Item().m_iItemDefinitionIndex()];
if (Settings::Aimbot::Enabled)
{
float fov = static_cast<float>(g_LocalPlayer->GetFOV());
int w, h;
g_EngineClient->GetScreenSize(w, h);
Vector2D screenSize = Vector2D(w, h);
Vector2D center = screenSize * 0.5f;
float ratio = screenSize.x / screenSize.y;
float screenFov = atanf((ratio) * (0.75f) * tan(DEG2RAD(fov * 0.5f)));
float radiusFOV = tanf(DEG2RAD(Lbot::Get().GetFov())) / tanf(screenFov) * center.x;
Render::Get().RenderCircleFilled(center.x, center.y, radiusFOV, 32, Color(0, 0, 0, 50));
Render::Get().RenderCircle(center.x, center.y, radiusFOV, 32, Color(0, 0, 0, 100));
if (Settings::Aimbot::WeaponAimSetting[WeaponID].Silent)
{
float silentRadiusFOV = tanf(DEG2RAD(Settings::Aimbot::WeaponAimSetting[WeaponID].SilentFOV)) / tanf(screenFov) * center.x;
Render::Get().RenderCircleFilled(center.x, center.y, silentRadiusFOV, 32, Color(255, 25, 10, 50));
Render::Get().RenderCircle(center.x, center.y, silentRadiusFOV, 32, Color(255, 25, 10, 100));
}
}
}