From 6e50d7110a8ce176f47ee656bc3be77ac01116c2 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Sat, 30 Sep 2023 06:55:43 -0700 Subject: [PATCH] Open App Files Folder (#3221) * Add "Open App Files Folder" menu item to Ship menu on desktop platforms to open the folder where mods, logs, etc, are found. * Change to `GetAppDirectoryPath` to get config location instead of executable/bundle path. Also unified the absolute path creation across all platforms by using `std::filesystem::absolute`. It manages to even expand the "." returned for portable Windows mode. * Removed unnecessary platform define check. --- soh/soh/SohMenuBar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index f2f62c1cf..f129e0118 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -156,6 +156,12 @@ void DrawShipMenu() { } #if !defined(__SWITCH__) && !defined(__WIIU__) UIWidgets::Spacer(0); + if (ImGui::MenuItem("Open App Files Folder")) { + std::string filesPath = LUS::Context::GetInstance()->GetAppDirectoryPath(); + SDL_OpenURL(std::string("file:///" + std::filesystem::absolute(filesPath).string()).c_str()); + } + UIWidgets::Spacer(0); + if (ImGui::MenuItem("Quit")) { LUS::Context::GetInstance()->GetWindow()->Close(); }