mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
Store configuration file in AppData root if not in working directory
This fixes MacOS app bundles, as the emulator cannot write the config file into the app bundle.
This commit is contained in:
parent
8cc9bfbb36
commit
d24b780b7a
2 changed files with 6 additions and 1 deletions
|
@ -27,6 +27,7 @@ void EmulatorConfig::load() {
|
|||
return;
|
||||
}
|
||||
|
||||
printf("Loading existing configuration file %s\n", path.string().c_str());
|
||||
toml::value data;
|
||||
|
||||
try {
|
||||
|
|
|
@ -105,7 +105,11 @@ std::filesystem::path Emulator::getConfigPath() {
|
|||
if constexpr (Helpers::isAndroid()) {
|
||||
return getAndroidAppPath() / "config.toml";
|
||||
} else {
|
||||
return std::filesystem::current_path() / "config.toml";
|
||||
if (std::filesystem::exists(std::filesystem::current_path() / "config.toml")) {
|
||||
return std::filesystem::current_path() / "config.toml";
|
||||
} else {
|
||||
return getAppDataRoot() / "config.toml";
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue