From d128489ba825741d5364f9afee91b244a91c0acb Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 15 Jul 2022 22:01:28 +0200 Subject: [PATCH] Added a %FILENAME% variable to extract the filename including the file extension when used in es_systems.xml --- es-app/src/FileData.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index dca55cd53..bc37847a0 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -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()));