From 48bc0985d970d72f5b6fc9ac8e14b9472d3842d2 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 8 Dec 2023 14:46:32 +0100 Subject: [PATCH] impr: Make info banner open a web page --- plugins/builtin/source/content/welcome_screen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 540fe9df3..0a207bb18 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -348,6 +348,12 @@ namespace hex::plugin::builtin { ImGuiExt::BeginSubWindow("hex.builtin.welcome.header.info"_lang, ImVec2(), ImGuiChildFlags_AutoResizeX); { ImGui::Image(s_infoBannerTexture, ImVec2(width, width / s_infoBannerTexture.getAspectRatio())); + + if (ImGui::IsItemClicked()) { + hex::openWebpage(ImHexApiURL + hex::format("/info/{}/link", + ImHexApi::System::getOSName() | std::views::transform([](char c) { return std::tolower(c); }) + )); + } } ImGuiExt::EndSubWindow(); ImGui::PopStyleVar(); @@ -638,7 +644,7 @@ namespace hex::plugin::builtin { if (!s_infoBannerTexture.isValid()) { TaskManager::createBackgroundTask("Load banner", [](auto&) { HttpRequest request("GET", - ImHexApiURL + hex::format("/{}/info_banner", + ImHexApiURL + hex::format("/info/{}/image", ImHexApi::System::getOSName() | std::views::transform([](char c) { return std::tolower(c); }) ) );