Added the system name and full system name as arguments to the game-start and game-end custom events.

This commit is contained in:
Leon Styhre 2021-12-05 11:28:09 +01:00
parent 6e24c8d77b
commit 50a8edecf3

View file

@ -1090,7 +1090,9 @@ void FileData::launchGame(Window* window)
#endif
Renderer::swapBuffers();
Scripting::fireEvent("game-start", romPath, getSourceFileData()->metadata.get("name"));
Scripting::fireEvent("game-start", romPath, getSourceFileData()->metadata.get("name"),
getSourceFileData()->getSystem()->getName(),
getSourceFileData()->getSystem()->getFullName());
int returnValue = 0;
LOG(LogDebug) << "Raw emulator launch command:";
@ -1141,7 +1143,9 @@ void FileData::launchGame(Window* window)
#endif
}
Scripting::fireEvent("game-end", romPath, getSourceFileData()->metadata.get("name"));
Scripting::fireEvent("game-end", romPath, getSourceFileData()->metadata.get("name"),
getSourceFileData()->getSystem()->getName(),
getSourceFileData()->getSystem()->getFullName());
// Unless we're running in the background while the game is launched, re-enable the text
// scrolling that was disabled in ViewController.