mirror of
https://github.com/RetroPie/EmulationStation.git
synced 2025-04-02 10:41:48 -04:00
Compare commits
2 commits
37281d5420
...
755bdb730b
Author | SHA1 | Date | |
---|---|---|---|
|
755bdb730b | ||
|
ed8482784e |
2 changed files with 8 additions and 0 deletions
|
@ -272,6 +272,10 @@ The following "tags" are replaced by ES in launch commands:
|
||||||
|
|
||||||
`%ROM_RAW%` - Replaced with the unescaped, absolute path to the selected ROM. If your emulator is picky about paths, you might want to use this instead of %ROM%, but enclosed in quotes.
|
`%ROM_RAW%` - Replaced with the unescaped, absolute path to the selected ROM. If your emulator is picky about paths, you might want to use this instead of %ROM%, but enclosed in quotes.
|
||||||
|
|
||||||
|
`%ROM_DIR%` - Replaced with the dirname (except "/base.ext") of the selected ROM. Use this when you need to chdir to the directory where the ROM.
|
||||||
|
|
||||||
|
`%ES_CFG%` - Replaced with the directory path of the EmulationStation configuration file contains (i.e. your .emulationstation directory). If .emulationstation is symlink, the link will resolved.
|
||||||
|
|
||||||
See [SYSTEMS.md](SYSTEMS.md) for some live examples in EmulationStation.
|
See [SYSTEMS.md](SYSTEMS.md) for some live examples in EmulationStation.
|
||||||
|
|
||||||
gamelist.xml
|
gamelist.xml
|
||||||
|
|
|
@ -291,10 +291,14 @@ void FileData::launchGame(Window* window)
|
||||||
const std::string basename = Utils::FileSystem::getStem(getPath());
|
const std::string basename = Utils::FileSystem::getStem(getPath());
|
||||||
const std::string rom_raw = Utils::FileSystem::getPreferredPath(getPath());
|
const std::string rom_raw = Utils::FileSystem::getPreferredPath(getPath());
|
||||||
const std::string name = getName();
|
const std::string name = getName();
|
||||||
|
const std::string rom_dir = Utils::FileSystem::getPreferredPath(Utils::FileSystem::getParent(getPath()));
|
||||||
|
const std::string es_cfg = Utils::FileSystem::getPreferredPath(Utils::FileSystem::getCanonicalPath(Utils::FileSystem::getHomePath() + "/.emulationstation"));
|
||||||
|
|
||||||
command = Utils::String::replace(command, "%ROM%", rom);
|
command = Utils::String::replace(command, "%ROM%", rom);
|
||||||
command = Utils::String::replace(command, "%BASENAME%", basename);
|
command = Utils::String::replace(command, "%BASENAME%", basename);
|
||||||
command = Utils::String::replace(command, "%ROM_RAW%", rom_raw);
|
command = Utils::String::replace(command, "%ROM_RAW%", rom_raw);
|
||||||
|
command = Utils::String::replace(command, "%ROM_DIR%", rom_dir);
|
||||||
|
command = Utils::String::replace(command, "%ES_CFG%", es_cfg);
|
||||||
|
|
||||||
Scripting::fireEvent("game-start", rom, basename, name);
|
Scripting::fireEvent("game-start", rom, basename, name);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue