Исходник Aimware v4 menu.

Пользователь
Статус
Онлайн
Регистрация
8 Янв 2020
Сообщения
187
Реакции[?]
138
Поинты[?]
20K
Aimware v4 menu.

Из элементов есть только чекбоксы.
1695122810423.png
C++:
struct tab_data
{
    const char* tab_name;
    const char* tab_icon;
};

std::vector<tab_data> tab_list =
{
    { "LEGIT", "A" },
    { "RAGE", "A" },
    { "VISUALS", "B" },
    { "MISC", "C" },
    { "SKINS", "B" },
    { "SETTINGS", "F" },
    { "CONSOLE", "G" }
};

ImVec2 menu_position = ImVec2(50, 50);
ImVec2 menu_size = ImVec2(800, 600);

IDirect3DTexture9* aw_logo = nullptr;

ImFont* semi_bold_9 = nullptr;
ImFont* semi_bold_10 = nullptr;
ImFont* icons = nullptr;

int current_tab = 0;

void draw_tabs(ImVec2 tabs_position, std::vector<tab_data> tabs)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();
    ImVec2 next_position = tabs_position;

    for (auto i = 0; i < tabs.size(); i++)
    {
        ImVec2 tab_bar_rect_min = ImVec2(next_position.x, next_position.y);
        ImVec2 tab_bar_rect_max = ImVec2(next_position.x + 82, next_position.y + 52);

        bool tab_hovered = ImGui::IsMouseHoveringRect(tab_bar_rect_min, tab_bar_rect_max);
        bool tab_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

        if (tab_hovered && tab_clicked)
            current_tab = i;

        if (current_tab == i)
        {
            draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 200), ImColor(230, 35, 43, 200), ImColor(186, 35, 43, 255), ImColor(186, 35, 43, 255));
            draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
        }
        else
        {
            if (tab_hovered)
            {
                draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 150), ImColor(230, 35, 43, 150), ImColor(186, 35, 43, 150), ImColor(186, 35, 43, 150));
                draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
            }
            else
                draw->AddText(icons, 24.0f, ImVec2(tab_bar_rect_min.x + 41 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).x * 0.5f, tab_bar_rect_min.y + 26 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_icon);
        }

        next_position = ImVec2(next_position.x + 82, next_position.y);
    }
}

void draw_logo(ImVec2 pos)
{
    ImGui::GetWindowDrawList()->AddImage(aw_logo, ImVec2(pos.x, pos.y), ImVec2(pos.x + 200, pos.y + 45));
}

void draw_group(const char* text, ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 group_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 group_rect_max = ImVec2(group_rect_min.x + size.x, group_rect_min.y + size.y);

    draw->AddRectFilled(group_rect_min, group_rect_max, ImColor(235, 235, 235, 255));

    draw->AddRectFilled(ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.2f), ImVec2(group_rect_min.x + 15 + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).x, group_rect_min.y + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(235, 235, 235, 255));
    draw->AddText(semi_bold_10, 16.0f, ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(0, 0, 0, 255), text);

    draw_shadow(group_rect_min, group_rect_max, 50, 6);
}

void draw_checkbox(const char* text, bool* var, ImVec2 pos)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 checkbox_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 checkbox_rect_max = ImVec2(pos.x + 217, pos.y + 20);

    ImVec2 checkbox_main_rect_min = ImVec2(checkbox_rect_min.x + 4, checkbox_rect_min.y + 4);
    ImVec2 checkbox_main_rect_max = ImVec2(checkbox_main_rect_min.x + 12, checkbox_main_rect_min.y + 12);;

    bool is_hovered = ImGui::IsMouseHoveringRect(checkbox_rect_min, checkbox_rect_max);
    bool is_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

    if (is_hovered)
        draw->AddRectFilled(checkbox_rect_min, checkbox_rect_max, ImColor(0, 0, 0, 20), 3.0f);

    if (is_hovered && is_clicked)
        *var = !*var;

    ImColor checkbox_background_color = ImColor(254, 254, 254, 255);
    ImColor checkbox_outline_color = ImColor(220, 220, 220, 255);

    if (!*var)
    {
        if (is_hovered)
            checkbox_background_color = ImColor(244, 244, 244, 255);
    }
    else
    {
        checkbox_background_color = ImColor(180, 20, 20, 255);

        if (is_hovered)
            checkbox_background_color = ImColor(230, 35, 43, 255);
    }

    if (is_hovered || *var)
        checkbox_outline_color = ImColor(159, 30, 32, 255);

    draw->AddRectFilled(checkbox_main_rect_min, checkbox_main_rect_max, checkbox_outline_color, 3.0f);
    draw->AddRectFilled(ImVec2(checkbox_main_rect_min.x + 1, checkbox_main_rect_min.y + 1), ImVec2(checkbox_main_rect_max.x - 1, checkbox_main_rect_max.y - 1), checkbox_background_color, 3.0f);

    draw->AddText(semi_bold_10, 16.0f, ImVec2(checkbox_main_rect_max.x + 5, checkbox_rect_min.y + 6 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.3f), ImColor(0, 0, 0, 255), text);
}

bool test;

void draw_elements(ImVec2 pos)
{
    if (current_tab == 0)
    {
        draw_group("Aimbot", ImVec2(pos.x + 17, pos.y + 17), ImVec2(243, 300));
        draw_checkbox("Master Switch", &test, ImVec2(pos.x + 30, pos.y + 32));
    }
}

void draw_menu(ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 header_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 header_rect_max = ImVec2(pos.x + size.x, pos.y + 52);

    ImVec2 header_line_min = ImVec2(header_rect_min.x, header_rect_max.y);
    ImVec2 header_line_max = ImVec2(header_rect_max.x, header_rect_max.y + 4);

    ImVec2 shadow_line_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 shadow_line_max = ImVec2(header_line_max.x, header_line_max.y + 6);

    ImVec2 background_rect_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 background_rect_max = ImVec2(header_line_max.x, header_line_max.y + 524);

    ImVec2 footer_rect_min = ImVec2(background_rect_min.x, background_rect_max.y);
    ImVec2 footer_rect_max = ImVec2(background_rect_max.x, background_rect_max.y + 19);

    ImVec2 menu_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 menu_rect_max = ImVec2(pos.x + size.x, pos.y + size.y);

    ImVec2 menu_tab_bar_position = ImVec2(header_rect_min.x + 224, header_rect_min.y);

    ImGui::PushClipRect(menu_rect_min, menu_rect_max, false);

    draw->AddRectFilled(header_rect_min, header_rect_max, ImColor(170, 30, 26, 150));
    draw->AddRectFilled(header_line_min, header_line_max, ImColor(186, 35, 43, 255));

    draw_logo(ImVec2(header_rect_min.x + 9, header_rect_min.y + 4));

    draw->AddRectFilled(background_rect_min, background_rect_max, ImColor(225, 225, 225, 240));
    draw->AddRectFilled(footer_rect_min, footer_rect_max, ImColor(29, 29, 27, 200));

    draw->AddRectFilledMultiColor(shadow_line_min, shadow_line_max, ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 0), ImColor(0, 0, 0, 0));

    draw_tabs(menu_tab_bar_position, tab_list);

    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_min.x + 6, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "V4 for Counter-Strike: Global Offensive").y * 0.5f), ImColor(180, 180, 180, 255), "V4 for Counter-Strike: Global Offensive");
    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_max.x - 6 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").x, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").y * 0.5f), ImColor(180, 180, 180, 255), "https://aimware.net");

    draw_elements(background_rect_min);

    draw->AddRect(menu_rect_min, footer_rect_max, ImColor(0, 0, 0, 75));

    ImGui::PopClipRect();

    draw_shadow(menu_rect_min, menu_rect_max, 55, 5);
}

// imgui fonts init
D3DXCreateTextureFromFileInMemory(g_pd3dDevice, aimware_logo, sizeof(aimware_logo), &aw_logo);
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Начинающий
Статус
Оффлайн
Регистрация
8 Дек 2020
Сообщения
102
Реакции[?]
24
Поинты[?]
4K
у меня пару вопросов к void draw_checkbox(const char* text, bool* var, ImVec2 pos) ЧТО ЭТО??? зачем ты сделал отдельную функцию чек бокс так еще и нахуя тебе ImVec2 pos??
как хорошо жилось минуту назад
 
Пользователь
Статус
Онлайн
Регистрация
8 Янв 2020
Сообщения
187
Реакции[?]
138
Поинты[?]
20K
у меня пару вопросов к void draw_checkbox(const char* text, bool* var, ImVec2 pos) ЧТО ЭТО??? зачем ты сделал отдельную функцию чек бокс так еще и нахуя тебе ImVec2 pos??
как хорошо жилось минуту назад
Я еще не доделал его
 
Начинающий
Статус
Оффлайн
Регистрация
28 Авг 2023
Сообщения
175
Реакции[?]
24
Поинты[?]
24K
Aimware v4 menu.

Из элементов есть только чекбоксы.
C++:
struct tab_data
{
    const char* tab_name;
    const char* tab_icon;
};

std::vector<tab_data> tab_list =
{
    { "LEGIT", "A" },
    { "RAGE", "A" },
    { "VISUALS", "B" },
    { "MISC", "C" },
    { "SKINS", "B" },
    { "SETTINGS", "F" },
    { "CONSOLE", "G" }
};

ImVec2 menu_position = ImVec2(50, 50);
ImVec2 menu_size = ImVec2(800, 600);

IDirect3DTexture9* aw_logo = nullptr;

ImFont* semi_bold_9 = nullptr;
ImFont* semi_bold_10 = nullptr;
ImFont* icons = nullptr;

int current_tab = 0;

void draw_tabs(ImVec2 tabs_position, std::vector<tab_data> tabs)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();
    ImVec2 next_position = tabs_position;

    for (auto i = 0; i < tabs.size(); i++)
    {
        ImVec2 tab_bar_rect_min = ImVec2(next_position.x, next_position.y);
        ImVec2 tab_bar_rect_max = ImVec2(next_position.x + 82, next_position.y + 52);

        bool tab_hovered = ImGui::IsMouseHoveringRect(tab_bar_rect_min, tab_bar_rect_max);
        bool tab_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

        if (tab_hovered && tab_clicked)
            current_tab = i;

        if (current_tab == i)
        {
            draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 200), ImColor(230, 35, 43, 200), ImColor(186, 35, 43, 255), ImColor(186, 35, 43, 255));
            draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
        }
        else
        {
            if (tab_hovered)
            {
                draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 150), ImColor(230, 35, 43, 150), ImColor(186, 35, 43, 150), ImColor(186, 35, 43, 150));
                draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
            }
            else
                draw->AddText(icons, 24.0f, ImVec2(tab_bar_rect_min.x + 41 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).x * 0.5f, tab_bar_rect_min.y + 26 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_icon);
        }

        next_position = ImVec2(next_position.x + 82, next_position.y);
    }
}

void draw_logo(ImVec2 pos)
{
    ImGui::GetWindowDrawList()->AddImage(aw_logo, ImVec2(pos.x, pos.y), ImVec2(pos.x + 200, pos.y + 45));
}

void draw_group(const char* text, ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 group_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 group_rect_max = ImVec2(group_rect_min.x + size.x, group_rect_min.y + size.y);

    draw->AddRectFilled(group_rect_min, group_rect_max, ImColor(235, 235, 235, 255));

    draw->AddRectFilled(ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.2f), ImVec2(group_rect_min.x + 15 + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).x, group_rect_min.y + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(235, 235, 235, 255));
    draw->AddText(semi_bold_10, 16.0f, ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(0, 0, 0, 255), text);

    draw_shadow(group_rect_min, group_rect_max, 50, 6);
}

void draw_checkbox(const char* text, bool* var, ImVec2 pos)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 checkbox_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 checkbox_rect_max = ImVec2(pos.x + 217, pos.y + 20);

    ImVec2 checkbox_main_rect_min = ImVec2(checkbox_rect_min.x + 4, checkbox_rect_min.y + 4);
    ImVec2 checkbox_main_rect_max = ImVec2(checkbox_main_rect_min.x + 12, checkbox_main_rect_min.y + 12);;

    bool is_hovered = ImGui::IsMouseHoveringRect(checkbox_rect_min, checkbox_rect_max);
    bool is_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

    if (is_hovered)
        draw->AddRectFilled(checkbox_rect_min, checkbox_rect_max, ImColor(0, 0, 0, 20), 3.0f);

    if (is_hovered && is_clicked)
        *var = !*var;

    ImColor checkbox_background_color = ImColor(254, 254, 254, 255);
    ImColor checkbox_outline_color = ImColor(220, 220, 220, 255);

    if (!*var)
    {
        if (is_hovered)
            checkbox_background_color = ImColor(244, 244, 244, 255);
    }
    else
    {
        checkbox_background_color = ImColor(180, 20, 20, 255);

        if (is_hovered)
            checkbox_background_color = ImColor(230, 35, 43, 255);
    }

    if (is_hovered || *var)
        checkbox_outline_color = ImColor(159, 30, 32, 255);

    draw->AddRectFilled(checkbox_main_rect_min, checkbox_main_rect_max, checkbox_outline_color, 3.0f);
    draw->AddRectFilled(ImVec2(checkbox_main_rect_min.x + 1, checkbox_main_rect_min.y + 1), ImVec2(checkbox_main_rect_max.x - 1, checkbox_main_rect_max.y - 1), checkbox_background_color, 3.0f);

    draw->AddText(semi_bold_10, 16.0f, ImVec2(checkbox_main_rect_max.x + 5, checkbox_rect_min.y + 6 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.3f), ImColor(0, 0, 0, 255), text);
}

bool test;

void draw_elements(ImVec2 pos)
{
    if (current_tab == 0)
    {
        draw_group("Aimbot", ImVec2(pos.x + 17, pos.y + 17), ImVec2(243, 300));
        draw_checkbox("Master Switch", &test, ImVec2(pos.x + 30, pos.y + 32));
    }
}

void draw_menu(ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 header_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 header_rect_max = ImVec2(pos.x + size.x, pos.y + 52);

    ImVec2 header_line_min = ImVec2(header_rect_min.x, header_rect_max.y);
    ImVec2 header_line_max = ImVec2(header_rect_max.x, header_rect_max.y + 4);

    ImVec2 shadow_line_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 shadow_line_max = ImVec2(header_line_max.x, header_line_max.y + 6);

    ImVec2 background_rect_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 background_rect_max = ImVec2(header_line_max.x, header_line_max.y + 524);

    ImVec2 footer_rect_min = ImVec2(background_rect_min.x, background_rect_max.y);
    ImVec2 footer_rect_max = ImVec2(background_rect_max.x, background_rect_max.y + 19);

    ImVec2 menu_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 menu_rect_max = ImVec2(pos.x + size.x, pos.y + size.y);

    ImVec2 menu_tab_bar_position = ImVec2(header_rect_min.x + 224, header_rect_min.y);

    ImGui::PushClipRect(menu_rect_min, menu_rect_max, false);

    draw->AddRectFilled(header_rect_min, header_rect_max, ImColor(170, 30, 26, 150));
    draw->AddRectFilled(header_line_min, header_line_max, ImColor(186, 35, 43, 255));

    draw_logo(ImVec2(header_rect_min.x + 9, header_rect_min.y + 4));

    draw->AddRectFilled(background_rect_min, background_rect_max, ImColor(225, 225, 225, 240));
    draw->AddRectFilled(footer_rect_min, footer_rect_max, ImColor(29, 29, 27, 200));

    draw->AddRectFilledMultiColor(shadow_line_min, shadow_line_max, ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 0), ImColor(0, 0, 0, 0));

    draw_tabs(menu_tab_bar_position, tab_list);

    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_min.x + 6, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "V4 for Counter-Strike: Global Offensive").y * 0.5f), ImColor(180, 180, 180, 255), "V4 for Counter-Strike: Global Offensive");
    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_max.x - 6 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").x, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").y * 0.5f), ImColor(180, 180, 180, 255), "https://aimware.net");

    draw_elements(background_rect_min);

    draw->AddRect(menu_rect_min, footer_rect_max, ImColor(0, 0, 0, 75));

    ImGui::PopClipRect();

    draw_shadow(menu_rect_min, menu_rect_max, 55, 5);
}

// imgui fonts init
D3DXCreateTextureFromFileInMemory(g_pd3dDevice, aimware_logo, sizeof(aimware_logo), &aw_logo);
Пожалуйста, авторизуйтесь для просмотра ссылки.
2014 - 2015 - 2016
 
Эксперт
Статус
Оффлайн
Регистрация
14 Июл 2019
Сообщения
1,107
Реакции[?]
497
Поинты[?]
33K
PoC Life
Пользователь
Статус
Оффлайн
Регистрация
22 Авг 2022
Сообщения
335
Реакции[?]
47
Поинты[?]
37K
Затем, что модифицировать файлы ImGui - хуевая затея, ибо при обновлении может произойти полный пиздос.
пиздоса не будет, лично я не совсем понимаю людей которые редачат либу. Сделали бы себе класс элемента, список со значениями и класс рендера для каждого элемента, а так редачить либу не айс
 
Начинающий
Статус
Оффлайн
Регистрация
8 Дек 2020
Сообщения
102
Реакции[?]
24
Поинты[?]
4K
Затем, что модифицировать файлы ImGui - хуевая затея, ибо при обновлении может произойти полный пиздос.
тогда просто другой файл создать где будет твой гуй, и все таки сделать через ItemAdd
C++:
bool ImGui::Checkbox(const char* name, bool* callback)
{
    ImGuiWindow* window = GetCurrentWindow();

    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(name);
    const ImVec2 nameSize = CalcTextSize(name);
   
    const ImVec2 pos = window->DC.CursorPos;
    const ImRect total = ImRect(pos, pos + nameSize);

    ItemSize(total, style.FramePadding.y);
    if (!ItemAdd(total, id))
        return false;
   
    bool hovered, held;
    bool pressed = ButtonBehavior(total, id, &hovered, &held);
    if (pressed)
    {
        *callback = !(*callback);
        MarkItemEdited(id);
    }
   
    // render checkbox
   
    return pressed;
}
а то когда тебе все корды дает алах, ну не классно
 
Последнее редактирование:
HvH Legend
Пользователь
Статус
Онлайн
Регистрация
23 Окт 2022
Сообщения
391
Реакции[?]
96
Поинты[?]
26K
Aimware v4 menu.

Из элементов есть только чекбоксы.
C++:
struct tab_data
{
    const char* tab_name;
    const char* tab_icon;
};

std::vector<tab_data> tab_list =
{
    { "LEGIT", "A" },
    { "RAGE", "A" },
    { "VISUALS", "B" },
    { "MISC", "C" },
    { "SKINS", "B" },
    { "SETTINGS", "F" },
    { "CONSOLE", "G" }
};

ImVec2 menu_position = ImVec2(50, 50);
ImVec2 menu_size = ImVec2(800, 600);

IDirect3DTexture9* aw_logo = nullptr;

ImFont* semi_bold_9 = nullptr;
ImFont* semi_bold_10 = nullptr;
ImFont* icons = nullptr;

int current_tab = 0;

void draw_tabs(ImVec2 tabs_position, std::vector<tab_data> tabs)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();
    ImVec2 next_position = tabs_position;

    for (auto i = 0; i < tabs.size(); i++)
    {
        ImVec2 tab_bar_rect_min = ImVec2(next_position.x, next_position.y);
        ImVec2 tab_bar_rect_max = ImVec2(next_position.x + 82, next_position.y + 52);

        bool tab_hovered = ImGui::IsMouseHoveringRect(tab_bar_rect_min, tab_bar_rect_max);
        bool tab_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

        if (tab_hovered && tab_clicked)
            current_tab = i;

        if (current_tab == i)
        {
            draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 200), ImColor(230, 35, 43, 200), ImColor(186, 35, 43, 255), ImColor(186, 35, 43, 255));
            draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
        }
        else
        {
            if (tab_hovered)
            {
                draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 150), ImColor(230, 35, 43, 150), ImColor(186, 35, 43, 150), ImColor(186, 35, 43, 150));
                draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
            }
            else
                draw->AddText(icons, 24.0f, ImVec2(tab_bar_rect_min.x + 41 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).x * 0.5f, tab_bar_rect_min.y + 26 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_icon);
        }

        next_position = ImVec2(next_position.x + 82, next_position.y);
    }
}

void draw_logo(ImVec2 pos)
{
    ImGui::GetWindowDrawList()->AddImage(aw_logo, ImVec2(pos.x, pos.y), ImVec2(pos.x + 200, pos.y + 45));
}

void draw_group(const char* text, ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 group_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 group_rect_max = ImVec2(group_rect_min.x + size.x, group_rect_min.y + size.y);

    draw->AddRectFilled(group_rect_min, group_rect_max, ImColor(235, 235, 235, 255));

    draw->AddRectFilled(ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.2f), ImVec2(group_rect_min.x + 15 + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).x, group_rect_min.y + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(235, 235, 235, 255));
    draw->AddText(semi_bold_10, 16.0f, ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(0, 0, 0, 255), text);

    draw_shadow(group_rect_min, group_rect_max, 50, 6);
}

void draw_checkbox(const char* text, bool* var, ImVec2 pos)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 checkbox_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 checkbox_rect_max = ImVec2(pos.x + 217, pos.y + 20);

    ImVec2 checkbox_main_rect_min = ImVec2(checkbox_rect_min.x + 4, checkbox_rect_min.y + 4);
    ImVec2 checkbox_main_rect_max = ImVec2(checkbox_main_rect_min.x + 12, checkbox_main_rect_min.y + 12);;

    bool is_hovered = ImGui::IsMouseHoveringRect(checkbox_rect_min, checkbox_rect_max);
    bool is_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

    if (is_hovered)
        draw->AddRectFilled(checkbox_rect_min, checkbox_rect_max, ImColor(0, 0, 0, 20), 3.0f);

    if (is_hovered && is_clicked)
        *var = !*var;

    ImColor checkbox_background_color = ImColor(254, 254, 254, 255);
    ImColor checkbox_outline_color = ImColor(220, 220, 220, 255);

    if (!*var)
    {
        if (is_hovered)
            checkbox_background_color = ImColor(244, 244, 244, 255);
    }
    else
    {
        checkbox_background_color = ImColor(180, 20, 20, 255);

        if (is_hovered)
            checkbox_background_color = ImColor(230, 35, 43, 255);
    }

    if (is_hovered || *var)
        checkbox_outline_color = ImColor(159, 30, 32, 255);

    draw->AddRectFilled(checkbox_main_rect_min, checkbox_main_rect_max, checkbox_outline_color, 3.0f);
    draw->AddRectFilled(ImVec2(checkbox_main_rect_min.x + 1, checkbox_main_rect_min.y + 1), ImVec2(checkbox_main_rect_max.x - 1, checkbox_main_rect_max.y - 1), checkbox_background_color, 3.0f);

    draw->AddText(semi_bold_10, 16.0f, ImVec2(checkbox_main_rect_max.x + 5, checkbox_rect_min.y + 6 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.3f), ImColor(0, 0, 0, 255), text);
}

bool test;

void draw_elements(ImVec2 pos)
{
    if (current_tab == 0)
    {
        draw_group("Aimbot", ImVec2(pos.x + 17, pos.y + 17), ImVec2(243, 300));
        draw_checkbox("Master Switch", &test, ImVec2(pos.x + 30, pos.y + 32));
    }
}

void draw_menu(ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 header_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 header_rect_max = ImVec2(pos.x + size.x, pos.y + 52);

    ImVec2 header_line_min = ImVec2(header_rect_min.x, header_rect_max.y);
    ImVec2 header_line_max = ImVec2(header_rect_max.x, header_rect_max.y + 4);

    ImVec2 shadow_line_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 shadow_line_max = ImVec2(header_line_max.x, header_line_max.y + 6);

    ImVec2 background_rect_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 background_rect_max = ImVec2(header_line_max.x, header_line_max.y + 524);

    ImVec2 footer_rect_min = ImVec2(background_rect_min.x, background_rect_max.y);
    ImVec2 footer_rect_max = ImVec2(background_rect_max.x, background_rect_max.y + 19);

    ImVec2 menu_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 menu_rect_max = ImVec2(pos.x + size.x, pos.y + size.y);

    ImVec2 menu_tab_bar_position = ImVec2(header_rect_min.x + 224, header_rect_min.y);

    ImGui::PushClipRect(menu_rect_min, menu_rect_max, false);

    draw->AddRectFilled(header_rect_min, header_rect_max, ImColor(170, 30, 26, 150));
    draw->AddRectFilled(header_line_min, header_line_max, ImColor(186, 35, 43, 255));

    draw_logo(ImVec2(header_rect_min.x + 9, header_rect_min.y + 4));

    draw->AddRectFilled(background_rect_min, background_rect_max, ImColor(225, 225, 225, 240));
    draw->AddRectFilled(footer_rect_min, footer_rect_max, ImColor(29, 29, 27, 200));

    draw->AddRectFilledMultiColor(shadow_line_min, shadow_line_max, ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 0), ImColor(0, 0, 0, 0));

    draw_tabs(menu_tab_bar_position, tab_list);

    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_min.x + 6, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "V4 for Counter-Strike: Global Offensive").y * 0.5f), ImColor(180, 180, 180, 255), "V4 for Counter-Strike: Global Offensive");
    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_max.x - 6 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").x, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").y * 0.5f), ImColor(180, 180, 180, 255), "https://aimware.net");

    draw_elements(background_rect_min);

    draw->AddRect(menu_rect_min, footer_rect_max, ImColor(0, 0, 0, 75));

    ImGui::PopClipRect();

    draw_shadow(menu_rect_min, menu_rect_max, 55, 5);
}

// imgui fonts init
D3DXCreateTextureFromFileInMemory(g_pd3dDevice, aimware_logo, sizeof(aimware_logo), &aw_logo);
Пожалуйста, авторизуйтесь для просмотра ссылки.
+rep, ждём паст аирфлова с этим меню
 
Пользователь
Статус
Оффлайн
Регистрация
8 Дек 2018
Сообщения
529
Реакции[?]
118
Поинты[?]
31K
Aimware v4 menu.

Из элементов есть только чекбоксы.
C++:
struct tab_data
{
    const char* tab_name;
    const char* tab_icon;
};

std::vector<tab_data> tab_list =
{
    { "LEGIT", "A" },
    { "RAGE", "A" },
    { "VISUALS", "B" },
    { "MISC", "C" },
    { "SKINS", "B" },
    { "SETTINGS", "F" },
    { "CONSOLE", "G" }
};

ImVec2 menu_position = ImVec2(50, 50);
ImVec2 menu_size = ImVec2(800, 600);

IDirect3DTexture9* aw_logo = nullptr;

ImFont* semi_bold_9 = nullptr;
ImFont* semi_bold_10 = nullptr;
ImFont* icons = nullptr;

int current_tab = 0;

void draw_tabs(ImVec2 tabs_position, std::vector<tab_data> tabs)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();
    ImVec2 next_position = tabs_position;

    for (auto i = 0; i < tabs.size(); i++)
    {
        ImVec2 tab_bar_rect_min = ImVec2(next_position.x, next_position.y);
        ImVec2 tab_bar_rect_max = ImVec2(next_position.x + 82, next_position.y + 52);

        bool tab_hovered = ImGui::IsMouseHoveringRect(tab_bar_rect_min, tab_bar_rect_max);
        bool tab_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

        if (tab_hovered && tab_clicked)
            current_tab = i;

        if (current_tab == i)
        {
            draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 200), ImColor(230, 35, 43, 200), ImColor(186, 35, 43, 255), ImColor(186, 35, 43, 255));
            draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
        }
        else
        {
            if (tab_hovered)
            {
                draw->AddRectFilledMultiColor(tab_bar_rect_min, tab_bar_rect_max, ImColor(230, 35, 43, 150), ImColor(230, 35, 43, 150), ImColor(186, 35, 43, 150), ImColor(186, 35, 43, 150));
                draw->AddText(semi_bold_10, 16.0f, ImVec2(tab_bar_rect_min.x + 41 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).x * 0.5f, tab_bar_rect_min.y + 26 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, tabs.at(i).tab_name).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_name);
            }
            else
                draw->AddText(icons, 24.0f, ImVec2(tab_bar_rect_min.x + 41 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).x * 0.5f, tab_bar_rect_min.y + 26 - icons->CalcTextSizeA(24.0f, FLT_MAX, 0.0f, tabs.at(i).tab_icon).y * 0.5f), ImColor(255, 255, 255, 255), tabs.at(i).tab_icon);
        }

        next_position = ImVec2(next_position.x + 82, next_position.y);
    }
}

void draw_logo(ImVec2 pos)
{
    ImGui::GetWindowDrawList()->AddImage(aw_logo, ImVec2(pos.x, pos.y), ImVec2(pos.x + 200, pos.y + 45));
}

void draw_group(const char* text, ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 group_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 group_rect_max = ImVec2(group_rect_min.x + size.x, group_rect_min.y + size.y);

    draw->AddRectFilled(group_rect_min, group_rect_max, ImColor(235, 235, 235, 255));

    draw->AddRectFilled(ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.2f), ImVec2(group_rect_min.x + 15 + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).x, group_rect_min.y + semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(235, 235, 235, 255));
    draw->AddText(semi_bold_10, 16.0f, ImVec2(group_rect_min.x + 15, group_rect_min.y - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.5f), ImColor(0, 0, 0, 255), text);

    draw_shadow(group_rect_min, group_rect_max, 50, 6);
}

void draw_checkbox(const char* text, bool* var, ImVec2 pos)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 checkbox_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 checkbox_rect_max = ImVec2(pos.x + 217, pos.y + 20);

    ImVec2 checkbox_main_rect_min = ImVec2(checkbox_rect_min.x + 4, checkbox_rect_min.y + 4);
    ImVec2 checkbox_main_rect_max = ImVec2(checkbox_main_rect_min.x + 12, checkbox_main_rect_min.y + 12);;

    bool is_hovered = ImGui::IsMouseHoveringRect(checkbox_rect_min, checkbox_rect_max);
    bool is_clicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);

    if (is_hovered)
        draw->AddRectFilled(checkbox_rect_min, checkbox_rect_max, ImColor(0, 0, 0, 20), 3.0f);

    if (is_hovered && is_clicked)
        *var = !*var;

    ImColor checkbox_background_color = ImColor(254, 254, 254, 255);
    ImColor checkbox_outline_color = ImColor(220, 220, 220, 255);

    if (!*var)
    {
        if (is_hovered)
            checkbox_background_color = ImColor(244, 244, 244, 255);
    }
    else
    {
        checkbox_background_color = ImColor(180, 20, 20, 255);

        if (is_hovered)
            checkbox_background_color = ImColor(230, 35, 43, 255);
    }

    if (is_hovered || *var)
        checkbox_outline_color = ImColor(159, 30, 32, 255);

    draw->AddRectFilled(checkbox_main_rect_min, checkbox_main_rect_max, checkbox_outline_color, 3.0f);
    draw->AddRectFilled(ImVec2(checkbox_main_rect_min.x + 1, checkbox_main_rect_min.y + 1), ImVec2(checkbox_main_rect_max.x - 1, checkbox_main_rect_max.y - 1), checkbox_background_color, 3.0f);

    draw->AddText(semi_bold_10, 16.0f, ImVec2(checkbox_main_rect_max.x + 5, checkbox_rect_min.y + 6 - semi_bold_10->CalcTextSizeA(16.0f, FLT_MAX, 0.0f, text).y * 0.3f), ImColor(0, 0, 0, 255), text);
}

bool test;

void draw_elements(ImVec2 pos)
{
    if (current_tab == 0)
    {
        draw_group("Aimbot", ImVec2(pos.x + 17, pos.y + 17), ImVec2(243, 300));
        draw_checkbox("Master Switch", &test, ImVec2(pos.x + 30, pos.y + 32));
    }
}

void draw_menu(ImVec2 pos, ImVec2 size)
{
    ImDrawList* draw = ImGui::GetWindowDrawList();

    ImVec2 header_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 header_rect_max = ImVec2(pos.x + size.x, pos.y + 52);

    ImVec2 header_line_min = ImVec2(header_rect_min.x, header_rect_max.y);
    ImVec2 header_line_max = ImVec2(header_rect_max.x, header_rect_max.y + 4);

    ImVec2 shadow_line_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 shadow_line_max = ImVec2(header_line_max.x, header_line_max.y + 6);

    ImVec2 background_rect_min = ImVec2(header_line_min.x, header_line_max.y);
    ImVec2 background_rect_max = ImVec2(header_line_max.x, header_line_max.y + 524);

    ImVec2 footer_rect_min = ImVec2(background_rect_min.x, background_rect_max.y);
    ImVec2 footer_rect_max = ImVec2(background_rect_max.x, background_rect_max.y + 19);

    ImVec2 menu_rect_min = ImVec2(pos.x, pos.y);
    ImVec2 menu_rect_max = ImVec2(pos.x + size.x, pos.y + size.y);

    ImVec2 menu_tab_bar_position = ImVec2(header_rect_min.x + 224, header_rect_min.y);

    ImGui::PushClipRect(menu_rect_min, menu_rect_max, false);

    draw->AddRectFilled(header_rect_min, header_rect_max, ImColor(170, 30, 26, 150));
    draw->AddRectFilled(header_line_min, header_line_max, ImColor(186, 35, 43, 255));

    draw_logo(ImVec2(header_rect_min.x + 9, header_rect_min.y + 4));

    draw->AddRectFilled(background_rect_min, background_rect_max, ImColor(225, 225, 225, 240));
    draw->AddRectFilled(footer_rect_min, footer_rect_max, ImColor(29, 29, 27, 200));

    draw->AddRectFilledMultiColor(shadow_line_min, shadow_line_max, ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 150), ImColor(0, 0, 0, 0), ImColor(0, 0, 0, 0));

    draw_tabs(menu_tab_bar_position, tab_list);

    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_min.x + 6, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "V4 for Counter-Strike: Global Offensive").y * 0.5f), ImColor(180, 180, 180, 255), "V4 for Counter-Strike: Global Offensive");
    draw->AddText(semi_bold_9, 14.0f, ImVec2(footer_rect_max.x - 6 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").x, footer_rect_min.y + 9 - semi_bold_9->CalcTextSizeA(14.0f, FLT_MAX, 0.0f, "https://aimware.net").y * 0.5f), ImColor(180, 180, 180, 255), "https://aimware.net");

    draw_elements(background_rect_min);

    draw->AddRect(menu_rect_min, footer_rect_max, ImColor(0, 0, 0, 75));

    ImGui::PopClipRect();

    draw_shadow(menu_rect_min, menu_rect_max, 55, 5);
}

// imgui fonts init
D3DXCreateTextureFromFileInMemory(g_pd3dDevice, aimware_logo, sizeof(aimware_logo), &aw_logo);
Пожалуйста, авторизуйтесь для просмотра ссылки.
легче уже отсюда спастить :3
Osiris with Aimware menu fixed | Сайт читов, скриптов и кодов для онлайн игр - YouGame.Biz
 
Сверху Снизу