diff --git a/CHANGELOG.md b/CHANGELOG.md index 62977957d..da536f1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. ### Changed - AS3 pcode - Use Undefined as default keyword for value kind +### Fixed +- AS1/2 script export to single file maintains script order + ## [13.0.1] - 2021-02-09 ### Fixed - AS3 break loop in catch clause diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index 70fffa044..15226e9ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -184,6 +184,7 @@ import java.util.Date; import java.util.EmptyStackException; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -1702,7 +1703,7 @@ public final class SWF implements SWFContainerItem, Timelined { } public Map getASMs(boolean exportFileNames, List nodesToExport, boolean exportAll) { - Map asmsToExport = new HashMap<>(); + Map asmsToExport = new LinkedHashMap<>(); for (TreeItem treeItem : getFirstLevelASMNodes(null)) { getASMs(exportFileNames, treeItem, nodesToExport, exportAll, asmsToExport, File.separator + getASMPath(exportFileNames, treeItem)); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java index e1681969e..fddc9ad08 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.exporters.script; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; @@ -27,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -62,7 +64,7 @@ public class AS2ScriptExporter { int cnt = 1; List tasks = new ArrayList<>(); String[] keys = asms.keySet().toArray(new String[asms.size()]); - Arrays.sort(keys); + for (String key : keys) { ASMSource asm = asms.get(key); String currentOutDir = outdir + key + File.separator;