Вопрос Из за чего не рендерется норм менюшка

Забаненный
Забаненный
Статус
Оффлайн
Регистрация
13 Сен 2021
Сообщения
100
Реакции
23
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
1632679513589.png


Меню не двигается не рендерится табы хз почему




Код:
Expand Collapse Copy
void RenderRageTab() {
    ImGui::SetCursorPos(ImVec2(102, 35));
    ImGui::RenderFunctionChild("Main", ImVec2(306, 218));
    ImGui::SetCursorPos(ImVec2(112, 76));
    ImGui::BeginGroup(); {
        ImGui::PushFont(c_menu::get().Elements);
        ImGui::Checkbox("Enable ragebot", &rageCheckbox);
        ImGui::Checkbox("Silent Aim", &silentCheckbox);
        ImGui::SliderInt("FOV", &rageFov, 180, 360);
        ImGui::PushItemWidth(108);
        ImGui::Combo("Safe points", &safepointMode, safePoint, IM_ARRAYSIZE(safePoint));
        ImGui::PopItemWidth();
    }
    ImGui::EndGroup();
}

void c_menu::draw(bool is_open)
{
    static auto w = 0, h = 0, current_h = 0;
    m_engine()->GetScreenSize(w, current_h);

    if (h != current_h)
    {
        if (h)
            update_scripts = true;

        h = current_h;
        update_dpi = true;
    }


    static float m_alpha = 0.0002f;
    m_alpha = math::clamp(m_alpha + (3.f * ImGui::GetIO().DeltaTime * (is_open ? 1.f : -1.f)), 0.0001f, 1.f);


    public_alpha = m_alpha;

    if (m_alpha <= 0.0001f)
        return;

    ImGui::InitStyles();

    ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_alpha);

    static bool opened = true;

    IMGUI_CHECKVERSION();
    ImGui::CreateContext();

    if (!menu_setupped)
        menu_setup(ImGui::GetStyle());

        ImGui::SetNextWindowPos(ImVec2(0, 0));
        ImGui::SetNextWindowSize(ImVec2(LOADERW, LOADERH));
        ImGui::Begin("LamantineSDK", nullptr, ImGuiWindowFlags_NoDecoration  &opened | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoTitleBar);
        {
            ImGui::SetCursorPos(ImVec2(0, 0));
            ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(), ImVec2(60, 550), ImColor(46, 46, 72));
            ImGui::PushFont(Logo);
            ImGui::SetCursorPos(ImVec2(10, 9));
            ImGui::TextColored(ImColor(83, 115, 214), "8");

            ImGui::SetCursorPos(ImVec2(-2, 142));
            ImGui::BeginGroup(); {
                ImGui::tab("1", 1, "RAGEBOT");
                ImGui::Spacing();
                ImGui::tab("2", 2, u8"ANTI-AIM");
                ImGui::Spacing();
                ImGui::tab("3", 3, u8"VISUALS");
                ImGui::Spacing();
                ImGui::tab("4", 4, u8"WORLD");
                ImGui::Spacing();
                ImGui::tab("6", 5, u8"MISC");
            }
            ImGui::EndGroup();
            switch (active_tab) {
            case 1:
                RenderRageTab();
            }
        }
        ImGui::End();
   
}
 
А собственно зачем каждый фрейм создавать новый контекст?)
 
Посмотреть вложение 173464

Меню не двигается не рендерится табы хз почему




Код:
Expand Collapse Copy
void RenderRageTab() {
    ImGui::SetCursorPos(ImVec2(102, 35));
    ImGui::RenderFunctionChild("Main", ImVec2(306, 218));
    ImGui::SetCursorPos(ImVec2(112, 76));
    ImGui::BeginGroup(); {
        ImGui::PushFont(c_menu::get().Elements);
        ImGui::Checkbox("Enable ragebot", &rageCheckbox);
        ImGui::Checkbox("Silent Aim", &silentCheckbox);
        ImGui::SliderInt("FOV", &rageFov, 180, 360);
        ImGui::PushItemWidth(108);
        ImGui::Combo("Safe points", &safepointMode, safePoint, IM_ARRAYSIZE(safePoint));
        ImGui::PopItemWidth();
    }
    ImGui::EndGroup();
}

void c_menu::draw(bool is_open)
{
    static auto w = 0, h = 0, current_h = 0;
    m_engine()->GetScreenSize(w, current_h);

    if (h != current_h)
    {
        if (h)
            update_scripts = true;

        h = current_h;
        update_dpi = true;
    }


    static float m_alpha = 0.0002f;
    m_alpha = math::clamp(m_alpha + (3.f * ImGui::GetIO().DeltaTime * (is_open ? 1.f : -1.f)), 0.0001f, 1.f);


    public_alpha = m_alpha;

    if (m_alpha <= 0.0001f)
        return;

    ImGui::InitStyles();

    ImGui::PushStyleVar(ImGuiStyleVar_Alpha, m_alpha);

    static bool opened = true;

    IMGUI_CHECKVERSION();
    ImGui::CreateContext();

    if (!menu_setupped)
        menu_setup(ImGui::GetStyle());

        ImGui::SetNextWindowPos(ImVec2(0, 0));
        ImGui::SetNextWindowSize(ImVec2(LOADERW, LOADERH));
        ImGui::Begin("LamantineSDK", nullptr, ImGuiWindowFlags_NoDecoration  &opened | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoTitleBar);
        {
            ImGui::SetCursorPos(ImVec2(0, 0));
            ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(), ImVec2(60, 550), ImColor(46, 46, 72));
            ImGui::PushFont(Logo);
            ImGui::SetCursorPos(ImVec2(10, 9));
            ImGui::TextColored(ImColor(83, 115, 214), "8");

            ImGui::SetCursorPos(ImVec2(-2, 142));
            ImGui::BeginGroup(); {
                ImGui::tab("1", 1, "RAGEBOT");
                ImGui::Spacing();
                ImGui::tab("2", 2, u8"ANTI-AIM");
                ImGui::Spacing();
                ImGui::tab("3", 3, u8"VISUALS");
                ImGui::Spacing();
                ImGui::tab("4", 4, u8"WORLD");
                ImGui::Spacing();
                ImGui::tab("6", 5, u8"MISC");
            }
            ImGui::EndGroup();
            switch (active_tab) {
            case 1:
                RenderRageTab();
            }
        }
        ImGui::End();
  
}
Ещё раз скажу про это. ImGui::CreateContext(); будет вызываться каждый кадр
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу