mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 10:30:46 +00:00
export fixes
This commit is contained in:
@@ -1036,6 +1036,7 @@ public class Main {
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
//args = new String[]{"-export", "script", "C:\\Projects\\FFDec\\FFDec\\exp", "C:\\Projects\\FFDec\\FFDec\\ATG_-_Reconstruction.v1696.swf"};
|
||||
clearTemp();
|
||||
String pluginPath = Configuration.pluginPath.get();
|
||||
if (pluginPath != null && !pluginPath.isEmpty()) {
|
||||
|
||||
@@ -1066,25 +1066,41 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
ret.add(tls.export(selFile, scriptMode, Configuration.parallelSpeedUp.get()));
|
||||
}
|
||||
} else {
|
||||
TagTreeModel ttm = (TagTreeModel) tagTree.getModel();
|
||||
List<ASMSource> asmsToExport = new ArrayList<>();
|
||||
getASMs(ttm, ttm.getScriptsNode(swf), as12scripts, false, asmsToExport);
|
||||
ret.addAll(new AS2ScriptExporter().exportAS2ScriptsTimeout(handler, selFile + File.separator + "scripts", asmsToExport, scriptMode, null));
|
||||
Map<String, ASMSource> asmsToExport = swf.getASMs(true, as12scripts, false);
|
||||
ret.addAll(new AS2ScriptExporter().exportAS2ScriptsTimeout(handler, selFile + File.separator + "scripts", asmsToExport, scriptMode, swf.getExportEventListener()));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static void getASMs(TagTreeModel ttm, TreeItem node, List<TreeItem> nodesToExport, boolean exportAll, List<ASMSource> asmsToExport) throws IOException {
|
||||
boolean exportNode = nodesToExport.contains(node);
|
||||
TreeItem realNode = node instanceof TagScript ? ((TagScript) node).getTag() : node;
|
||||
if (realNode instanceof ASMSource && (exportAll || exportNode)) {
|
||||
asmsToExport.add((ASMSource) realNode);
|
||||
}
|
||||
int childCount = ttm.getChildCount(node);
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
getASMs(ttm, ttm.getChild(node, i), nodesToExport, exportAll || exportNode, asmsToExport);
|
||||
public void exportAll(SWF swf, AbortRetryIgnoreHandler handler, String selFile, ExportDialog export) throws IOException {
|
||||
new ImageExporter().exportImages(handler, selFile + File.separator + "images", swf.tags,
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class)));
|
||||
new ShapeExporter().exportShapes(handler, selFile + File.separator + "shapes", swf.tags,
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom()));
|
||||
new MorphShapeExporter().exportMorphShapes(handler, selFile + File.separator + "morphshapes", swf.tags,
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom()));
|
||||
new TextExporter().exportTexts(handler, selFile + File.separator + "texts", swf.tags,
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom()));
|
||||
new MovieExporter().exportMovies(handler, selFile + File.separator + "movies", swf.tags,
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class)));
|
||||
new SoundExporter().exportSounds(handler, selFile + File.separator + "sounds", swf.tags,
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class)));
|
||||
new BinaryDataExporter().exportBinaryData(handler, selFile + File.separator + "binaryData", swf.tags,
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)));
|
||||
new FontExporter().exportFonts(handler, selFile + File.separator + "fonts", swf.tags,
|
||||
new FontExportSettings(export.getValue(FontExportMode.class)));
|
||||
swf.exportFrames(handler, selFile + File.separator + "frames", 0, null,
|
||||
new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()));
|
||||
for (CharacterTag c : swf.getCharacters().values()) {
|
||||
if (c instanceof DefineSpriteTag) {
|
||||
swf.exportFrames(handler, selFile + File.separator + "frames", c.getCharacterId(), null,
|
||||
new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()));
|
||||
}
|
||||
}
|
||||
|
||||
ScriptExportMode exportMode = export.getValue(ScriptExportMode.class);
|
||||
swf.exportActionScript(handler, selFile, exportMode, Configuration.parallelSpeedUp.get());
|
||||
}
|
||||
|
||||
public List<SWFList> getSwfs() {
|
||||
@@ -1620,7 +1636,6 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (selFile != null) {
|
||||
final long timeBefore = System.currentTimeMillis();
|
||||
Main.startWork(translate("work.exporting") + "...");
|
||||
final ScriptExportMode exportMode = export.getValue(ScriptExportMode.class);
|
||||
|
||||
new CancellableWorker() {
|
||||
@Override
|
||||
@@ -1629,31 +1644,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (onlySel) {
|
||||
exportSelection(errorHandler, selFile, export);
|
||||
} else {
|
||||
swf.exportImages(errorHandler, selFile + File.separator + "images",
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class)));
|
||||
swf.exportShapes(errorHandler, selFile + File.separator + "shapes",
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom()));
|
||||
swf.exportMorphShapes(errorHandler, selFile + File.separator + "morphshapes",
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom()));
|
||||
swf.exportTexts(errorHandler, selFile + File.separator + "texts",
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom()));
|
||||
swf.exportMovies(errorHandler, selFile + File.separator + "movies",
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class)));
|
||||
swf.exportSounds(errorHandler, selFile + File.separator + "sounds",
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class)));
|
||||
swf.exportBinaryData(errorHandler, selFile + File.separator + "binaryData",
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)));
|
||||
swf.exportFonts(errorHandler, selFile + File.separator + "fonts",
|
||||
new FontExportSettings(export.getValue(FontExportMode.class)));
|
||||
swf.exportFrames(errorHandler, selFile + File.separator + "frames", 0, null,
|
||||
new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()));
|
||||
for (CharacterTag c : swf.getCharacters().values()) {
|
||||
if (c instanceof DefineSpriteTag) {
|
||||
swf.exportFrames(errorHandler, selFile + File.separator + "frames", c.getCharacterId(), null,
|
||||
new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom()));
|
||||
}
|
||||
}
|
||||
swf.exportActionScript(errorHandler, selFile, exportMode, Configuration.parallelSpeedUp.get());
|
||||
exportAll(swf, errorHandler, selFile, export);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Error during export", ex);
|
||||
|
||||
@@ -249,7 +249,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene
|
||||
if ((txt != null) && (!txt.isEmpty())) {
|
||||
searchPanel.setOptions(ignoreCase, regexp);
|
||||
SWF swf = mainPanel.getCurrentSwf();
|
||||
Map<String, ASMSource> asms = swf.getASMs();
|
||||
Map<String, ASMSource> asms = swf.getASMs(false);
|
||||
final List<ActionSearchResult> found = new ArrayList<>();
|
||||
Pattern pat;
|
||||
if (regexp) {
|
||||
|
||||
@@ -254,50 +254,7 @@ public class TagTreeModel implements TreeModel {
|
||||
nodeList.add(new ClassesListTreeModel(swf));
|
||||
}
|
||||
} else {
|
||||
List<TreeItem> subNodes = new ArrayList<>();
|
||||
List<TreeItem> subFrames = new ArrayList<>();
|
||||
subNodes.addAll(timeline.getAS2RootPackage().subPackages.values());
|
||||
subNodes.addAll(timeline.getAS2RootPackage().scripts.values());
|
||||
|
||||
for (Tag tag : timeline.otherTags) {
|
||||
boolean hasInnerFrames = false;
|
||||
List<TreeItem> tagSubNodes = new ArrayList<>();
|
||||
if (tag instanceof Timelined) {
|
||||
Timeline timeline2 = ((Timelined) tag).getTimeline();
|
||||
for (Frame frame : timeline2.getFrames()) {
|
||||
if (!frame.actions.isEmpty() || !frame.actionContainers.isEmpty()) {
|
||||
FrameScript frameScript = new FrameScript(swf, frame);
|
||||
tagSubNodes.add(frameScript);
|
||||
hasInnerFrames = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tag instanceof ASMSourceContainer) {
|
||||
for (ASMSource asm : ((ASMSourceContainer) tag).getSubItems()) {
|
||||
tagSubNodes.add(asm);
|
||||
}
|
||||
}
|
||||
|
||||
if (!tagSubNodes.isEmpty()) {
|
||||
TagScript ts = new TagScript(swf, tag, tagSubNodes);
|
||||
tagScriptCache.put(tag, ts);
|
||||
if (hasInnerFrames) {
|
||||
subFrames.add(ts);
|
||||
} else {
|
||||
subNodes.add(ts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subNodes.addAll(subFrames);
|
||||
|
||||
for (Frame frame : timeline.getFrames()) {
|
||||
if (!frame.actions.isEmpty() || !frame.actionContainers.isEmpty()) {
|
||||
FrameScript frameScript = new FrameScript(swf, frame);
|
||||
subNodes.add(frameScript);
|
||||
}
|
||||
}
|
||||
List<TreeItem> subNodes = swf.getFirstLevelASMNodes(tagScriptCache);
|
||||
|
||||
if (subNodes.size() > 0) {
|
||||
TreeItem actionScriptNode = new FolderItem(translate("node.scripts"), FOLDER_SCRIPTS, swf, subNodes);
|
||||
|
||||
Reference in New Issue
Block a user