From 9362df607865a939c763ef4865966bc5629631b0 Mon Sep 17 00:00:00 2001 From: Oleksandr Nemesh Date: Mon, 25 Mar 2024 21:43:24 +0200 Subject: [PATCH] Implement "Report Issue" button (#634) Currently, "Report an Issue" button, which can be found in the `ModInfoPopup` if `mod.json` contains `issues` property, doesn't do anything useful except opening crashlog directory. This changes it to actually open the specified URL in browser / crashlogs directory, instead of both buttons having the same action. --- loader/src/ui/internal/GeodeUI.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/loader/src/ui/internal/GeodeUI.cpp b/loader/src/ui/internal/GeodeUI.cpp index 0115ea37..a0cd1ccf 100644 --- a/loader/src/ui/internal/GeodeUI.cpp +++ b/loader/src/ui/internal/GeodeUI.cpp @@ -23,7 +23,16 @@ void geode::openIssueReportPopup(Mod* mod) { dirs::getCrashlogsDir().string() + "`", "OK", "Open Folder", [mod](bool btn2) { - file::openFolder(dirs::getCrashlogsDir()); + if (btn2) { + file::openFolder(dirs::getCrashlogsDir()); + return; + } + + auto issues = mod->getMetadata().getIssues(); + if (issues && issues.value().url) { + auto url = issues.value().url.value(); + web::openLinkInBrowser(url); + } } )->show(); }