From 4b5c4e8af4a3f0ef6a4bf4477fb0c947176e82da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Thu, 28 Sep 2023 10:51:59 +0200 Subject: [PATCH] Exporting compound scripts --- .../src/com/jpexs/decompiler/flash/abc/ScriptPack.java | 2 +- src/com/jpexs/decompiler/flash/gui/MainPanel.java | 7 +++++++ .../decompiler/flash/gui/tagtree/AbstractTagTree.java | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index ef262c67a..b2630cd23 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -137,7 +137,7 @@ public class ScriptPack extends AS3ClassTreeItem { } public String getPathScriptName() { - String scriptName = ""; + String scriptName = "script_" + scriptIndex; for (int t : traitIndices) { Multiname name = abc.script_info.get(scriptIndex).traits.traits.get(t).getName(abc); int nskind = name.getSimpleNamespaceKind(abc.constants); diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 3bb36ee60..aad3c328e 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -1960,6 +1960,13 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se if (d instanceof ScriptPack) { as3scripts.add((ScriptPack) d); } + + if (d instanceof AS3Package) { + AS3Package p = (AS3Package) d; + if (p.isCompoundScript()) { + as3scripts.add(p.getCompoundInitializerPack()); + } + } } for (Tag sprite : sprites) { diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java index 5a9ee5838..723a214bd 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java @@ -651,6 +651,12 @@ public abstract class AbstractTagTree extends JTree { if (d instanceof ScriptPack) { ret.add(d); } + if (d instanceof AS3Package) { + AS3Package p = (AS3Package)d; + if (p.isCompoundScript()) { + ret.add(d); + } + } } return ret; }