feat(TopBar): Toggle main window

This commit is contained in:
Yimura 2021-05-21 02:28:14 +02:00
parent a69ea344dc
commit 7006e55558
3 changed files with 13 additions and 1 deletions

View File

@ -26,9 +26,14 @@ struct globals {
char vehicle_gun_model[12] = "bus";
};
struct window {
bool main = true;
};
self self{};
vehicle vehicle{};
weapons weapons{};
window window{};
void from_json(const nlohmann::json& j)
{

View File

@ -7,7 +7,7 @@ namespace big
void window::main()
{
ImGui::SetNextWindowSize({ 800, 840 }, ImGuiCond_FirstUseEver);
if (ImGui::Begin("Yimura's Mod Menu"))
if (g.window.main && ImGui::Begin("Yimura's Mod Menu", &g.window.main))
{
ImGui::BeginTabBar("tabbar");
tab_main::tab_self();

View File

@ -51,6 +51,13 @@ namespace big
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Windows"))
{
ImGui::MenuItem("Main Window", nullptr, &g.window.main);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Quit"))
{
if (ImGui::MenuItem("Unload Menu (may crash)"))