Skip to content

Commit

Permalink
Creature Animation Browser: Confirm overwriting on animation export
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Sep 6, 2022
1 parent 62a5542 commit 155e2e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/org/infinity/resource/cre/browser/MediaPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,11 @@ private void exportBamSequence() {
// TODO: The export operation is executed nearly instantaneously.
// However, for cleaner code it should be performed in a separate background task.
File saveFile = fileChooser.getSelectedFile();
if (saveFile.exists() &&
JOptionPane.showConfirmDialog(browser, "File already exists: " + saveFile.getName() +"\nOverwrite?", "Question",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) != JOptionPane.YES_OPTION) {
return;
}

try (APNGSeqWriter writer = new APNGSeqWriter(saveFile, 0)) {
final RenderPanel renderer = browser.getRenderPanel();
Expand Down

0 comments on commit 155e2e6

Please sign in to comment.