Added a %FILENAME% variable to extract the filename including the file extension when used in es_systems.xml

This commit is contained in:
Leon Styhre 2022-07-15 22:01:28 +02:00
parent 403b986be7
commit d128489ba8

View file

@ -882,6 +882,7 @@ void FileData::launchGame()
}
}
const std::string fileName {baseName + Utils::FileSystem::getExtension(romPath)};
const std::string romRaw {Utils::FileSystem::getPreferredPath(mPath)};
const std::string esPath {Utils::FileSystem::getExePath()};
bool runInBackground {false};
@ -1484,6 +1485,7 @@ void FileData::launchGame()
// Replace the remaining variables with their actual values.
command = Utils::String::replace(command, "%ROM%", romPath);
command = Utils::String::replace(command, "%BASENAME%", baseName);
command = Utils::String::replace(command, "%FILENAME%", fileName);
command = Utils::String::replace(command, "%ROMRAW%", romRaw);
command = Utils::String::replace(command, "%ROMPATH%",
Utils::FileSystem::getEscapedPath(getROMDirectory()));