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.
This commit is contained in:
Malkierian 2023-09-30 06:55:43 -07:00 committed by GitHub
parent 56deb1cf64
commit 6e50d7110a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,6 +156,12 @@ void DrawShipMenu() {
} }
#if !defined(__SWITCH__) && !defined(__WIIU__) #if !defined(__SWITCH__) && !defined(__WIIU__)
UIWidgets::Spacer(0); 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")) { if (ImGui::MenuItem("Quit")) {
LUS::Context::GetInstance()->GetWindow()->Close(); LUS::Context::GetInstance()->GetWindow()->Close();
} }