Describe the bug
GBS doesn't reload BG graphics (and possibly sprites as well) while opened.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It loads the new modified image.
Possible solution
Reload and redraw backgrounds and other graphics whenever GB Studio's window gains focus.
+1
A reload button would be great.
Nah, just do it automatically whenever the window gains focus.
@darkhog Out of interest which version of GB Studio, what operating system are you using and what image editing software are you using?
Live reload of images has been a feature of GB Studio since the very first beta releases (you don't even need to refocus the window) interested to know if this isn't working for anyone else too. @RichardULZ same questions to you I suppose :-)
I'm using GBS 1.1, Windows 10 and Promotion NG as a graphic editor (great for pixel art, wholeheartedly recommend). Sometimes it works, but 90% of the time when I save and alt-tab to GBS it doesn't change the backgrounds in opened scenes, especially if there's size difference (well in the limits though).
Dnia 6 lipca 2019 14:36 Chris Maltby <[email protected]> napisał(a):
github.com @darkhog Out of interest which version of GB Studio, what operating system are you using and what image editing software are you using?
Live reload of images has been a feature of GB Studio since the very first beta releases (you don't even need to refocus the window) interested to know if this isn't working for anyone else too. github.com @RichardULZ same questions to you I suppose :-)
— You are receiving this because you were mentioned. Reply to this email directly, github.com view it on GitHub , or github.com mute the thread .
@chrismaltby
Windows 10, have noticed intermittent sucsess with automatic reloading in most versions of gbs.
I suppose it can depend on the programs used to edit files or if they are moved in from another location with windows explorer.
Only thought is how the files are compared? Perhaps it's checking date created instead of date modified, or only being checked for incrementing instead of any change? No idea.
I worry forced reloading everything on window focus could introduce lag, which would get worse with bigger scenes, but some form of forced reload would be good in rare cases.
@RichardULZ @darkhog
I finally had some extended time at a Windows PC and started debugging this issue. It turns out that the library I was using to watch for file changes chokidar actually fires change events when the file starts changing, not when it finishes changing. So what was happening was:
Depending on how long the image save takes and what you were doing in GB Studio at the time it's possible for GB Studio to reload the files after the save has finished which is when it was working.
Interestingly it seems in Windows if you read the file while it's being saved it consistently returns zero bytes, but on Mac/Linux this returned the full file data.
Either way the fix was to use an extra option in chokidar which detects for the file write being complete before notifying about the change.
I've also fixed a few other issues where deleted files weren't being removed from the UI until a refresh due to some filepath checks only checking posix style paths.
And if there is still any issues I've implemented a "Reload Assets" menu item under the file menu that just forces a reload.
These fixes should now be in the latest dev build.
Most helpful comment
@RichardULZ @darkhog
I finally had some extended time at a Windows PC and started debugging this issue. It turns out that the library I was using to watch for file changes chokidar actually fires change events when the file starts changing, not when it finishes changing. So what was happening was:
Depending on how long the image save takes and what you were doing in GB Studio at the time it's possible for GB Studio to reload the files after the save has finished which is when it was working.
Interestingly it seems in Windows if you read the file while it's being saved it consistently returns zero bytes, but on Mac/Linux this returned the full file data.
Either way the fix was to use an extra option in chokidar which detects for the file write being complete before notifying about the change.
I've also fixed a few other issues where deleted files weren't being removed from the UI until a refresh due to some filepath checks only checking posix style paths.
And if there is still any issues I've implemented a "Reload Assets" menu item under the file menu that just forces a reload.
These fixes should now be in the latest dev build.