mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Improved custom script execution for the game-start and game-end events.
Also did some minor cosmetic changes to the script logging.
This commit is contained in:
parent
e4556f57ee
commit
5283881edf
|
@ -612,7 +612,7 @@ void FileData::launchGame(Window* window)
|
|||
std::wstring commandWide = Utils::String::stringToWideString(command);
|
||||
#endif
|
||||
|
||||
Scripting::fireEvent("game-start", rom, basename);
|
||||
Scripting::fireEvent("game-start", rom, getSourceFileData()->metadata.get("name"));
|
||||
int returnValue = 0;
|
||||
|
||||
if (command.find("%EMUPATH%") != std::string::npos) {
|
||||
|
@ -710,7 +710,7 @@ void FileData::launchGame(Window* window)
|
|||
#endif
|
||||
}
|
||||
|
||||
Scripting::fireEvent("game-end");
|
||||
Scripting::fireEvent("game-end", rom, getSourceFileData()->metadata.get("name"));
|
||||
|
||||
// Update number of times the game has been launched.
|
||||
FileData* gameToUpdate = getSourceFileData();
|
||||
|
|
|
@ -24,7 +24,8 @@ namespace Scripting
|
|||
if (!Settings::getInstance()->getBool("CustomEventScripts"))
|
||||
return;
|
||||
|
||||
LOG(LogDebug) << "fireEvent: " << eventName << " " << arg1 << " " << arg2;
|
||||
LOG(LogDebug) << "Scripting::fireEvent(): " << eventName << " \"" << arg1 <<
|
||||
"\" \"" << arg2 << "\"";
|
||||
|
||||
std::list<std::string> scriptDirList;
|
||||
std::string test;
|
||||
|
@ -41,7 +42,7 @@ namespace Scripting
|
|||
it != scripts.cend(); ++it) {
|
||||
// Append folder to path.
|
||||
std::string script = *it + " \"" + arg1 + "\" \"" + arg2 + "\"";
|
||||
LOG(LogDebug) << " executing: " << script;
|
||||
LOG(LogDebug) << "Executing: " << script;
|
||||
runSystemCommand(script);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue