Fixed #1782 FLA export - exporting from SWF files inside bundles (like binarysearch)

This commit is contained in:
Jindra Petřík
2022-11-03 08:43:03 +01:00
parent 62d24e344f
commit 80e557de2b
2 changed files with 17 additions and 5 deletions

View File

@@ -2416,9 +2416,19 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
fc.setCurrentDirectory(new File(selDir));
if (!selDir.endsWith(File.separator)) {
selDir += File.separator;
}
String swfShortName = swf.getShortFileName();
if ("".equals(swfShortName)) {
swfShortName = "untitled.swf";
}
String fileName = new File(swf.getFile()).getName();
fileName = fileName.substring(0, fileName.length() - 4) + ".fla";
String fileName;
if (swfShortName.contains(".")) {
fileName = swfShortName.substring(0, swfShortName.lastIndexOf(".")) + ".fla";
} else {
fileName = swfShortName + ".fla";
}
final String fSwfShortName = swfShortName;
fc.setSelectedFile(new File(selDir + fileName));
List<FileFilter> flaFilters = new ArrayList<>();
List<FileFilter> xflFilters = new ArrayList<>();
@@ -2484,9 +2494,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
try {
AbortRetryIgnoreHandler errorHandler = new GuiAbortRetryIgnoreHandler();
if (compressed) {
swf.exportFla(errorHandler, selfile.getAbsolutePath(), new File(swf.getFile()).getName(), ApplicationInfo.APPLICATION_NAME, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get(), selectedVersion);
swf.exportFla(errorHandler, selfile.getAbsolutePath(), fSwfShortName, ApplicationInfo.APPLICATION_NAME, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get(), selectedVersion);
} else {
swf.exportXfl(errorHandler, selfile.getAbsolutePath(), new File(swf.getFile()).getName(), ApplicationInfo.APPLICATION_NAME, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get(), selectedVersion);
swf.exportXfl(errorHandler, selfile.getAbsolutePath(), fSwfShortName, ApplicationInfo.APPLICATION_NAME, ApplicationInfo.applicationVerName, ApplicationInfo.version, Configuration.parallelSpeedUp.get(), selectedVersion);
}
} catch (Exception ex) {
logger.log(Level.SEVERE, "FLA export error", ex);