Исходник Pandora.gg gui

Участник
Статус
Оффлайн
Регистрация
6 Апр 2021
Сообщения
343
Реакции[?]
216
Поинты[?]
122K
made this long time ago, i dont need it anymore, its not the og version i made for someone long time ago but it fits the request, its not 1:1 as i was too lazy to make smth premium, but its decent, i also seen some guys selling it and thats another reason why i share it

1731877800428.png
 

Вложения

Тьомчик
Участник
Статус
Оффлайн
Регистрация
30 Июн 2020
Сообщения
753
Реакции[?]
154
Поинты[?]
62K
everytime i found little bug when you using Multi drop down elements and click on second-third he's automatic close.
another is bug when you choose subtab and there is no second subtab in the other tab, you get a crash

subtab fix (shitcode) #1:
        // do input system
        if (g_utils.in_region(c_vector_2d(start_x, base.m_window_pos.y + 2), c_vector_2d(tab_pos.x, 20)) && ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
            elements.m_last_tab = elements.m_cur_tab;
            elements.m_cur_tab = tab.m_index;

            // reset the subtabs of the selected tab
            for (auto& t : elements.m_tabs) {
                if (t.m_index == elements.m_cur_tab) {
                    *t.m_active = 0; // reset to default subtab
                }
            }
        }
subtab fix (shitcode) #2:
    static int last_cur_tab = elements.m_cur_tab;

    if (elements.m_cur_tab != last_cur_tab) {
        last_cur_tab = elements.m_cur_tab; 
        *elements.m_tabs.at(elements.m_cur_tab).m_active = 0;              
    }
 
Последнее редактирование:
Тьомчик
Участник
Статус
Оффлайн
Регистрация
30 Июн 2020
Сообщения
753
Реакции[?]
154
Поинты[?]
62K
im catch a glitch of alpha after switch tabs but now its dont call crash and succesfully restore from second to first tab.
fixed tabs:
void tab_controller_t::invoke() {
    int start_x = base.m_window_pos.x + 100;

    if (elements.m_tabs.empty())
        return;

    if (elements.m_cur_tab < 0 || elements.m_cur_tab >= elements.m_tabs.size())
        elements.m_cur_tab = 0;

    auto& current_tab = elements.m_tabs.at(elements.m_cur_tab);

    int subtab_index = *current_tab.m_active;

    if (subtab_index < 0 || subtab_index >= current_tab.subtab.size())
        subtab_index = 0;

    int subtab_start_y = base.m_window_pos.y + 40;
    static int last_tab_index = -1;

    for (auto& tab : elements.m_tabs) {
        auto tab_pos = g_font.verdana.measure_size(tab.m_name);

        if (g_utils.in_region(c_vector_2d(start_x, base.m_window_pos.y + 2), c_vector_2d(tab_pos.x, 20)) &&
            ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
            elements.m_last_tab = elements.m_cur_tab;
            elements.m_cur_tab = tab.m_index;

            if (elements.m_cur_tab != last_tab_index) {

                for (auto& subtab : elements.m_tabs.at(elements.m_cur_tab).subtab)
                    *subtab.current_index = 0;

                *current_tab.m_active = 0;
                subtab_index = 0;
                current_tab.subtab.at(subtab_index).content();

                last_tab_index = elements.m_cur_tab;
            }
        }

        if (tab.m_index == elements.m_cur_tab) {
            for (auto& current_subtab : tab.subtab) {
                g_render_engine->gradient(base.m_window_pos.x + 17, subtab_start_y, 102, 18,
                    c_color(17, 17, 17, 255 * g_content.m_window_i_alpha),
                    c_color(9, 9, 9, 255 * g_content.m_window_i_alpha), e_gradient_flags::vertical);

                auto tabulia = g_anim_base.build(current_subtab.name + std::to_string(current_subtab.index) + "#subtab");
                tabulia.animate(tabulia.m_value + 3.f * g_anim_base.delta_time(0.5) *
                    (*current_subtab.current_index == current_subtab.index && g_content.m_window_i_alpha > 0.f ? 1.f : -1.f));

                g_render_engine->rect_filled(base.m_window_pos.x + 17, subtab_start_y, 1, 18,
                    base.m_theme.accent.modify_alpha(125 * g_content.m_window_i_alpha));
                g_render_engine->rect_filled(base.m_window_pos.x + 17, subtab_start_y, 1, 18,
                    base.m_theme.accent.modify_alpha(255 * tabulia.m_value));

                if (g_utils.in_region(c_vector_2d(base.m_window_pos.x + 17, subtab_start_y), c_vector_2d(102, 18)) &&
                    ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {


                    if (*current_subtab.current_index != current_subtab.index) {
                        *current_subtab.current_index = current_subtab.index;
                        *tab.m_active = current_subtab.index;
                        subtab_index = current_subtab.index;

                        current_tab.subtab.at(subtab_index).content();
                    }
                }

                g_font.verdana.string(base.m_window_pos.x + 24, subtab_start_y + 2, current_subtab.name,
                    c_color(112, 112, 112, 255 * g_content.m_window_i_alpha)
                    .blend(base.m_theme.accent.modify_alpha(255 * tabulia.m_value), tabulia.m_value));

                subtab_start_y += 21 * g_content.m_window_i_alpha;
            }
        }

        auto tab_active = g_anim_base.build(tab.m_name + std::to_string(tab.m_index));
        tab_active.animate(tab_active.m_value + 3.f * g_anim_base.delta_time(0.5) *
            (tab.m_index == elements.m_cur_tab && g_content.m_window_i_alpha > 0.f ? 1.f : -1.f));

        g_font.verdana.string(start_x, base.m_window_pos.y + 4, tab.m_name,
            c_color(112, 112, 112, 255 * g_content.m_window_i_alpha)
            .blend(base.m_theme.accent.modify_alpha(255 * tab_active.m_value), tab_active.m_value));

        start_x += tab_pos.x + 20 * g_content.m_window_i_alpha;
    }

    if (subtab_index >= 0 && subtab_index < current_tab.subtab.size())
        current_tab.subtab.at(subtab_index).content(); 
}
 
Сверху Снизу