Гайд Как менять чекбоксы в лв

Я гуль...
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
20 Ноя 2020
Сообщения
132
Реакции
34
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Внимание щиткод!!
Я такой малодой и научился пастить чекбоксы
Идём в imgui/imgui_widgets.cpp,ищем bool ImGui::Checkbox(const char* label, bool* v)
Выделяем это все и удаляем
И теперь заменяем на своё
Пример(мой чекбокс)​
C++:
Expand Collapse Copy
bool ImGui::Checkbox(const char* label, bool* v)
{

    ImVec2 p = ImGui::GetCursorScreenPos() + ImVec2(0, 0);
    ImDrawList* draw_list = ImGui::GetWindowDrawList();

    float height = ImGui::GetFrameHeight();
    float width = height * 1.50f;
    float radius = height * 0.50f;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    ImGuiWindow* window = ImGui::GetCurrentWindow();
    const ImGuiID id = window->GetID(label);
    const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);

    const float square_sz = GetFrameHeight();
    const ImVec2 pos = window->DC.CursorPos;
    const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
    if (!ItemAdd(total_bb, id))
        return false;


    ImGui::InvisibleButton(label, ImVec2(190 + width, height));
    if (ImGui::IsItemClicked())
        *v = !*v;

    float t = *v ? 1.0f : 0.0f;


    ImU32 col_bg;
    ImU32 col_bg2;
    if (ImGui::IsItemHovered())
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }
    else
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }

    draw_list->AddRectFilled(ImVec2(p.x + 203, p.y + 4), ImVec2(p.x + 227, p.y + 15), col_bg, height * 0.5f);
    draw_list->AddCircleFilled(ImVec2(200 + p.x + radius + t * (width - radius * 2.0f), p.y + radius), radius - 2.5f, col_bg2);

    if (label_size.x > 1.0f)
    {
        ;
        ImGui::PushFont(c_menu::get().futura_small);
        ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f));
        RenderText(ImVec2((p.x + width) - 39, (p.y + height) - 16), label);
        ImGui::PopStyleColor(1);
        ImGui::PopFont();
    }

}
Ставим классы и делаем неверпиво в6
1610038999185.png
 
Внимание щиткод!!
Я такой малодой и научился пастить чекбоксы
Идём в imgui/imgui_widgets.cpp,ищем bool ImGui::Checkbox(const char* label, bool* v)
Выделяем это все и удаляем
И теперь заменяем на своё
Пример(мой чекбокс)​
C++:
Expand Collapse Copy
bool ImGui::Checkbox(const char* label, bool* v)
{

    ImVec2 p = ImGui::GetCursorScreenPos() + ImVec2(0, 0);
    ImDrawList* draw_list = ImGui::GetWindowDrawList();

    float height = ImGui::GetFrameHeight();
    float width = height * 1.50f;
    float radius = height * 0.50f;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    ImGuiWindow* window = ImGui::GetCurrentWindow();
    const ImGuiID id = window->GetID(label);
    const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);

    const float square_sz = GetFrameHeight();
    const ImVec2 pos = window->DC.CursorPos;
    const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f));
    if (!ItemAdd(total_bb, id))
        return false;


    ImGui::InvisibleButton(label, ImVec2(190 + width, height));
    if (ImGui::IsItemClicked())
        *v = !*v;

    float t = *v ? 1.0f : 0.0f;


    ImU32 col_bg;
    ImU32 col_bg2;
    if (ImGui::IsItemHovered())
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }
    else
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }

    draw_list->AddRectFilled(ImVec2(p.x + 203, p.y + 4), ImVec2(p.x + 227, p.y + 15), col_bg, height * 0.5f);
    draw_list->AddCircleFilled(ImVec2(200 + p.x + radius + t * (width - radius * 2.0f), p.y + radius), radius - 2.5f, col_bg2);

    if (label_size.x > 1.0f)
    {
        ;
        ImGui::PushFont(c_menu::get().futura_small);
        ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f));
        RenderText(ImVec2((p.x + width) - 39, (p.y + height) - 16), label);
        ImGui::PopStyleColor(1);
        ImGui::PopFont();
    }

}
Ставим классы и делаем неверпиво в6
Посмотреть вложение 123849
Спасибо!
10/10 пастеров. Хочу подметить,то что у кого iq > -1 сможет это и так сделать.
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Гайд о изменении чека, еще и с щит-кодом... Это сильно, спасибо. Гайд для бананов.
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Я хз каким не-до постеров нада быть что бы не знать как добавить чек бокс :NotLikeThis: :NotLikeThis:
 
гайд о чекбоксе с щиткодом. вот он - апокалипсис 2021 года :deilluminati:
 
Error LNK2001 unresolved external symbol "public: void __thiscall hit_chams::draw_hit_matrix(void)" (?draw_hit_matrix@hit_chams@@QAEXXZ) Kitsune C:\Users\dzero\OneDrive\Рабочий стол\kitsune (1)\kitsune\hooked_postscreeneffects.obj 1
всё делал правильно. Проверял
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Нахуя это нужно, если оно делает одно и то же?
Код:
Expand Collapse Copy
    ImU32 col_bg;
    ImU32 col_bg2;
    if (ImGui::IsItemHovered())
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }
    else
    {
        col_bg = ImGui::GetColorU32(ImLerp(ImColor(0, 0, 0), ImVec4(0.01f, 0.09f, 0.17f, 1.f), t));
        col_bg2 = ImGui::GetColorU32(ImLerp(ImColor(84, 83, 89, 255), ImVec4(0.3f, 0.6f, 1.f, 1.f), t));
    }


А это делается в одну строчку через window->DrawList->AddText
Код:
Expand Collapse Copy
        ImGui::PushFont(c_menu::get().futura_small);
        ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f));
        RenderText(ImVec2((p.x + width) - 39, (p.y + height) - 16), label);
        ImGui::PopStyleColor(1);
        ImGui::PopFont();
    }
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
1613919668867.png
 
Назад
Сверху Снизу