script export from gui fixed (missing scripts)

This commit is contained in:
2015-01-21 18:14:54 +01:00
parent dfd3166bb9
commit d671837bf0
2 changed files with 19 additions and 2 deletions
@@ -80,6 +80,8 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag; import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
import com.jpexs.decompiler.flash.tags.DefineSoundTag; import com.jpexs.decompiler.flash.tags.DefineSoundTag;
import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
import com.jpexs.decompiler.flash.tags.DoActionTag;
import com.jpexs.decompiler.flash.tags.DoInitActionTag;
import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.FileAttributesTag;
import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.ASMSource;
@@ -971,6 +973,13 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
continue; continue;
} }
if (d instanceof TagScript) {
Tag tag = ((TagScript) d).getTag();
if (tag instanceof DoActionTag || tag instanceof DoInitActionTag) {
as12scripts.add(d);
}
}
if (d instanceof Tag || d instanceof ASMSource) { if (d instanceof Tag || d instanceof ASMSource) {
TreeNodeType nodeType = TagTree.getTreeNodeType(d); TreeNodeType nodeType = TagTree.getTreeNodeType(d);
if (nodeType == TreeNodeType.IMAGE) { if (nodeType == TreeNodeType.IMAGE) {
@@ -1068,8 +1077,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
private static void getASMs(TagTreeModel ttm, TreeItem node, List<TreeItem> nodesToExport, boolean exportAll, List<ASMSource> asmsToExport) throws IOException { private static void getASMs(TagTreeModel ttm, TreeItem node, List<TreeItem> nodesToExport, boolean exportAll, List<ASMSource> asmsToExport) throws IOException {
boolean exportNode = nodesToExport.contains(node); boolean exportNode = nodesToExport.contains(node);
if (node instanceof ASMSource && (exportAll || exportNode)) { TreeItem realNode = node instanceof TagScript ? ((TagScript) node).getTag() : node;
asmsToExport.add((ASMSource) node); if (realNode instanceof ASMSource && (exportAll || exportNode)) {
asmsToExport.add((ASMSource) realNode);
} }
int childCount = ttm.getChildCount(node); int childCount = ttm.getChildCount(node);
for (int i = 0; i < childCount; i++) { for (int i = 0; i < childCount; i++) {
@@ -474,6 +474,13 @@ public class TagTree extends JTree {
continue; continue;
} }
if (d instanceof TagScript) {
Tag tag = ((TagScript) d).getTag();
if (tag instanceof DoActionTag || tag instanceof DoInitActionTag) {
d = tag;
}
}
if (d instanceof Tag || d instanceof ASMSource) { if (d instanceof Tag || d instanceof ASMSource) {
TreeNodeType nodeType = TagTree.getTreeNodeType(d); TreeNodeType nodeType = TagTree.getTreeNodeType(d);
if (nodeType == TreeNodeType.IMAGE) { if (nodeType == TreeNodeType.IMAGE) {