furudean / vscode-renpy-warp

Launch and sync your Ren'Py game at the current line in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=PaisleySoftworks.renpyWarp
MIT License
3 stars 2 forks source link

Enable auto reloading of the game when a game file first is saved #16

Closed furudean closed 2 months ago

furudean commented 2 months ago

Send this signal via IPC. Gate behind an option.

brunoais commented 2 months ago

The way I implemented this ideology is by having an .rpe file whose autorun.py has:

import renpy
renpy.exports.set_autoreload(True)

This makes renpy start in autoreload mode. Because rpe files are run before .rpy files, it works without the need to raise an renpy.game.UtterRestartException. To note that the renpy.game.UtterRestartException can only be raised at least, during config.display_start_callbacks execution, otherwise Ren'Py crashes.

furudean commented 2 months ago

Check out #18, I implemented something similar. Though, with my own auto reload mechanism. Renpy's autoreload works poorly with what I was trying to build so it's a bit of a workaround. Still not sure how I feel about it yet

brunoais commented 2 months ago

If own renpy's autoload doesn't work for what you are trying to do, then I think your code is fine. You also cleaned up a bit which is nice. In my case, I don't have issues with renpy's own autoreload. I haven't encountered times it didn't work.

I think your code is fine.