Вопрос Проблемы с кейбиндами

контора пидорасов
Забаненный
Статус
Оффлайн
Регистрация
1 Июл 2021
Сообщения
191
Реакции[?]
42
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Как сделать возможность передвижения в другое место?

C++:
void misc::keybinds()
{
    if (!g_cfg.menu.keybinds)
        return;

    std::vector<sperma> keybinds = {
        { g_cfg.antiaim.flip_desync, 16, "invert" },
        {g_cfg.misc.thirdperson_toggle, 17, "third person"},
        {g_cfg.antiaim.hide_shots_key, 12, "hide shots"},
        {g_cfg.misc.fakeduck_key, 20, "fake duck "},
        {g_cfg.misc.slowwalk_key, 21, "slow walk "},
        {g_cfg.ragebot.body_aim_key, 22, "body aim"},
        {g_cfg.ragebot.double_tap_key, 2, "double tap"},
        {g_cfg.ragebot.safe_point_key, 3, "safe points"},
        {g_cfg.misc.automatic_peek, 18, "auto peek"},
        {g_cfg.antiaim.manual_back, 13, "back manual"},
        {g_cfg.antiaim.manual_left, 14, "left manual"},
        {g_cfg.antiaim.manual_right, 15, "right manual"},
        {g_cfg.misc.edge_jump, 19, "edge jump"}
    };

    for (auto& keybind : keybinds) {
        update_keybind(keybind.keybind, keybind.id);
    }

    const auto time = m_globals()->m_realtime;
    constexpr auto anim_speed = 0.2f;

    auto pos = Vector2D(600, 200);
    auto size = Vector2D(140.f, 20.f);

    constexpr auto padding = 4.f;
    constexpr auto spacing = 4.f;
    constexpr auto line_size = 2.f;

    auto back_color = Color(0.f, 0.f, 0.f, 0.95f);
    auto text_color = Color(1.f, 1.f, 1.f, 0.95f);
    auto line_color = Color(0.6f, 0.8f, 1.f);

    auto last_expiration = 0.f;

    std::vector<sperma> active;
    for (auto &s2 : keybinds) {
        auto cal2 = &s2.keybind;

        const auto expiration = 1.f - (time - cal2->last_time_update) / anim_speed;

        last_expiration = max(last_expiration, expiration);

        if (expiration <= 0.f)
            continue;

        cal2->alpha = expiration * 255.f;

        active.push_back(s2);
    }

    if (active.empty())
        return;

    line_color.SetAlpha(last_expiration * 255.f);
    back_color.SetAlpha(last_expiration * 255.f);
    text_color.SetAlpha(last_expiration * 255.f);

    render::get().rect_filled(pos.x, pos.y, size.x, line_size, line_color);
    render::get().rect_filled(pos.x, pos.y + line_size, size.x, size.y - line_size, back_color);

    auto posay = pos + (size / 2.f);

    render::get().text(fonts[NAME], posay.x, posay.y, text_color, HFONT_CENTERED_X | HFONT_CENTERED_Y, m_xor_str("keybindings"));

    auto draw_pos = Vector2D(padding, size.y + spacing);
    auto draw_size = Vector2D(size.x - (padding * 2.f), 0.f);

    for (auto& data : active) {
        auto mode = data.keybind.mode == 0 ? "hold" : "toggle";
        const auto text_size = Vector2D(render::get().text_width(fonts[NAME], mode), render::get().text_heigth(fonts[NAME], mode));

        auto govon_pos = pos + draw_pos + draw_size;

        text_color.SetAlpha((int)data.keybind.alpha);

        render::get().text(fonts[NAME], pos.x + draw_pos.x, pos.y + draw_pos.y, text_color, HFONT_CENTERED_NONE, data.name);
        render::get().text(fonts[NAME], govon_pos.x - text_size.x, govon_pos.y, text_color, HFONT_CENTERED_NONE, mode);

        draw_pos.y += text_size.y + spacing;
    }
}
 
ЧВК EB_LAN
Забаненный
Статус
Оффлайн
Регистрация
12 Янв 2019
Сообщения
838
Реакции[?]
298
Поинты[?]
17K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Как сделать возможность передвижения в другое место?

C++:
void misc::keybinds()
{
    if (!g_cfg.menu.keybinds)
        return;

    std::vector<sperma> keybinds = {
        { g_cfg.antiaim.flip_desync, 16, "invert" },
        {g_cfg.misc.thirdperson_toggle, 17, "third person"},
        {g_cfg.antiaim.hide_shots_key, 12, "hide shots"},
        {g_cfg.misc.fakeduck_key, 20, "fake duck "},
        {g_cfg.misc.slowwalk_key, 21, "slow walk "},
        {g_cfg.ragebot.body_aim_key, 22, "body aim"},
        {g_cfg.ragebot.double_tap_key, 2, "double tap"},
        {g_cfg.ragebot.safe_point_key, 3, "safe points"},
        {g_cfg.misc.automatic_peek, 18, "auto peek"},
        {g_cfg.antiaim.manual_back, 13, "back manual"},
        {g_cfg.antiaim.manual_left, 14, "left manual"},
        {g_cfg.antiaim.manual_right, 15, "right manual"},
        {g_cfg.misc.edge_jump, 19, "edge jump"}
    };

    for (auto& keybind : keybinds) {
        update_keybind(keybind.keybind, keybind.id);
    }

    const auto time = m_globals()->m_realtime;
    constexpr auto anim_speed = 0.2f;

    auto pos = Vector2D(600, 200);
    auto size = Vector2D(140.f, 20.f);

    constexpr auto padding = 4.f;
    constexpr auto spacing = 4.f;
    constexpr auto line_size = 2.f;

    auto back_color = Color(0.f, 0.f, 0.f, 0.95f);
    auto text_color = Color(1.f, 1.f, 1.f, 0.95f);
    auto line_color = Color(0.6f, 0.8f, 1.f);

    auto last_expiration = 0.f;

    std::vector<sperma> active;
    for (auto &s2 : keybinds) {
        auto cal2 = &s2.keybind;

        const auto expiration = 1.f - (time - cal2->last_time_update) / anim_speed;

        last_expiration = max(last_expiration, expiration);

        if (expiration <= 0.f)
            continue;

        cal2->alpha = expiration * 255.f;

        active.push_back(s2);
    }

    if (active.empty())
        return;

    line_color.SetAlpha(last_expiration * 255.f);
    back_color.SetAlpha(last_expiration * 255.f);
    text_color.SetAlpha(last_expiration * 255.f);

    render::get().rect_filled(pos.x, pos.y, size.x, line_size, line_color);
    render::get().rect_filled(pos.x, pos.y + line_size, size.x, size.y - line_size, back_color);

    auto posay = pos + (size / 2.f);

    render::get().text(fonts[NAME], posay.x, posay.y, text_color, HFONT_CENTERED_X | HFONT_CENTERED_Y, m_xor_str("keybindings"));

    auto draw_pos = Vector2D(padding, size.y + spacing);
    auto draw_size = Vector2D(size.x - (padding * 2.f), 0.f);

    for (auto& data : active) {
        auto mode = data.keybind.mode == 0 ? "hold" : "toggle";
        const auto text_size = Vector2D(render::get().text_width(fonts[NAME], mode), render::get().text_heigth(fonts[NAME], mode));

        auto govon_pos = pos + draw_pos + draw_size;

        text_color.SetAlpha((int)data.keybind.alpha);

        render::get().text(fonts[NAME], pos.x + draw_pos.x, pos.y + draw_pos.y, text_color, HFONT_CENTERED_NONE, data.name);
        render::get().text(fonts[NAME], govon_pos.x - text_size.x, govon_pos.y, text_color, HFONT_CENTERED_NONE, mode);

        draw_pos.y += text_size.y + spacing;
    }
}
Лучше бы сделал их на имгуе
 
контора пидорасов
Забаненный
Статус
Оффлайн
Регистрация
1 Июл 2021
Сообщения
191
Реакции[?]
42
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Сверху Снизу