From b9c9e65672a9ccfe1d697f7830d2e0537985b186 Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Wed, 1 May 2024 02:37:38 -0400 Subject: [PATCH] Changed save directory on linux to $HOME/.config/appname --- src/game/config.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/config.cpp b/src/game/config.cpp index 8194da3..59cb45d 100644 --- a/src/game/config.cpp +++ b/src/game/config.cpp @@ -143,7 +143,7 @@ std::filesystem::path recomp::get_app_folder_path() { } if (homedir != nullptr) { - recomp_dir = std::filesystem::path{homedir} / (std::u8string{u8"."} + std::u8string{recomp::program_id}); + recomp_dir = std::filesystem::path{homedir} / (std::u8string{u8".config/"} + std::u8string{recomp::program_id}); } #endif @@ -366,6 +366,10 @@ void recomp::load_config() { std::filesystem::path controls_path = recomp_dir / controls_filename; std::filesystem::path sound_path = recomp_dir / sound_filename; + if (!recomp_dir.empty()) { + std::filesystem::create_directories(recomp_dir); + } + if (std::filesystem::exists(general_path)) { load_general_config(general_path); }