mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Added %ESPATH% support to the ROMDirectory setting.
This commit is contained in:
parent
472a973f66
commit
29d2ccf201
|
@ -405,7 +405,13 @@ Here's an example:
|
|||
|
||||
`<string name="ROMDirectory" value="~/games/roms" />`
|
||||
|
||||
Keep in mind though that you still need to group the ROMs into directories corresponding to the system names. Well at least if you want to use the default es_systems.cfg file. See below how to customize that file, which gives you full control over the location of the ROMs.
|
||||
Keep in mind though that you still need to group the ROMs into directories corresponding to the platform names in es_systems.cfg.
|
||||
|
||||
There is also support to add the variable %ESPATH% to the ROM directory setting, this will expand to the path where the ES executable is started from. This is useful for a portable emulator installation, for example on a USB memory stick.
|
||||
|
||||
Here is such an example:
|
||||
|
||||
`<string name="ROMDirectory" value="%ESPATH%/../roms" />`
|
||||
|
||||
**Keep in mind that you have to set up your emulator separately from EmulationStation!**
|
||||
|
||||
|
|
|
@ -116,6 +116,11 @@ const std::string FileData::getROMDirectory()
|
|||
romDirPath = romDirPath + "/";
|
||||
}
|
||||
|
||||
// If %ESPATH% is used for the ROM path configuration, then expand it to the executable
|
||||
// directory of ES. This is useful for a portable emulator installation, for instance on
|
||||
// a USB memory stick.
|
||||
romDirPath = Utils::String::replace(romDirPath, "%ESPATH%", Utils::FileSystem::getExePath());
|
||||
|
||||
return romDirPath;
|
||||
}
|
||||
|
||||
|
@ -129,12 +134,10 @@ const std::string FileData::getMediaDirectory()
|
|||
}
|
||||
else {
|
||||
mediaDirPath = mediaDirSetting;
|
||||
|
||||
// Expand home path if ~ is used.
|
||||
mediaDirPath = Utils::FileSystem::expandHomePath(mediaDirPath);
|
||||
// Expand home symbol if the path starts with ~
|
||||
if (mediaDirPath[0] == '~') {
|
||||
mediaDirPath.erase(0, 1);
|
||||
mediaDirPath.insert(0, Utils::FileSystem::getHomePath());
|
||||
}
|
||||
|
||||
if (mediaDirPath.back() != '/')
|
||||
mediaDirPath = mediaDirPath + "/";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue