adventuregamestudio / ags

AGS editor and engine source code
Other
697 stars 159 forks source link

Editor: failure to read an imported image does not prevent "Import Sprite" dialog #1358

Open ivan-mogilko opened 3 years ago

ivan-mogilko commented 3 years ago

Describe the bug If you try to import a malformed or unsupported image file, Editor will display an error, but then will open "Import Sprite" dialog anyway. That dialog will be "importing" an image from a placeholder sprite 0 instead.

AGS Version 3.5.0, 3.5.1, current master (3.6.0).

To Reproduce

  1. Find an unsuported image file, or simply create an empty file, and give it an extension expected by the Editor (.png, .bmp).
  2. In AGS editor open sprite manager, do "Import new sprites from files" and select that bad file.
  3. Observe error: "Unable to load image data from ". Click OK.
  4. Observe "Import Sprite" dialog still opens, having a copy of sprite 0 in it.

Expected behavior If error occured when trying to load an image file the Editor should not continue opening "Import Sprite" dialog.

ericoporto commented 1 year ago

https://github.com/adventuregamestudio/ags/pull/1916#issuecomment-1426791167

There's a suggestion here on how prevent that dialog from showing up.