summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2023-09-30 06:55:43 -0700
committerGitHub <noreply@github.com>2023-09-30 08:55:43 -0500
commit6e50d7110a8ce176f47ee656bc3be77ac01116c2 (patch)
treec0bd733b82830ab13b7a25ad7bb19c3890c1ceb5
parent56deb1cf64d1a96dd24f33ecb432b9247f96a6fb (diff)
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.
-rw-r--r--soh/soh/SohMenuBar.cpp6
1 files changed, 6 insertions, 0 deletions
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();
}