2021-06-11 19:24:52 +02:00
|
|
|
// MassBuilderSaveTool
|
2024-03-08 20:25:32 +01:00
|
|
|
// Copyright (C) 2021-2024 Guillaume Jacquemin
|
2021-06-11 19:24:52 +02:00
|
|
|
//
|
|
|
|
// 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 <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#include <Corrade/version.h>
|
|
|
|
|
|
|
|
#include <Magnum/version.h>
|
|
|
|
#include <Magnum/versionIntegration.h>
|
|
|
|
#include <Magnum/ImGuiIntegration/Integration.h>
|
|
|
|
|
|
|
|
#include <zipconf.h>
|
|
|
|
|
2022-11-26 11:31:14 +01:00
|
|
|
#include <curl/curlver.h>
|
|
|
|
|
2021-06-11 19:24:52 +02:00
|
|
|
#include "../FontAwesome/IconsFontAwesome5.h"
|
|
|
|
#include "../FontAwesome/IconsFontAwesome5Brands.h"
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
#include "Application.h"
|
|
|
|
|
2021-06-11 19:24:52 +02:00
|
|
|
extern const ImVec2 center_pivot;
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
namespace mbst {
|
|
|
|
|
2022-12-03 16:49:39 +01:00
|
|
|
void
|
2023-11-29 12:33:26 +01:00
|
|
|
Application::drawAbout() {
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SetNextWindowPos(ImVec2{Vector2{windowSize() / 2.0f}}, ImGuiCond_Always, center_pivot);
|
2022-11-21 20:37:28 +01:00
|
|
|
ImGui::SetNextWindowSize({float(windowSize().x()) * 0.8f, float(windowSize().y()) * 0.75f}, ImGuiCond_Always);
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
ImGui::OpenPopup("About##AboutPopup");
|
|
|
|
if(!ImGui::BeginPopupModal("About##AboutPopup", &_aboutPopup,
|
|
|
|
ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoCollapse))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::BeginTable("##TitleTable", 3)) {
|
|
|
|
ImGui::TableSetupColumn("##Empty1", ImGuiTableColumnFlags_WidthStretch);
|
|
|
|
ImGui::TableSetupColumn("##Button", ImGuiTableColumnFlags_WidthFixed);
|
|
|
|
ImGui::TableSetupColumn("##Empty2", ImGuiTableColumnFlags_WidthStretch);
|
|
|
|
|
|
|
|
ImGui::TableNextRow();
|
|
|
|
ImGui::TableSetColumnIndex(1);
|
2021-07-13 18:46:21 +02:00
|
|
|
ImGui::TextUnformatted(SDL_GetWindowTitle(window()));
|
2021-06-11 19:24:52 +02:00
|
|
|
|
|
|
|
ImGui::EndTable();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::Dummy({0.0f, ImGui::GetFontSize()});
|
|
|
|
|
|
|
|
ImGui::TextWrapped("This application, made for the M.A.S.S. Builder community by Guillaume Jacquemin (aka William JCM), "
|
|
|
|
"is a rewrite of the wxWidgets-powered M.A.S.S. Builder Save Tool (formerly known as wxMASSManager).");
|
|
|
|
|
2023-11-29 12:33:26 +01:00
|
|
|
auto website = "https://williamjcm.ovh/mbst";
|
2022-03-31 19:19:59 +02:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", website);
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(website);
|
|
|
|
}
|
2023-12-04 15:24:05 +01:00
|
|
|
auto repo = "https://git.williamjcm.ovh/williamjcm/MassBuilderSaveTool";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GIT_ALT " %s", repo);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(repo);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(repo);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
if(ImGui::CollapsingHeader("Licence")) {
|
2023-11-29 13:12:18 +01:00
|
|
|
ImGui::TextWrapped("This application is made available under the terms of the GNU General Public License,"
|
|
|
|
"version 3, the full text of which is available below:");
|
2021-06-11 19:24:52 +02:00
|
|
|
|
2023-11-29 13:12:18 +01:00
|
|
|
if(ImGui::BeginChild("##GPL", {0.0f, float(windowSize().y()) * 0.3f}, ImGuiChildFlags_Border)) {
|
2022-03-04 21:18:55 +01:00
|
|
|
static auto licence = _rs.getRaw("COPYING");
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[1]);
|
2024-02-08 11:08:14 +01:00
|
|
|
ImGui::TextUnformatted(licence.cbegin(), licence.cend());
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::PopFont();
|
|
|
|
}
|
|
|
|
ImGui::EndChild();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::CollapsingHeader("Third-party components")) {
|
|
|
|
ImGui::TextWrapped("This application uses the following third-party components:");
|
|
|
|
|
|
|
|
ImGui::PushStyleVar(ImGuiStyleVar_IndentSpacing, 0.0f);
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("Corrade", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::Text("Version used: %s", CORRADE_VERSION_STRING);
|
2022-03-04 21:18:55 +01:00
|
|
|
auto corrade_website = "https://magnum.graphics/corrade";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", corrade_website);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(corrade_website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(corrade_website);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: MIT");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("Magnum and integration libraries", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::TextUnformatted("Versions used:");
|
|
|
|
ImGui::BulletText("Magnum: %s", MAGNUM_VERSION_STRING);
|
|
|
|
ImGui::BulletText("Integration: %s", MAGNUMINTEGRATION_VERSION_STRING);
|
2022-03-04 21:18:55 +01:00
|
|
|
auto magnum_website = "https://magnum.graphics";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", magnum_website);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(magnum_website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(magnum_website);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: MIT");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("Dear ImGui", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::Text("Version used: %s", IMGUI_VERSION);
|
2022-03-04 21:18:55 +01:00
|
|
|
auto imgui_repo = "https://github.com/ocornut/imgui";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GITHUB " %s", imgui_repo);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(imgui_repo);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(imgui_repo);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: MIT");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("Simple DirectMedia Layer (SDL) 2", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::Text("Version used: %i.%i.%i", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
2022-03-04 21:18:55 +01:00
|
|
|
auto sdl_website = "https://www.libsdl.org/";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", sdl_website);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(sdl_website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(sdl_website);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: zlib");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("libzip", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::Text("Version used: %s", LIBZIP_VERSION);
|
2022-03-04 21:18:55 +01:00
|
|
|
auto libzip_website = "https://libzip.org/";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", libzip_website);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(libzip_website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(libzip_website);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: 3-clause BSD");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("Entropia File System Watcher (efsw)", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
2022-03-04 21:18:55 +01:00
|
|
|
auto efsw_repo = "https://github.com/SpartanJ/efsw";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GITHUB " %s", efsw_repo);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
2022-03-06 09:25:23 +01:00
|
|
|
ImGui::SetClipboardText(efsw_repo);
|
2021-06-11 19:24:52 +02:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(efsw_repo);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: MIT");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2022-03-31 19:19:59 +02:00
|
|
|
if(ImGui::TreeNodeEx("libcurl", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
2022-11-26 11:31:14 +01:00
|
|
|
ImGui::Text("Version used: %s", LIBCURL_VERSION);
|
2022-03-31 19:19:59 +02:00
|
|
|
auto curl_website = "https://curl.se/libcurl";
|
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", curl_website);
|
2021-07-28 14:27:44 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
2022-03-31 19:19:59 +02:00
|
|
|
ImGui::SetClipboardText(curl_website);
|
2021-07-28 14:27:44 +02:00
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
2022-03-31 19:19:59 +02:00
|
|
|
openUri(curl_website);
|
2021-07-28 14:27:44 +02:00
|
|
|
}
|
|
|
|
|
2022-03-31 19:19:59 +02:00
|
|
|
ImGui::TextUnformatted("Licence: MIT/X derivative");
|
2021-07-28 14:27:44 +02:00
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2021-06-11 19:24:52 +02:00
|
|
|
if(ImGui::TreeNodeEx("Font Awesome", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
|
|
|
ImGui::TextUnformatted("Version used: 5.15.3");
|
2022-03-04 21:18:55 +01:00
|
|
|
auto fa_website = "https://fontawesome.com/";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GLOBE " %s", fa_website);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(fa_website);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(fa_website);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: SIL Open Font License 1.1");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(ImGui::TreeNodeEx("IconFontCppHeaders", ImGuiTreeNodeFlags_SpanAvailWidth)) {
|
2022-03-04 21:18:55 +01:00
|
|
|
auto icon_repo = "https://github.com/juliettef/IconFontCppHeaders";
|
2022-02-23 21:59:00 +01:00
|
|
|
drawAlignedText(ICON_FA_GITHUB " %s", icon_repo);
|
2021-06-11 19:24:52 +02:00
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Copy to clipboard")) {
|
|
|
|
ImGui::SetClipboardText(icon_repo);
|
|
|
|
}
|
|
|
|
ImGui::SameLine();
|
|
|
|
if(ImGui::Button("Open in browser")) {
|
|
|
|
openUri(icon_repo);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TextUnformatted("Licence: zlib");
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::PopStyleVar();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::EndPopup();
|
|
|
|
}
|
2023-11-29 12:33:26 +01:00
|
|
|
|
|
|
|
}
|