Skip to content

Commit

Permalink
Add macros to <command> field in es_systems.cfg
Browse files Browse the repository at this point in the history
Adds `%ES_HOME%` and `%ROM_DIR%` macros to `<command>` fields in `es_systems.cfg`.

Fixes RetroPie#680.
  • Loading branch information
eib authored Sep 8, 2020
1 parent 55df3d8 commit 21cca55
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions es-app/src/FileData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,14 @@ void FileData::launchGame(Window* window)
const std::string rom = Utils::FileSystem::getEscapedPath(getPath());
const std::string basename = Utils::FileSystem::getStem(getPath());
const std::string rom_raw = Utils::FileSystem::getPreferredPath(getPath());
const std::string es_home = Utils::FileSystem::getHomePath();
const std::string rom_dir = Utils::FileSystem::getParent(getPath());

command = Utils::String::replace(command, "%ROM%", rom);
command = Utils::String::replace(command, "%BASENAME%", basename);
command = Utils::String::replace(command, "%ROM_RAW%", rom_raw);
command = Utils::String::replace(command, "%ES_HOME%", es_home);
command = Utils::String::replace(command, "%ROM_DIR%", rom_dir);

Scripting::fireEvent("game-start", rom, basename);

Expand Down

0 comments on commit 21cca55

Please sign in to comment.