// MassBuilderSaveTool // Copyright (C) 2021 Guillaume Jacquemin // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #include "SaveTool.h" #include #include "../FontAwesome/IconsFontAwesome5.h" #include "../FontAwesome/IconsFontAwesome5Brands.h" void SaveTool::drawMainMenu() { if(ImGui::BeginMainMenuBar()) { if(ImGui::BeginMenu("Save Tool##SaveToolMenu")) { if(ImGui::BeginMenu(ICON_FA_FOLDER_OPEN " Open data directory", _mbManager != nullptr)) { if(ImGui::MenuItem(ICON_FA_COG " Configuration", nullptr, false, _mbManager != nullptr)) { openUri(Utility::Directory::toNativeSeparators(_mbManager->saveDirectory() + "/Saved/Config/WindowsNoEditor")); } if(ImGui::MenuItem(ICON_FA_SAVE " Saves", nullptr, false, _profileManager != nullptr)) { openUri(Utility::Directory::toNativeSeparators(_profileManager->saveDirectory())); } static bool _screenshotsAvailable = Utility::Directory::exists(_mbManager->saveDirectory() + "/Saved/Screenshots/WindowsNoEditor"); if(ImGui::MenuItem(ICON_FA_IMAGE " Screenshots", nullptr, false, _screenshotsAvailable)) { openUri(Utility::Directory::toNativeSeparators(_mbManager->saveDirectory() + "/Screenshots/WindowsNoEditor")); } ImGui::EndMenu(); } ImGui::Separator(); if(ImGui::MenuItem(ICON_FA_SIGN_OUT_ALT " Quit##QuitMenuItem")) { exit(EXIT_SUCCESS); } ImGui::EndMenu(); } if(ImGui::BeginMenu("Game##GameMenu")) { if(ImGui::MenuItem(ICON_FA_PLAY " Run demo##RunDemoMenuItem")) { openUri("steam://run/1048390"); } drawTooltip("Will not work if you have the full game."); if(ImGui::MenuItem(ICON_FA_PLAY " Run full game##RunFullGameMenuItem")) { openUri("steam://run/956680"); } ImGui::Separator(); if(ImGui::BeginMenu(ICON_FA_DISCORD " Discord communities")) { if(ImGui::MenuItem("Official server")) { openUri("https://discord.gg/quS7E46"); } if(ImGui::MenuItem("Community server")) { openUri("https://discord.gg/YSSRTRB"); } ImGui::EndMenu(); } ImGui::EndMenu(); } #ifdef MANAGER_DEBUG_BUILD if(ImGui::BeginMenu("Debug tools")) { ImGui::MenuItem("ImGui demo window", nullptr, &_demoWindow); ImGui::MenuItem("ImGui style editor", nullptr, &_styleEditor); ImGui::MenuItem("ImGui metrics window", nullptr, &_metricsWindow); ImGui::EndMenu(); } #endif if(ImGui::BeginMenu("Help")) { ImGui::MenuItem(ICON_FA_INFO_CIRCLE " About", nullptr, &_aboutPopup); ImGui::EndMenu(); } if(_mbManager != nullptr) { if(ImGui::BeginTable("##MainMenuLayout", 2)) { ImGui::TableSetupColumn("##Dummy", ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn("##GameState", ImGuiTableColumnFlags_WidthFixed); ImGui::TableNextRow(); ImGui::TableSetColumnIndex(1); drawGameState(); ImGui::EndTable(); } } ImGui::EndMainMenuBar(); } }