mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 15:51:33 +00:00
AS3 editation with flex - not really working yet:
- needs fixing circular references, etc. (eg. editing class which references classes which references this class) - needs better errors displaying with jump to error line, etc.
This commit is contained in:
@@ -88,12 +88,14 @@ import com.jpexs.decompiler.flash.exporters.settings.ShapeExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.SoundExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.SpriteExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.settings.TextExportSettings;
|
||||
import com.jpexs.decompiler.flash.exporters.swf.SwfToSwcExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.swf.SwfXmlExporter;
|
||||
import com.jpexs.decompiler.flash.gui.AppStrings;
|
||||
import com.jpexs.decompiler.flash.gui.Main;
|
||||
import com.jpexs.decompiler.flash.gui.SearchInMemory;
|
||||
import com.jpexs.decompiler.flash.gui.SearchInMemoryListener;
|
||||
import com.jpexs.decompiler.flash.gui.SwfInMemory;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import com.jpexs.decompiler.flash.gui.helpers.CheckResources;
|
||||
import com.jpexs.decompiler.flash.helpers.FileTextWriter;
|
||||
import com.jpexs.decompiler.flash.helpers.SWFDecompilerPlugin;
|
||||
@@ -193,6 +195,7 @@ import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -585,6 +588,13 @@ public class CommandLineArgumentParser {
|
||||
out.println(" ...<swffile>: SWF file to search instance in");
|
||||
}
|
||||
|
||||
if (filter == null || filter.equals("swf2swc")) {
|
||||
out.println(" " + (cnt++) + ") -swf2swc <outfile> <swffile>");
|
||||
out.println(" ...generates SWC file from SWF");
|
||||
out.println(" ...<outfile>: Where to save SWC file");
|
||||
out.println(" ...<swffile>: Input SWF file");
|
||||
}
|
||||
|
||||
printCmdLineUsageExamples(out, filter);
|
||||
}
|
||||
|
||||
@@ -800,7 +810,9 @@ public class CommandLineArgumentParser {
|
||||
command = nextParam.substring(1);
|
||||
}
|
||||
|
||||
if (command.equals("linkreport")) {
|
||||
if (command.equals("swf2swc")) {
|
||||
parseSwf2Swc(args);
|
||||
} else if (command.equals("linkreport")) {
|
||||
parseLinkReport(selectionClasses, args);
|
||||
} else if (command.equals("getinstancemetadata")) {
|
||||
parseGetInstanceMetadata(args);
|
||||
@@ -997,6 +1009,18 @@ public class CommandLineArgumentParser {
|
||||
setConfigurations(args.pop());
|
||||
}
|
||||
|
||||
private static void parseSwf2Swc(Stack<String> args) {
|
||||
if (args.size() < 2) {
|
||||
badArguments("swf2swc");
|
||||
}
|
||||
final File outFile = new File(args.pop());
|
||||
final File swfFile = new File(args.pop());
|
||||
processReadSWF(swfFile, null, (SWF swf, OutputStream stdout) -> {
|
||||
SwfToSwcExporter exporter = new SwfToSwcExporter();
|
||||
exporter.exportSwf(swf, outFile, false);
|
||||
});
|
||||
}
|
||||
|
||||
private static void parseLinkReport(List<String> selectionClasses, Stack<String> args) {
|
||||
if (args.isEmpty()) {
|
||||
badArguments("linkreport");
|
||||
@@ -3348,6 +3372,13 @@ public class CommandLineArgumentParser {
|
||||
}
|
||||
|
||||
private static void parseImportScript(Stack<String> args) {
|
||||
|
||||
String flexLocation = Configuration.flexSdkLocation.get();
|
||||
if (flexLocation.isEmpty() || (!new File(flexLocation).exists())) {
|
||||
System.err.println("Flex SDK path not set");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
if (args.size() < 3) {
|
||||
badArguments("importscript");
|
||||
}
|
||||
|
||||
@@ -2146,6 +2146,14 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
|
||||
public void importScript(final SWF swf) {
|
||||
|
||||
String flexLocation = Configuration.flexSdkLocation.get();
|
||||
if (flexLocation.isEmpty() || (!new File(flexLocation).exists())) {
|
||||
View.showMessageDialog(null, AppStrings.translate("message.flexpath.notset"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
Main.advancedSettings("paths");
|
||||
return;
|
||||
}
|
||||
|
||||
JFileChooser chooser = new JFileChooser();
|
||||
chooser.setCurrentDirectory(new File(Configuration.lastExportDir.get()));
|
||||
chooser.setDialogTitle(translate("import.select.directory"));
|
||||
|
||||
@@ -1157,6 +1157,12 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
|
||||
return;
|
||||
}
|
||||
}
|
||||
String flexLocation = Configuration.flexSdkLocation.get();
|
||||
if (flexLocation.isEmpty() || (!new File(flexLocation).exists())) {
|
||||
View.showMessageDialog(null, AppStrings.translate("message.flexpath.notset"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
Main.advancedSettings("paths");
|
||||
return;
|
||||
}
|
||||
if (View.showConfirmDialog(null, AppStrings.translate("message.confirm.experimental.function"), AppStrings.translate("message.warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, Configuration.warningExperimentalAS3Edit, JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) {
|
||||
setDecompiledEditMode(true);
|
||||
}
|
||||
@@ -1173,11 +1179,6 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
|
||||
|
||||
try {
|
||||
String oldSp = pack.getClassPath().toRawString();
|
||||
/*List<ScriptPack> packs = abc.script_info.get(oldIndex).getPacks(abc, oldIndex, null, pack.allABCs);
|
||||
if (!packs.isEmpty()) {
|
||||
|
||||
}*/
|
||||
|
||||
String as = decompiledTextArea.getText();
|
||||
abc.replaceScriptPack(pack, as);
|
||||
lastDecompiled = as;
|
||||
|
||||
@@ -432,3 +432,6 @@ config.description.simplifyExpressions = Evaluate and simplify expressions to ma
|
||||
|
||||
config.name.resetLetterSpacingOnTextImport = Reset Letter Spacing on text import
|
||||
config.description.resetLetterSpacingOnTextImport = Useful for cyrillic fonts, because they are wider
|
||||
|
||||
config.name.flexSdkLocation = 4) Flex SDK directory path
|
||||
config.description.flexSdkLocation = Location of Adobe Flex SDK. It is used mostly for AS3 compilation.
|
||||
|
||||
@@ -734,4 +734,5 @@ generic.editor.amf3.help = AMF3 value syntax:\n\
|
||||
\ * Nonscalar datatypes can be referenced by previously declared "id" attributes with # syntax:\n\
|
||||
%reference_sample%\n\
|
||||
\ * Keys in Dictionary entries can be any type\n
|
||||
|
||||
|
||||
message.flexpath.notset = Flex SDK not found. Please configure its path in Advanced Settings / Paths (4).
|
||||
Reference in New Issue
Block a user