Fixed: AS1/2 script export to single file maintains script order

This commit is contained in:
Jindra Petřík
2021-02-10 07:48:15 +01:00
parent c327c99198
commit 1c142ff42d
3 changed files with 9 additions and 3 deletions

View File

@@ -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<String, ASMSource> getASMs(boolean exportFileNames, List<TreeItem> nodesToExport, boolean exportAll) {
Map<String, ASMSource> asmsToExport = new HashMap<>();
Map<String, ASMSource> asmsToExport = new LinkedHashMap<>();
for (TreeItem treeItem : getFirstLevelASMNodes(null)) {
getASMs(exportFileNames, treeItem, nodesToExport, exportAll, asmsToExport, File.separator + getASMPath(exportFileNames, treeItem));
}

View File

@@ -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<ExportScriptTask> tasks = new ArrayList<>();
String[] keys = asms.keySet().toArray(new String[asms.size()]);
String[] keys = asms.keySet().toArray(new String[asms.size()]);
for (String key : keys) {
ASMSource asm = asms.get(key);
String currentOutDir = outdir + key + File.separator;