Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Исходник Manual aa & flip indicator

  • Автор темы Автор темы sky1e
  • Дата начала Дата начала
Участник
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,240
Реакции
320
C++:
Expand Collapse Copy
void misc::desync_arrows()
{
    if (!g_ctx.local()->is_alive())
        return;

    if (!g_cfg.antiaim.enable)
        return;

    if ((g_cfg.antiaim.manual_back.key <= KEY_NONE || g_cfg.antiaim.manual_back.key >= KEY_MAX) && (g_cfg.antiaim.manual_left.key <= KEY_NONE || g_cfg.antiaim.manual_left.key >= KEY_MAX) && (g_cfg.antiaim.manual_right.key <= KEY_NONE || g_cfg.antiaim.manual_right.key >= KEY_MAX))
        antiaim::get().manual_side = SIDE_NONE;

    if (!g_cfg.antiaim.flip_indicator)
        return;

    static int width, height;
    m_engine()->GetScreenSize(width, height);

    static auto alpha = 1.0f;
    static auto switch_alpha = false;

    if (alpha <= 0.0f || alpha >= 1.0f)
        switch_alpha = !switch_alpha;

    alpha += switch_alpha ? 2.0f * m_globals()->m_frametime : -2.0f * m_globals()->m_frametime;
    alpha = math::clamp(alpha, 0.0f, 1.0f);

    auto color = g_cfg.antiaim.flip_indicator_color;
    color.SetAlpha(g_cfg.antiaim.flip_indicator_color.a());

    if (antiaim::get().manual_side == SIDE_BACK) {
        render::get().triangle(Vector2D(width / 2, height / 2 + 80), Vector2D(width / 2 - 10, height / 2 + 60), Vector2D(width / 2 + 10, height / 2 + 60), color);
        render::get().triangle_def(Vector2D(width / 2, height / 2 + 80), Vector2D(width / 2 - 10, height / 2 + 60), Vector2D(width / 2 + 10, height / 2 + 60), Color(color.r(), color.g(), color.b(), 255));
    }
    else if (antiaim::get().manual_side == SIDE_LEFT) {
        render::get().triangle(Vector2D(width / 2 - 55, height / 2 + 10), Vector2D(width / 2 - 75, height / 2), Vector2D(width / 2 - 55, height / 2 - 10), color);
        render::get().triangle_def(Vector2D(width / 2 - 55, height / 2 + 10), Vector2D(width / 2 - 75, height / 2), Vector2D(width / 2 - 55, height / 2 - 10), Color(color.r(), color.g(), color.b(), 255));
    }
    else if (antiaim::get().manual_side == SIDE_RIGHT) {
        render::get().triangle(Vector2D(width / 2 + 55, height / 2 - 10), Vector2D(width / 2 + 75, height / 2), Vector2D(width / 2 + 55, height / 2 + 10), color);
        render::get().triangle_def(Vector2D(width / 2 + 55, height / 2 - 10), Vector2D(width / 2 + 75, height / 2), Vector2D(width / 2 + 55, height / 2 + 10), Color(color.r(), color.g(), color.b(), 255));
    }
    if (g_cfg.antiaim.desync == 2) {
        if (antiaim::get().flip == false) {
            render::get().rect(width / 2 - 10, height / 2 + 46, 20, 4, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 - 10, height / 2 + 46, 20, 4, Color(color));
        }
    }
    else
    {
        if (antiaim::get().flip == false) {
            render::get().rect(width / 2 - 50, height / 2 - 10, 4, 20, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 - 50, height / 2 - 10, 4, 20, Color(color));
        }
        else if (antiaim::get().flip == true)
        {
            render::get().rect(width / 2 + 46, height / 2 - 10, 4, 20, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 + 46, height / 2 - 10, 4, 20, Color(color));
        }
    }
}

render
C++:
Expand Collapse Copy
void render::triangle_def(Vector2D fir, Vector2D sec, Vector2D thrd, Color color)
{
    if (!m_surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    auto surface = m_surface();

    static int texture = surface->CreateNewTextureID(true);
    unsigned char buffer[4] = { 255, 255, 255, 255 };
    surface->DrawSetColor(color);
    surface->DrawSetTexture(texture);
    surface->DrawLine(fir.x, fir.y, sec.x, sec.y);
    surface->DrawLine(sec.x, sec.y, thrd.x, thrd.y);
    surface->DrawLine(thrd.x, thrd.y, fir.x, fir.y);



}

SS:
1628442866447.png
 
void render::triangle_def(Vector2D fir, Vector2D sec, Vector2D thrd, Color color) { if (!m_surface()) return; color.SetAlpha(static_cast<int>(color.a() * alpha_factor)); auto surface = m_surface(); static int texture = surface->CreateNewTextureID(true); unsigned char buffer[4] = { 255, 255, 255, 255 }; surface->DrawSetColor(color); surface->DrawSetTexture(texture); surface->DrawLine(fir.x, fir.y, sec.x, sec.y); surface->DrawLine(sec.x, sec.y, thrd.x, thrd.y); surface->DrawLine(thrd.x, thrd.y, fir.x, fir.y); }
why would u make this more complicated then just using the polygon function...
 
C++:
Expand Collapse Copy
void misc::desync_arrows()
{
    if (!g_ctx.local()->is_alive())
        return;

    if (!g_cfg.antiaim.enable)
        return;

    if ((g_cfg.antiaim.manual_back.key <= KEY_NONE || g_cfg.antiaim.manual_back.key >= KEY_MAX) && (g_cfg.antiaim.manual_left.key <= KEY_NONE || g_cfg.antiaim.manual_left.key >= KEY_MAX) && (g_cfg.antiaim.manual_right.key <= KEY_NONE || g_cfg.antiaim.manual_right.key >= KEY_MAX))
        antiaim::get().manual_side = SIDE_NONE;

    if (!g_cfg.antiaim.flip_indicator)
        return;

    static int width, height;
    m_engine()->GetScreenSize(width, height);

    static auto alpha = 1.0f;
    static auto switch_alpha = false;

    if (alpha <= 0.0f || alpha >= 1.0f)
        switch_alpha = !switch_alpha;

    alpha += switch_alpha ? 2.0f * m_globals()->m_frametime : -2.0f * m_globals()->m_frametime;
    alpha = math::clamp(alpha, 0.0f, 1.0f);

    auto color = g_cfg.antiaim.flip_indicator_color;
    color.SetAlpha(g_cfg.antiaim.flip_indicator_color.a());

    if (antiaim::get().manual_side == SIDE_BACK) {
        render::get().triangle(Vector2D(width / 2, height / 2 + 80), Vector2D(width / 2 - 10, height / 2 + 60), Vector2D(width / 2 + 10, height / 2 + 60), color);
        render::get().triangle_def(Vector2D(width / 2, height / 2 + 80), Vector2D(width / 2 - 10, height / 2 + 60), Vector2D(width / 2 + 10, height / 2 + 60), Color(color.r(), color.g(), color.b(), 255));
    }
    else if (antiaim::get().manual_side == SIDE_LEFT) {
        render::get().triangle(Vector2D(width / 2 - 55, height / 2 + 10), Vector2D(width / 2 - 75, height / 2), Vector2D(width / 2 - 55, height / 2 - 10), color);
        render::get().triangle_def(Vector2D(width / 2 - 55, height / 2 + 10), Vector2D(width / 2 - 75, height / 2), Vector2D(width / 2 - 55, height / 2 - 10), Color(color.r(), color.g(), color.b(), 255));
    }
    else if (antiaim::get().manual_side == SIDE_RIGHT) {
        render::get().triangle(Vector2D(width / 2 + 55, height / 2 - 10), Vector2D(width / 2 + 75, height / 2), Vector2D(width / 2 + 55, height / 2 + 10), color);
        render::get().triangle_def(Vector2D(width / 2 + 55, height / 2 - 10), Vector2D(width / 2 + 75, height / 2), Vector2D(width / 2 + 55, height / 2 + 10), Color(color.r(), color.g(), color.b(), 255));
    }
    if (g_cfg.antiaim.desync == 2) {
        if (antiaim::get().flip == false) {
            render::get().rect(width / 2 - 10, height / 2 + 46, 20, 4, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 - 10, height / 2 + 46, 20, 4, Color(color));
        }
    }
    else
    {
        if (antiaim::get().flip == false) {
            render::get().rect(width / 2 - 50, height / 2 - 10, 4, 20, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 - 50, height / 2 - 10, 4, 20, Color(color));
        }
        else if (antiaim::get().flip == true)
        {
            render::get().rect(width / 2 + 46, height / 2 - 10, 4, 20, Color(color.r(), color.g(), color.b(), 255));
            render::get().rect_filled(width / 2 + 46, height / 2 - 10, 4, 20, Color(color));
        }
    }
}

render
C++:
Expand Collapse Copy
void render::triangle_def(Vector2D fir, Vector2D sec, Vector2D thrd, Color color)
{
    if (!m_surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    auto surface = m_surface();

    static int texture = surface->CreateNewTextureID(true);
    unsigned char buffer[4] = { 255, 255, 255, 255 };
    surface->DrawSetColor(color);
    surface->DrawSetTexture(texture);
    surface->DrawLine(fir.x, fir.y, sec.x, sec.y);
    surface->DrawLine(sec.x, sec.y, thrd.x, thrd.y);
    surface->DrawLine(thrd.x, thrd.y, fir.x, fir.y);



}

SS:
Посмотреть вложение 165201
может перестанешь мой код ликать под видом своего?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу