mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20: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);
|
std::wstring commandWide = Utils::String::stringToWideString(command);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Scripting::fireEvent("game-start", rom, basename);
|
Scripting::fireEvent("game-start", rom, getSourceFileData()->metadata.get("name"));
|
||||||
int returnValue = 0;
|
int returnValue = 0;
|
||||||
|
|
||||||
if (command.find("%EMUPATH%") != std::string::npos) {
|
if (command.find("%EMUPATH%") != std::string::npos) {
|
||||||
|
@ -710,7 +710,7 @@ void FileData::launchGame(Window* window)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Scripting::fireEvent("game-end");
|
Scripting::fireEvent("game-end", rom, getSourceFileData()->metadata.get("name"));
|
||||||
|
|
||||||
// Update number of times the game has been launched.
|
// Update number of times the game has been launched.
|
||||||
FileData* gameToUpdate = getSourceFileData();
|
FileData* gameToUpdate = getSourceFileData();
|
||||||
|
|
|
@ -24,7 +24,8 @@ namespace Scripting
|
||||||
if (!Settings::getInstance()->getBool("CustomEventScripts"))
|
if (!Settings::getInstance()->getBool("CustomEventScripts"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LOG(LogDebug) << "fireEvent: " << eventName << " " << arg1 << " " << arg2;
|
LOG(LogDebug) << "Scripting::fireEvent(): " << eventName << " \"" << arg1 <<
|
||||||
|
"\" \"" << arg2 << "\"";
|
||||||
|
|
||||||
std::list<std::string> scriptDirList;
|
std::list<std::string> scriptDirList;
|
||||||
std::string test;
|
std::string test;
|
||||||
|
@ -41,7 +42,7 @@ namespace Scripting
|
||||||
it != scripts.cend(); ++it) {
|
it != scripts.cend(); ++it) {
|
||||||
// Append folder to path.
|
// Append folder to path.
|
||||||
std::string script = *it + " \"" + arg1 + "\" \"" + arg2 + "\"";
|
std::string script = *it + " \"" + arg1 + "\" \"" + arg2 + "\"";
|
||||||
LOG(LogDebug) << " executing: " << script;
|
LOG(LogDebug) << "Executing: " << script;
|
||||||
runSystemCommand(script);
|
runSystemCommand(script);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue