AutoUpdate image or a button to refresh the file

A button that refresh the file if edited by external software

so a button that closes and opens the current file when pressed, i think thats possible via scripts.

1 Like

Rather than a button, programs that have a Reload feature typically have it in the right-click menu on the document tab and/or in the File menu. I think those would be good places to put it in Aseprite too.

2 Likes

It can be done through scripts yeah but having that as a built-in feature would be awesome and also essential.

thats what i been saying a long time but no one ever cares.

Hi there! Actually there are two parts of this:

  1. a bug: if we modify a file externally, it would be nice to being asked in some way that the file was modified externally so we could run File > Revert automatically (the “auto update” part)
  2. and a feature: a File > Revert ("Revert" file menu option · Issue #2515 · aseprite/aseprite · GitHub) option to reload the image explicitly (in case the auto revert is not enabled).

There are some compilications that actually are “simplified” in the file handling in our code, for example, we can open the same file several times (sometimes probably this is needed, although not most of the times or not the expected behavior), so having the same file opened multiple times could generate a problem where the latest saved sprite is the one that will persist on the disk. And this behavior will conflict with this “auto revert.” From my point of view we have to:

  1. First we could implement the File > Revert option that looks the easiest one (although it’s really complex if we can support “Undo” of this operation)
  2. Disable the possibility to open the same file multiple times, or in case it’s done, an option is displayed to a) create a new view, or b) open it anyway with “auto revert”, or c) open it anyway with read-only (?)
  3. Create the “auto revert” to reload files that are modified externally (or we can being asked if we want to revert it if the change is detected)

I think it’s common for this action to clear the Undo stack. I would not expect to be able to Undo this. I wouldn’t call it “Revert” though, I think “Reload” is clearer. Revert sounds ;ole returning to the state the file was when it was opened (i.e. Undo everything), whereas the feature here is to load the file in its current state.

(1) and maybe an option for (3) would be best (make that option opt-in - auto-reload is a good way to lose a lot of work!). I’d much rather keep the ability to open the same file multiple times.