fedes1to / Zygisk-ImGui-Menu

A template for an ImGui menu using Zygisk
GNU General Public License v3.0
140 stars 120 forks source link

I can't add new tabs to the menu. #11

Closed middle1 closed 11 months ago

middle1 commented 11 months ago

I tried to add a new tab using the same method as the first one was added, but this tab dips for a second, but then returns to the very first tab again. That's the code I tried again, but the result is the same. *it's the same with the checkbox

        static bool menu = false;
        Begin(OBFUSCATE("MiddleCheat"));
        ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_FittingPolicyResizeDown;
        if (BeginTabBar("Menu", tab_bar_flags)) {
            if (BeginTabItem(OBFUSCATE("Account"))) {
                if(Checkbox("turn on", &menu)){
                    // here menu stuff, remove test btw
                    Checkbox(OBFUSCATE("Everything unlocked"), &everythingUnlocked);
                }
            }
            if(BeginTabItem(OBFUSCATE("Other"))){
                Checkbox("tetgsqgsa", &chat);
                Text("Test window");
            }
            EndTabBar();
        }
        Patches();
        End();
    }
middle1 commented 11 months ago

I fixed all the errors with both tabs and CheckBox. In the tabs, you should have added EndTabItem(); at the very end. And there was a stupid mistake with the checkbox, the variable had to be declared outside the DrawMenu method.