Changed: AS1/2 - Single DoAction tag inside frame as frame node

This commit is contained in:
Jindra Petřík
2025-05-25 21:46:09 +02:00
parent ceee0afb12
commit 50b82c363f
10 changed files with 207 additions and 25 deletions
@@ -3276,18 +3276,22 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
}
} else if (treeItem instanceof FrameScript) {
FrameScript frameScript = (FrameScript) treeItem;
Frame parentFrame = frameScript.getFrame();
for (TreeItem subItem : parentFrame.actionContainers) {
getASMs(exportFileNames, getASMWrapToTagScript(subItem), nodesToExport, exportAll || exportNode, asmsToExport,
pathExportFilenames + File.separator + getASMPath(true, subItem),
pathNoExportFilenames + File.separator + getASMPath(false, subItem)
);
}
for (TreeItem subItem : parentFrame.actions) {
getASMs(exportFileNames, getASMWrapToTagScript(subItem), nodesToExport, exportAll || exportNode, asmsToExport,
pathExportFilenames + File.separator + getASMPath(true, subItem),
pathNoExportFilenames + File.separator + getASMPath(false, subItem)
);
if (frameScript.getSingleDoActionTag() != null && !exportFileNames) {
asmsToExport.put(pathNoExportFilenames, frameScript.getSingleDoActionTag());
} else {
Frame parentFrame = frameScript.getFrame();
for (TreeItem subItem : parentFrame.actionContainers) {
getASMs(exportFileNames, getASMWrapToTagScript(subItem), nodesToExport, exportAll || exportNode, asmsToExport,
pathExportFilenames + File.separator + getASMPath(true, subItem),
pathNoExportFilenames + File.separator + getASMPath(false, subItem)
);
}
for (TreeItem subItem : parentFrame.actions) {
getASMs(exportFileNames, getASMWrapToTagScript(subItem), nodesToExport, exportAll || exportNode, asmsToExport,
pathExportFilenames + File.separator + getASMPath(true, subItem),
pathNoExportFilenames + File.separator + getASMPath(false, subItem)
);
}
}
} else if (treeItem instanceof AS2Package) {
AS2Package as2Package = (AS2Package) treeItem;
@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.timeline;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.tags.DoActionTag;
import com.jpexs.decompiler.flash.tags.base.Exportable;
import com.jpexs.decompiler.flash.treeitems.Openable;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
@@ -70,8 +71,22 @@ public class FrameScript implements TreeItem, Exportable {
@Override
public String toString() {
if (getSingleDoActionTag() != null) {
return frame.toString() + " - " + "DoAction";
}
return frame.toString();
}
public DoActionTag getSingleDoActionTag() {
if (!frame.actionContainers.isEmpty()) {
return null;
}
if (frame.actions.size() != 1) {
return null;
}
return frame.actions.get(0);
}
/**
* Gets export filename.