OnApplicationQuit

Hi all!

I'm looking for a place in the code where I can put a "export debug file" piece of text. I have the code that would export the debug file, and it's just a matter of "where to put this". I'd like for the file to export when the user quits the game, either by going back to the main menu, or by exiting the application entirely.

Does anyone know where this might be in the code? Thank you in advance!
You need to out a function call to that code when selecting game end.
You can set this up in the command window by adding an event listener for the Game End command so I would look that up.

Otherwise more frightening, you could do something like
GameWindowManager.onWindowClose = function() {
if(GameWindowManager._isWindowClosing) {
function call blah blah blah();
return;
}

I think that would work. I am not 100 percent sure though

Original thread: https://forums.rpgmakerweb.com/threads/onapplicationquit.122398/