From ba12f7aec936c353ea506e07c88fcbc95f4a52c6 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 2 Mar 2024 11:57:30 +0100 Subject: [PATCH] impr: Added testers to About screen --- plugins/builtin/source/content/ui_items.cpp | 1 + .../source/content/views/view_about.cpp | 70 ++++++++++++------- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/plugins/builtin/source/content/ui_items.cpp b/plugins/builtin/source/content/ui_items.cpp index e67270909..f0f85362b 100644 --- a/plugins/builtin/source/content/ui_items.cpp +++ b/plugins/builtin/source/content/ui_items.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/plugins/builtin/source/content/views/view_about.cpp b/plugins/builtin/source/content/views/view_about.cpp index 302f2d95b..7e798a579 100644 --- a/plugins/builtin/source/content/views/view_about.cpp +++ b/plugins/builtin/source/content/views/view_about.cpp @@ -235,32 +235,20 @@ namespace hex::plugin::builtin { ImGui::NewLine(); } - void ViewAbout::drawContributorPage() { - struct Contributor { - const char *name; - const char *description; - const char *link; - bool mainContributor; - }; - - constexpr static std::array Contributors = { - Contributor { "iTrooz", "A huge amount of help maintaining ImHex and the CI", "https://github.com/iTrooz", true }, - Contributor { "jumanji144", "A ton of help with the Pattern Language, API and usage stats", "https://github.com/Nowilltolife", true }, - Contributor { "Mary", "Porting ImHex to macOS originally", "https://github.com/marysaka", false }, - Contributor { "Roblabla", "Adding the MSI Windows installer", "https://github.com/roblabla", false }, - Contributor { "jam1garner", "Adding support for Rust plugins", "https://github.com/jam1garner", false }, - Contributor { "All other amazing contributors", "Being part of the community, opening issues, PRs and donating", "https://github.com/WerWolv/ImHex/graphs/contributors", false } - }; - - ImGuiExt::TextFormattedWrapped("These amazing people have contributed some incredible things to ImHex in the past.\nConsider opening a PR on the Git Repository to take your place among them!"); - ImGui::NewLine(); + struct Contributor { + const char *name; + const char *description; + const char *link; + bool mainContributor; + }; + static void drawContributorTable(const char *title, const auto &contributors) { ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2()); - ImGuiExt::BeginSubWindow("Contributors", ImVec2(ImGui::GetContentRegionAvail().x, 0), ImGuiChildFlags_AutoResizeX); + ImGuiExt::BeginSubWindow(title, ImVec2(ImGui::GetContentRegionAvail().x, 0), ImGuiChildFlags_AutoResizeX); ImGui::PopStyleVar(); { - if (ImGui::BeginTable("Contributors", 1, ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders)) { - for (const auto &contributor : Contributors) { + if (ImGui::BeginTable(title, 1, ImGuiTableFlags_RowBg | ImGuiTableFlags_Borders)) { + for (const auto &contributor : contributors) { ImGui::TableNextRow(); if (contributor.mainContributor) { ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, ImGui::GetColorU32(ImGuiCol_PlotHistogram) & 0x1FFFFFFF); @@ -270,10 +258,11 @@ namespace hex::plugin::builtin { if (ImGuiExt::Hyperlink(contributor.name)) hex::openWebpage(contributor.link); - ImGui::Indent(); - ImGui::TextUnformatted(contributor.description); - ImGui::Unindent(); - + if (contributor.description[0] != '\0') { + ImGui::Indent(); + ImGui::TextUnformatted(contributor.description); + ImGui::Unindent(); + } } ImGui::EndTable(); @@ -282,6 +271,35 @@ namespace hex::plugin::builtin { ImGuiExt::EndSubWindow(); } + void ViewAbout::drawContributorPage() { + constexpr static std::array Contributors = { + Contributor { "iTrooz", "A huge amount of help maintaining ImHex and the CI", "https://github.com/iTrooz", true }, + Contributor { "jumanji144", "A ton of help with the Pattern Language, API and usage stats", "https://github.com/jumanji144", true }, + Contributor { "Mary", "Porting ImHex to macOS originally", "https://github.com/marysaka", false }, + Contributor { "Roblabla", "Adding the MSI Windows installer", "https://github.com/roblabla", false }, + Contributor { "jam1garner", "Adding support for Rust plugins", "https://github.com/jam1garner", false }, + Contributor { "All other amazing contributors", "Being part of the community, opening issues, PRs and donating", "https://github.com/WerWolv/ImHex/graphs/contributors", false } + }; + + constexpr static std::array Testers = { + Contributor { "Nemoumbra", "Breaking my code literal seconds after I push it", "https://github.com/Nemoumbra", true }, + Contributor { "Berylskid", "", "https://github.com/Berylskid", false }, + Contributor { "Jan Polak", "", "https://github.com/polak-jan", false }, + Contributor { "Ken-Kaneki", "", "https://github.com/loneicewolf", false }, + Contributor { "Everybody who has reported issues", "Helping me find bugs and improve the software", "https://github.com/WerWolv/ImHex/issues", false } + + }; + + ImGuiExt::TextFormattedWrapped("These amazing people have contributed some incredible things to ImHex in the past.\nConsider opening a PR on the Git Repository to take your place among them!"); + ImGui::NewLine(); + drawContributorTable("Contributors", Contributors); + ImGui::NewLine(); + + ImGuiExt::TextFormattedWrapped("All of these great people made ImHex work much much smoother.\nConsider joining our Tester team to help making ImHex better for everyone!"); + ImGui::NewLine(); + drawContributorTable("Testers", Testers); + } + void ViewAbout::drawLibraryCreditsPage() { struct Library { const char *name;