mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 08:00:46 +00:00
#798 ffdec doesn't show what it's exporting
This commit is contained in:
@@ -40,6 +40,7 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
|
||||
import com.jpexs.decompiler.flash.configuration.ConfigurationItem;
|
||||
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.FrameExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.ImageExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.MorphShapeExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.MovieExporter;
|
||||
@@ -909,14 +910,28 @@ public class CommandLineArgumentParser {
|
||||
|
||||
final Level level = traceLevel;
|
||||
exfile.addEventListener(new EventListener() {
|
||||
@Override
|
||||
public void handleExportingEvent(String type, int index, int count, Object data) {
|
||||
if (level.intValue() <= Level.FINE.intValue()) {
|
||||
String text = "Exporting ";
|
||||
if (type != null && type.length() > 0) {
|
||||
text += type + " ";
|
||||
}
|
||||
System.out.println(text + index + "/" + count + " " + data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleExportedEvent(String type, int index, int count, Object data) {
|
||||
String text = "Exported ";
|
||||
if (type != null && type.length() > 0) {
|
||||
text += type + " ";
|
||||
}
|
||||
System.out.println(text + index + "/" + count + " " + data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(String event, Object data) {
|
||||
if (level.intValue() <= Level.FINE.intValue() && event.equals("exporting")) {
|
||||
System.out.println((String) data);
|
||||
}
|
||||
if (event.equals("exported")) {
|
||||
System.out.println((String) data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -935,40 +950,41 @@ public class CommandLineArgumentParser {
|
||||
commandLineMode = true;
|
||||
boolean exportAll = exportFormats.contains("all");
|
||||
boolean multipleExportTypes = exportAll || exportFormats.size() > 1;
|
||||
EventListener evl = exfile.getExportEventListener();
|
||||
|
||||
if (exportAll || exportFormats.contains("image")) {
|
||||
System.out.println("Exporting images...");
|
||||
new ImageExporter().exportImages(handler, outDir + (multipleExportTypes ? File.separator + "images" : ""), extags, new ImageExportSettings(enumFromStr(formats.get("image"), ImageExportMode.class)));
|
||||
new ImageExporter().exportImages(handler, outDir + (multipleExportTypes ? File.separator + "images" : ""), extags, new ImageExportSettings(enumFromStr(formats.get("image"), ImageExportMode.class)), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("shape")) {
|
||||
System.out.println("Exporting shapes...");
|
||||
new ShapeExporter().exportShapes(handler, outDir + (multipleExportTypes ? File.separator + "shapes" : ""), extags, new ShapeExportSettings(enumFromStr(formats.get("shape"), ShapeExportMode.class), zoom));
|
||||
new ShapeExporter().exportShapes(handler, outDir + (multipleExportTypes ? File.separator + "shapes" : ""), extags, new ShapeExportSettings(enumFromStr(formats.get("shape"), ShapeExportMode.class), zoom), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("morphshape")) {
|
||||
System.out.println("Exporting morphshapes...");
|
||||
new MorphShapeExporter().exportMorphShapes(handler, outDir + (multipleExportTypes ? File.separator + "morphshapes" : ""), extags, new MorphShapeExportSettings(enumFromStr(formats.get("morphshape"), MorphShapeExportMode.class), zoom));
|
||||
new MorphShapeExporter().exportMorphShapes(handler, outDir + (multipleExportTypes ? File.separator + "morphshapes" : ""), extags, new MorphShapeExportSettings(enumFromStr(formats.get("morphshape"), MorphShapeExportMode.class), zoom), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("movie")) {
|
||||
System.out.println("Exporting movies...");
|
||||
new MovieExporter().exportMovies(handler, outDir + (multipleExportTypes ? File.separator + "movies" : ""), extags, new MovieExportSettings(enumFromStr(formats.get("movie"), MovieExportMode.class)));
|
||||
new MovieExporter().exportMovies(handler, outDir + (multipleExportTypes ? File.separator + "movies" : ""), extags, new MovieExportSettings(enumFromStr(formats.get("movie"), MovieExportMode.class)), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("font")) {
|
||||
System.out.println("Exporting fonts...");
|
||||
new FontExporter().exportFonts(handler, outDir + (multipleExportTypes ? File.separator + "fonts" : ""), extags, new FontExportSettings(enumFromStr(formats.get("font"), FontExportMode.class)));
|
||||
new FontExporter().exportFonts(handler, outDir + (multipleExportTypes ? File.separator + "fonts" : ""), extags, new FontExportSettings(enumFromStr(formats.get("font"), FontExportMode.class)), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("sound")) {
|
||||
System.out.println("Exporting sounds...");
|
||||
new SoundExporter().exportSounds(handler, outDir + (multipleExportTypes ? File.separator + "sounds" : ""), extags, new SoundExportSettings(enumFromStr(formats.get("sound"), SoundExportMode.class)));
|
||||
new SoundExporter().exportSounds(handler, outDir + (multipleExportTypes ? File.separator + "sounds" : ""), extags, new SoundExportSettings(enumFromStr(formats.get("sound"), SoundExportMode.class)), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("binarydata")) {
|
||||
System.out.println("Exporting binaryData...");
|
||||
new BinaryDataExporter().exportBinaryData(handler, outDir + (multipleExportTypes ? File.separator + "binaryData" : ""), extags, new BinaryDataExportSettings(enumFromStr(formats.get("binarydata"), BinaryDataExportMode.class)));
|
||||
new BinaryDataExporter().exportBinaryData(handler, outDir + (multipleExportTypes ? File.separator + "binaryData" : ""), extags, new BinaryDataExportSettings(enumFromStr(formats.get("binarydata"), BinaryDataExportMode.class)), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("text")) {
|
||||
@@ -977,7 +993,7 @@ public class CommandLineArgumentParser {
|
||||
if (singleTextFile == null) {
|
||||
singleTextFile = Configuration.textExportSingleFile.get();
|
||||
}
|
||||
new TextExporter().exportTexts(handler, outDir + (multipleExportTypes ? File.separator + "texts" : ""), extags, new TextExportSettings(enumFromStr(formats.get("text"), TextExportMode.class), singleTextFile, zoom));
|
||||
new TextExporter().exportTexts(handler, outDir + (multipleExportTypes ? File.separator + "texts" : ""), extags, new TextExportSettings(enumFromStr(formats.get("text"), TextExportMode.class), singleTextFile, zoom), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("frame")) {
|
||||
@@ -988,7 +1004,7 @@ public class CommandLineArgumentParser {
|
||||
frames.add(i);
|
||||
}
|
||||
}
|
||||
exfile.exportFrames(handler, outDir + (multipleExportTypes ? File.separator + "frames" : ""), 0, frames, new FramesExportSettings(enumFromStr(formats.get("frame"), FramesExportMode.class), zoom));
|
||||
new FrameExporter().exportFrames(handler, outDir + (multipleExportTypes ? File.separator + "frames" : ""), exfile, 0, frames, new FramesExportSettings(enumFromStr(formats.get("frame"), FramesExportMode.class), zoom), evl);
|
||||
}
|
||||
|
||||
if (exportAll || exportFormats.contains("script")) {
|
||||
@@ -999,10 +1015,10 @@ public class CommandLineArgumentParser {
|
||||
}
|
||||
if (!as3classes.isEmpty()) {
|
||||
for (String as3class : as3classes) {
|
||||
exportOK = exportOK && exfile.exportAS3Class(as3class, outDir, enumFromStr(formats.get("script"), ScriptExportMode.class), parallel);
|
||||
exportOK = exportOK && exfile.exportAS3Class(as3class, outDir, enumFromStr(formats.get("script"), ScriptExportMode.class), parallel, evl);
|
||||
}
|
||||
} else {
|
||||
exportOK = exportOK && exfile.exportActionScript(handler, outDir, enumFromStr(formats.get("script"), ScriptExportMode.class), parallel) != null;
|
||||
exportOK = exportOK && exfile.exportActionScript(handler, outDir, enumFromStr(formats.get("script"), ScriptExportMode.class), parallel, evl) != null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -358,10 +358,30 @@ public class Main {
|
||||
|
||||
swf.swfList = result;
|
||||
swf.addEventListener(new EventListener() {
|
||||
@Override
|
||||
public void handleExportingEvent(String type, int index, int count, Object data) {
|
||||
// todo honfika: localize
|
||||
String text = "Exporting ";
|
||||
if (type != null && type.length() > 0) {
|
||||
text += type + " ";
|
||||
}
|
||||
startWork(text + index + "/" + count + " " + data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleExportedEvent(String type, int index, int count, Object data) {
|
||||
// todo honfika: localize
|
||||
String text = "Exported ";
|
||||
if (type != null && type.length() > 0) {
|
||||
text += type + " ";
|
||||
}
|
||||
startWork(text + index + "/" + count + " " + data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(String event, Object data) {
|
||||
if (event.equals("exporting")) {
|
||||
startWork((String) data);
|
||||
if (event.equals("exporting") || event.equals("exported")) {
|
||||
throw new Error("Event is not supported by this handler.");
|
||||
}
|
||||
if (event.equals("getVariables")) {
|
||||
startWork(AppStrings.translate("work.gettingvariables") + "..." + (String) data);
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler;
|
||||
import com.jpexs.decompiler.flash.ApplicationInfo;
|
||||
import com.jpexs.decompiler.flash.EventListener;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.SWFBundle;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
@@ -31,6 +32,7 @@ import com.jpexs.decompiler.flash.dumpview.DumpInfo;
|
||||
import com.jpexs.decompiler.flash.dumpview.DumpInfoSwfNode;
|
||||
import com.jpexs.decompiler.flash.exporters.BinaryDataExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.FontExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.FrameExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.ImageExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.MorphShapeExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.MovieExporter;
|
||||
@@ -1037,27 +1039,30 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
}
|
||||
|
||||
EventListener evl = swf.getExportEventListener();
|
||||
|
||||
final ScriptExportMode scriptMode = export.getValue(ScriptExportMode.class);
|
||||
ret.addAll(new ImageExporter().exportImages(handler, selFile + File.separator + "images", images,
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class))));
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class)), evl));
|
||||
ret.addAll(new ShapeExporter().exportShapes(handler, selFile + File.separator + "shapes", shapes,
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom())));
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom()), evl));
|
||||
ret.addAll(new MorphShapeExporter().exportMorphShapes(handler, selFile + File.separator + "morphshapes", morphshapes,
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom())));
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom()), evl));
|
||||
ret.addAll(new TextExporter().exportTexts(handler, selFile + File.separator + "texts", texts,
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom())));
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom()), evl));
|
||||
ret.addAll(new MovieExporter().exportMovies(handler, selFile + File.separator + "movies", movies,
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class))));
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class)), evl));
|
||||
ret.addAll(new SoundExporter().exportSounds(handler, selFile + File.separator + "sounds", sounds,
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class))));
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class)), evl));
|
||||
ret.addAll(new BinaryDataExporter().exportBinaryData(handler, selFile + File.separator + "binaryData", binaryData,
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class))));
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)), evl));
|
||||
ret.addAll(new FontExporter().exportFonts(handler, selFile + File.separator + "fonts", fonts,
|
||||
new FontExportSettings(export.getValue(FontExportMode.class))));
|
||||
new FontExportSettings(export.getValue(FontExportMode.class)), evl));
|
||||
|
||||
FrameExporter frameExporter = new FrameExporter();
|
||||
FramesExportSettings fes = new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom());
|
||||
for (Entry<Integer, List<Integer>> entry : frames.entrySet()) {
|
||||
ret.addAll(swf.exportFrames(handler, selFile + File.separator + "frames", entry.getKey(), entry.getValue(),
|
||||
new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom())));
|
||||
ret.addAll(frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, entry.getKey(), entry.getValue(), fes, evl));
|
||||
}
|
||||
|
||||
if (swf.isAS3()) {
|
||||
@@ -1068,40 +1073,42 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
}
|
||||
} else {
|
||||
Map<String, ASMSource> asmsToExport = swf.getASMs(true, as12scripts, false);
|
||||
ret.addAll(new AS2ScriptExporter().exportAS2ScriptsTimeout(handler, selFile + File.separator + "scripts", asmsToExport, scriptMode, swf.getExportEventListener()));
|
||||
ret.addAll(new AS2ScriptExporter().exportAS2ScriptsTimeout(handler, selFile + File.separator + "scripts", asmsToExport, scriptMode, evl));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void exportAll(SWF swf, AbortRetryIgnoreHandler handler, String selFile, ExportDialog export) throws IOException {
|
||||
EventListener evl = swf.getExportEventListener();
|
||||
new ImageExporter().exportImages(handler, selFile + File.separator + "images", swf.tags,
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class)));
|
||||
new ImageExportSettings(export.getValue(ImageExportMode.class)), evl);
|
||||
new ShapeExporter().exportShapes(handler, selFile + File.separator + "shapes", swf.tags,
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom()));
|
||||
new ShapeExportSettings(export.getValue(ShapeExportMode.class), export.getZoom()), evl);
|
||||
new MorphShapeExporter().exportMorphShapes(handler, selFile + File.separator + "morphshapes", swf.tags,
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom()));
|
||||
new MorphShapeExportSettings(export.getValue(MorphShapeExportMode.class), export.getZoom()), evl);
|
||||
new TextExporter().exportTexts(handler, selFile + File.separator + "texts", swf.tags,
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom()));
|
||||
new TextExportSettings(export.getValue(TextExportMode.class), Configuration.textExportSingleFile.get(), export.getZoom()), evl);
|
||||
new MovieExporter().exportMovies(handler, selFile + File.separator + "movies", swf.tags,
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class)));
|
||||
new MovieExportSettings(export.getValue(MovieExportMode.class)), evl);
|
||||
new SoundExporter().exportSounds(handler, selFile + File.separator + "sounds", swf.tags,
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class)));
|
||||
new SoundExportSettings(export.getValue(SoundExportMode.class)), evl);
|
||||
new BinaryDataExporter().exportBinaryData(handler, selFile + File.separator + "binaryData", swf.tags,
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)));
|
||||
new BinaryDataExportSettings(export.getValue(BinaryDataExportMode.class)), evl);
|
||||
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()));
|
||||
new FontExportSettings(export.getValue(FontExportMode.class)), evl);
|
||||
|
||||
FrameExporter frameExporter = new FrameExporter();
|
||||
FramesExportSettings fes = new FramesExportSettings(export.getValue(FramesExportMode.class), export.getZoom());
|
||||
frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, 0, null, fes, evl);
|
||||
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()));
|
||||
frameExporter.exportFrames(handler, selFile + File.separator + "frames", swf, c.getCharacterId(), null, fes, evl);
|
||||
}
|
||||
}
|
||||
|
||||
ScriptExportMode exportMode = export.getValue(ScriptExportMode.class);
|
||||
swf.exportActionScript(handler, selFile, exportMode, Configuration.parallelSpeedUp.get());
|
||||
swf.exportActionScript(handler, selFile, exportMode, Configuration.parallelSpeedUp.get(), evl);
|
||||
}
|
||||
|
||||
public List<SWFList> getSwfs() {
|
||||
|
||||
Reference in New Issue
Block a user