diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java index 1dd68af40..c2a2a143a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -1628,7 +1628,7 @@ public class SWFInputStream implements AutoCloseable { logger.log(Level.SEVERE, "Problem in " + timelined.toString(), ex); } - if (Configuration.debugMode.get()) { + if (Configuration._debugMode.get()) { byte[] data = ret.getOriginalData(); byte[] dataNew = ret.getData(); int ignoreFirst = 0; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java index 8c7931bee..fd976b55b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -465,7 +465,7 @@ public class SWFOutputStream extends OutputStream { public void writeRECT(RECT value) throws IOException { int nBits = 0; - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { nBits = Math.max(nBits, value.nbits); } @@ -478,7 +478,7 @@ public class SWFOutputStream extends OutputStream { nBits = enlargeBitCountS(nBits, yMin); nBits = enlargeBitCountS(nBits, yMax); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { nBits = Math.max(nBits, value.nbits); } @@ -640,7 +640,7 @@ public class SWFOutputStream extends OutputStream { nBits = enlargeBitCountS(nBits, value.scaleX); nBits = enlargeBitCountS(nBits, value.scaleY); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { nBits = Math.max(nBits, value.nScaleBits); } @@ -654,7 +654,7 @@ public class SWFOutputStream extends OutputStream { nBits = enlargeBitCountS(nBits, value.rotateSkew0); nBits = enlargeBitCountS(nBits, value.rotateSkew1); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { nBits = Math.max(nBits, value.nRotateBits); } @@ -666,7 +666,7 @@ public class SWFOutputStream extends OutputStream { NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateX); NTranslateBits = enlargeBitCountS(NTranslateBits, value.translateY); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { NTranslateBits = Math.max(NTranslateBits, value.nTranslateBits); } @@ -699,7 +699,7 @@ public class SWFOutputStream extends OutputStream { Nbits = enlargeBitCountS(Nbits, value.blueAddTerm); } - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { Nbits = Math.max(Nbits, value.nbits); } @@ -740,7 +740,7 @@ public class SWFOutputStream extends OutputStream { Nbits = enlargeBitCountS(Nbits, value.alphaAddTerm); } - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { Nbits = Math.max(Nbits, value.nbits); } @@ -1406,7 +1406,7 @@ public class SWFOutputStream extends OutputStream { writeUB(1, 1); // typeFlag writeUB(1, 0); // curvedEdge int numBits = Math.max(getNeededBitsS(cer.controlDeltaX, cer.controlDeltaY, cer.anchorDeltaX, cer.anchorDeltaY) - 2, 0); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { numBits = Math.max(numBits, cer.numBits); } @@ -1421,7 +1421,7 @@ public class SWFOutputStream extends OutputStream { writeUB(1, 1); // typeFlag writeUB(1, 1); // straightEdge int numBits = Math.max(getNeededBitsS(ser.deltaX, ser.deltaY) - 2, 0); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { numBits = Math.max(numBits, ser.numBits); } @@ -1447,7 +1447,7 @@ public class SWFOutputStream extends OutputStream { writeUB(1, scr.stateMoveTo ? 1 : 0); if (scr.stateMoveTo) { int moveBits = getNeededBitsS(scr.moveDeltaX, scr.moveDeltaY); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { moveBits = Math.max(moveBits, scr.moveBits); } @@ -1471,7 +1471,7 @@ public class SWFOutputStream extends OutputStream { fillBits = getNeededBitsU(scr.fillStyles.fillStyles.length); lineBits = getNeededBitsU(scr.lineStyles.lineStyles.length); - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { fillBits = Math.max(fillBits, scr.numFillBits); lineBits = Math.max(lineBits, scr.numLineBits); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index 50febc037..cdf2430e2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -507,7 +507,7 @@ public class ASM3Parser { value_index = parseNamespace(constants, lexer); break; default: - if (Configuration.debugMode.get()) { + if (Configuration._debugMode.get()) { throw new AVM2ParseException("Not supported valueType.", lexer.yyline()); } } @@ -773,88 +773,80 @@ public class ASM3Parser { case AVM2Code.DAT_STRING_INDEX: if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) { operandsList.add(0); - } else { - if (parsedOperand.type == ParsedSymbol.TYPE_STRING) { - int sid = constants.getStringId((String) parsedOperand.value, false); - if (sid == -1) { - if ((missingHandler != null) && (missingHandler.missingString((String) parsedOperand.value))) { - sid = constants.addString((String) parsedOperand.value); - } else { - throw new AVM2ParseException("Unknown String", lexer.yyline()); - } + } else if (parsedOperand.type == ParsedSymbol.TYPE_STRING) { + int sid = constants.getStringId((String) parsedOperand.value, false); + if (sid == -1) { + if ((missingHandler != null) && (missingHandler.missingString((String) parsedOperand.value))) { + sid = constants.addString((String) parsedOperand.value); + } else { + throw new AVM2ParseException("Unknown String", lexer.yyline()); } - operandsList.add(sid); - } else { - throw new AVM2ParseException("String or null expected", lexer.yyline()); } + operandsList.add(sid); + } else { + throw new AVM2ParseException("String or null expected", lexer.yyline()); } break; case AVM2Code.DAT_INT_INDEX: if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) { operandsList.add(0); - } else { - if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { - long intVal = (Long) parsedOperand.value; - int iid = constants.getIntId(intVal, false); - if (iid == -1) { - if ((missingHandler != null) && (missingHandler.missingInt(intVal))) { - iid = constants.addInt(intVal); - } else { - throw new AVM2ParseException("Unknown int", lexer.yyline()); - } + } else if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + long intVal = (Long) parsedOperand.value; + int iid = constants.getIntId(intVal, false); + if (iid == -1) { + if ((missingHandler != null) && (missingHandler.missingInt(intVal))) { + iid = constants.addInt(intVal); + } else { + throw new AVM2ParseException("Unknown int", lexer.yyline()); } - operandsList.add(iid); - } else { - throw new AVM2ParseException("Integer or null expected", lexer.yyline()); } + operandsList.add(iid); + } else { + throw new AVM2ParseException("Integer or null expected", lexer.yyline()); } break; case AVM2Code.DAT_UINT_INDEX: if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) { operandsList.add(0); - } else { - if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { - long intVal = (Long) parsedOperand.value; - int iid = constants.getUIntId(intVal, false); - if (iid == -1) { - if ((missingHandler != null) && (missingHandler.missingUInt(intVal))) { - iid = constants.addUInt(intVal); - } else { - throw new AVM2ParseException("Unknown uint", lexer.yyline()); - } + } else if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + long intVal = (Long) parsedOperand.value; + int iid = constants.getUIntId(intVal, false); + if (iid == -1) { + if ((missingHandler != null) && (missingHandler.missingUInt(intVal))) { + iid = constants.addUInt(intVal); + } else { + throw new AVM2ParseException("Unknown uint", lexer.yyline()); } - operandsList.add(iid); - } else { - throw new AVM2ParseException("Integer or null expected", lexer.yyline()); } + operandsList.add(iid); + } else { + throw new AVM2ParseException("Integer or null expected", lexer.yyline()); } break; case AVM2Code.DAT_DOUBLE_INDEX: if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) { operandsList.add(0); - } else { - if ((parsedOperand.type == ParsedSymbol.TYPE_INTEGER) || (parsedOperand.type == ParsedSymbol.TYPE_FLOAT)) { + } else if ((parsedOperand.type == ParsedSymbol.TYPE_INTEGER) || (parsedOperand.type == ParsedSymbol.TYPE_FLOAT)) { - double doubleVal = 0; - if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { - doubleVal = (Long) parsedOperand.value; - } - if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) { - doubleVal = (Double) parsedOperand.value; - } - int did = constants.getDoubleId(doubleVal, false); - if (did == -1) { - if ((missingHandler != null) && (missingHandler.missingDouble(doubleVal))) { - did = constants.addDouble(doubleVal); - } else { - throw new AVM2ParseException("Unknown double", lexer.yyline()); - } - } - operandsList.add(did); - } else { - throw new AVM2ParseException("Float or null expected", lexer.yyline()); + double doubleVal = 0; + if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) { + doubleVal = (Long) parsedOperand.value; } + if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) { + doubleVal = (Double) parsedOperand.value; + } + int did = constants.getDoubleId(doubleVal, false); + if (did == -1) { + if ((missingHandler != null) && (missingHandler.missingDouble(doubleVal))) { + did = constants.addDouble(doubleVal); + } else { + throw new AVM2ParseException("Unknown double", lexer.yyline()); + } + } + operandsList.add(did); + } else { + throw new AVM2ParseException("Float or null expected", lexer.yyline()); } break; case AVM2Code.DAT_OFFSET: diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 995e30ed2..a2f31e9e1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -159,7 +159,6 @@ public class Configuration { public static final ConfigurationItem overrideTextExportFileName = null; @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") public static final ConfigurationItem useDetailedLogging = null; /** @@ -167,12 +166,12 @@ public class Configuration { * recompiled */ @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") - public static final ConfigurationItem debugMode = null; + @ConfigurationInternal + public static final ConfigurationItem _debugMode = null; @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") - public static final ConfigurationItem showDebugMenu = null; + @ConfigurationInternal + public static final ConfigurationItem _showDebugMenu = null; /** * Turn off resolving constants in ActionScript 2 @@ -215,15 +214,14 @@ public class Configuration { public static final ConfigurationItem displayFileName = null; @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") - public static final ConfigurationItem debugCopy = null; + @ConfigurationInternal + public static final ConfigurationItem _debugCopy = null; @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") public static final ConfigurationItem dumpTags = null; @ConfigurationDefaultBoolean(true) - @ConfigurationCategory("debug") + @ConfigurationCategory("export") public static final ConfigurationItem setFFDecVersionInExportedFont = null; @ConfigurationDefaultInt(60) @@ -436,7 +434,7 @@ public class Configuration { public static final ConfigurationItem lzmaFastBytes = null; @ConfigurationDefaultBoolean(false) - @ConfigurationCategory("debug") + @ConfigurationCategory("script") public static final ConfigurationItem showMethodBodyId = null; @ConfigurationDefaultDouble(1.0) @@ -794,7 +792,7 @@ public class Configuration { setConfigurationFields(); if (useDetailedLogging.get()) { logLevel = Level.FINEST; - } else if (debugMode.get()) { + } else if (_debugMode.get()) { logLevel = Level.INFO; } else { logLevel = Level.WARNING; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/HighlightedTextWriter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/HighlightedTextWriter.java index f76145c77..4c9215e63 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/HighlightedTextWriter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/HighlightedTextWriter.java @@ -281,7 +281,7 @@ public class HighlightedTextWriter extends GraphTextWriter { if (toStringCalled) { throw new Error("HighlightedTextWriter.toString() was already called."); } - if (Configuration.debugMode.get()) { + if (Configuration._debugMode.get()) { long stopTime = System.currentTimeMillis(); long time = stopTime - startTime; if (time > 500) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java index 1178eaf76..5c1cf0a24 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/hilight/Highlighting.java @@ -221,7 +221,7 @@ public class Highlighting implements Serializable { public Highlighting(int startPos, HighlightData data, HighlightType type, String text) { this.startPos = startPos; this.type = type; - if (Configuration.debugMode.get()) { + if (Configuration._debugMode.get()) { this.HighlightedText = text; } this.properties = data; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java index 218d5b178..c3e9a3aa2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -411,7 +411,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { * @throws IOException */ public void writeTag(SWFOutputStream sos) throws IOException { - if (Configuration.debugCopy.get() || isModified()) { + if (Configuration._debugCopy.get() || isModified()) { byte[] newData = getData(); byte[] newHeaderData = getHeader(newData.length); sos.write(newHeaderData); @@ -477,7 +477,7 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { public byte[] getData() { ByteArrayOutputStream baos = new ByteArrayOutputStream(); OutputStream os = baos; - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { byte[] originalData = getOriginalData(); if (originalData != null) { os = new CopyOutputStream(os, new ByteArrayInputStream(getOriginalData())); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java index 159e8fd89..708cc98bf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/ShapeTag.java @@ -134,7 +134,7 @@ public abstract class ShapeTag extends CharacterTag implements DrawableTag, Lazy @Override public void toImage(int frame, int time, int ratio, RenderContext renderContext, SerializableImage image, boolean isClip, Matrix transformation, Matrix absoluteTransformation, ColorTransform colorTransform) { BitmapExporter.export(swf, getShapes(), null, image, transformation, colorTransform); - if (Configuration.debugMode.get()) { // show control points + if (Configuration._debugMode.get()) { // show control points List paths = PathExporter.export(swf, getShapes()); double[] coords = new double[6]; AffineTransform at = transformation.toTransform(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java index 12e6da07d..93df09be3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/StaticTextTag.java @@ -111,7 +111,7 @@ public abstract class StaticTextTag extends TextTag { } } - if (Configuration.debugCopy.get()) { + if (Configuration._debugCopy.get()) { glyphBits = Math.max(glyphBits, this.glyphBits); advanceBits = Math.max(advanceBits, this.advanceBits); } @@ -513,12 +513,10 @@ public abstract class StaticTextTag extends TextTag { tr.styleFlagsHasColor = true; color = null; } - } else { - if (colorA != null) { - tr.textColorA = colorA; - tr.styleFlagsHasColor = true; - colorA = null; - } + } else if (colorA != null) { + tr.textColorA = colorA; + tr.styleFlagsHasColor = true; + colorA = null; } if (x != null) { tr.xOffset = x; diff --git a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java index 394e09cac..ca8ccab00 100644 --- a/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java +++ b/src/com/jpexs/decompiler/flash/console/CommandLineArgumentParser.java @@ -647,7 +647,7 @@ public class CommandLineArgumentParser { for (int i = 0; i < arguments.length; i++) { System.out.println(i + ".:" + arguments[i]); } - Configuration.debugMode.set(true); + Configuration._debugMode.set(true); break; default: break OUTER; @@ -1110,7 +1110,7 @@ public class CommandLineArgumentParser { }); System.setOut(nullStream); System.setErr(nullStream); - Main.initLogging(Configuration.debugMode.get()); + Main.initLogging(Configuration._debugMode.get()); File[] files = new File(folder).listFiles(getSwfFilter()); for (File file : files) { @@ -1137,7 +1137,7 @@ public class CommandLineArgumentParser { System.setOut(oldOut); System.setErr(oldErr); - Main.initLogging(Configuration.debugMode.get()); + Main.initLogging(Configuration._debugMode.get()); break; } case "finderrorheader": { @@ -1152,7 +1152,7 @@ public class CommandLineArgumentParser { }); System.setOut(nullStream); System.setErr(nullStream); - Main.initLogging(Configuration.debugMode.get()); + Main.initLogging(Configuration._debugMode.get()); File[] files = new File(folder).listFiles(getSwfFilter()); for (File file : files) { @@ -1194,7 +1194,7 @@ public class CommandLineArgumentParser { System.setOut(oldOut); System.setErr(oldErr); - Main.initLogging(Configuration.debugMode.get()); + Main.initLogging(Configuration._debugMode.get()); break; } } @@ -1321,7 +1321,7 @@ public class CommandLineArgumentParser { String errFilePath = stdErr.replace("{swfFile}", inFileName); Path.createDirectorySafe(new File(errFilePath).getParentFile()); System.setErr(new PrintStream(new FileOutputStream(errFilePath, true))); - Main.initLogging(Configuration.debugMode.get()); + Main.initLogging(Configuration._debugMode.get()); } long startTimeSwf = 0; @@ -1354,10 +1354,8 @@ public class CommandLineArgumentParser { if (selectionIds.contains(c.getCharacterId())) { extags.add(t); } - } else { - if (selectionIds.contains(0)) { - extags.add(t); - } + } else if (selectionIds.contains(0)) { + extags.add(t); } } @@ -1899,10 +1897,8 @@ public class CommandLineArgumentParser { DefineSpriteTag ds = (DefineSpriteTag) t; if ("page1".equals(ds.getExportName())) { totalPages = 1; - } else { - if (totalPages > 0) { - totalPages++; - } + } else if (totalPages > 0) { + totalPages++; } } } @@ -1915,10 +1911,8 @@ public class CommandLineArgumentParser { if ("page1".equals(ds.getExportName())) { page = 1; job = new PDFJob(new BufferedOutputStream(new FileOutputStream(outFile))); - } else { - if (page > 0) { - page++; - } + } else if (page > 0) { + page++; } if (("page" + page).equals(ds.getExportName())) { if (!selection.contains(page)) { @@ -2872,16 +2866,12 @@ public class CommandLineArgumentParser { if (!swf.generatePCodeSwdFile(new File(outSwd), new HashMap<>())) { System.err.println("Generating SWD failed"); } - } else { - if (!swf.generateSwdFile(new File(outSwd), new HashMap<>())) { - System.err.println("Generating SWD failed"); - } + } else if (!swf.generateSwdFile(new File(outSwd), new HashMap<>())) { + System.err.println("Generating SWD failed"); } } - } else { - if (generateSwd) { - System.err.println("WARNING: Cannot generate SWD for AS3 file"); - } + } else if (generateSwd) { + System.err.println("WARNING: Cannot generate SWD for AS3 file"); } System.out.println("OK"); } catch (FileNotFoundException ex) { diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 89501beec..33d16bbfe 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -1825,7 +1825,7 @@ public class Main { } AppStrings.setResourceClass(MainFrame.class); - initLogging(Configuration.debugMode.get()); + initLogging(Configuration._debugMode.get()); initLang(); if (Configuration.cacheOnDisk.get()) { diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java index 3e39158a2..84cf7206f 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameMenu.java @@ -994,21 +994,21 @@ public abstract class MainFrameMenu implements MenuBuilder { addMenuItem("/help/about", translate("menu.help.about"), "about32", this::aboutActionPerformed, PRIORITY_TOP, null, true, null, false); finishMenu("/help"); - if (Configuration.showDebugMenu.get() || Configuration.debugMode.get()) { + if (Configuration._showDebugMenu.get() || Configuration._debugMode.get()) { - addMenuItem("/debug", "Debug", null, null, 0, null, false, null, false); - addMenuItem("/debug/removeNonScripts", "Remove non scripts", "update16", e -> removeNonScripts(), PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/removeExceptSelected", "Remove except selected", "update16", e -> removeExceptSelected(), PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/refreshDecompiled", "Refresh decompiled script", "update16", e -> refreshDecompiled(), PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/checkResources", "Check resources", "update16", e -> checkResources(), PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/callGc", "Call System.gc()", "update16", e -> System.gc(), PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/emptyCache", "Empty cache", "update16", e -> { + addMenuItem("/debug", "# FFDec Debug #", null, null, 0, null, false, null, false); + addMenuItem("/debug/removeNonScripts", "Remove non scripts", "continue16", e -> removeNonScripts(), PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/removeExceptSelected", "Remove except selected", "continue16", e -> removeExceptSelected(), PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/refreshDecompiled", "Refresh decompiled script", "continue16", e -> refreshDecompiled(), PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/checkResources", "Check resources", "continue16", e -> checkResources(), PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/callGc", "Call System.gc()", "continue16", e -> System.gc(), PRIORITY_MEDIUM, null, true, null, false); + addMenuItem("/debug/emptyCache", "Empty cache", "continue16", e -> { SWF nswf = mainFrame.getPanel().getCurrentSwf(); if (nswf != null) { nswf.clearAllCache(); } }, PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/memoryInformation", "Memory information", "update16", e -> { + addMenuItem("/debug/memoryInformation", "Memory information", "continue16", e -> { String architecture = System.getProperty("sun.arch.data.model"); Runtime runtime = Runtime.getRuntime(); String info = "Architecture: " + architecture + Helper.newLine @@ -1021,13 +1021,13 @@ public abstract class MainFrameMenu implements MenuBuilder { nswf.clearAllCache(); } }, PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/fixAs3Code", "Fix AS3 code", "update16", e -> { + addMenuItem("/debug/fixAs3Code", "Fix AS3 code", "continue16", e -> { SWF nswf = mainFrame.getPanel().getCurrentSwf(); if (nswf != null) { nswf.fixAS3Code(); } }, PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/openTestSwfs", "Open test SWFs", "update16", e -> { + addMenuItem("/debug/openTestSwfs", "Open test SWFs", "continue16", e -> { String path; SWFSourceInfo[] sourceInfos = new SWFSourceInfo[2]; @@ -1038,7 +1038,7 @@ public abstract class MainFrameMenu implements MenuBuilder { sourceInfos[1] = new SWFSourceInfo(null, path, null); Main.openFile(sourceInfos); }, PRIORITY_MEDIUM, null, true, null, false); - addMenuItem("/debug/createNewSwf", "Create new SWF", "update16", e -> { + addMenuItem("/debug/createNewSwf", "Create new SWF", "continue16", e -> { SWF swf = new SWF(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { diff --git a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java index 1bc5d46a8..168f8eeaf 100644 --- a/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TagInfoPanel.java @@ -117,7 +117,7 @@ public class TagInfoPanel extends JPanel { try { name = mainPanel.translate(key); } catch (MissingResourceException mes) { - if (Configuration.debugMode.get()) { + if (Configuration._debugMode.get()) { Logger.getLogger(TagInfoPanel.class.getName()).log(Level.WARNING, "Resource not found: {0}", key); } } diff --git a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java index a8d7a22ae..1b66104df 100644 --- a/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/editor/LineMarkedEditorPane.java @@ -186,12 +186,10 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan public void toggleColorMarker(int line, LineMarker lm) { if (!lineMarkers.containsKey(line - firstLineOffset())) { addColorMarker(line, lm); + } else if (lineMarkers.get(line - firstLineOffset()).contains(lm)) { + removeColorMarker(line, lm); } else { - if (lineMarkers.get(line - firstLineOffset()).contains(lm)) { - removeColorMarker(line, lm); - } else { - addColorMarker(line, lm); - } + addColorMarker(line, lm); } getParent().repaint(); } @@ -442,7 +440,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan this.lineMarkers = new HashMap<>(); lastLine = -1; error = false; - if (Configuration.debugMode.get() && t != null && t.length() > truncateLimit) { + if (Configuration._debugMode.get() && t != null && t.length() > truncateLimit) { t = t.substring(0, truncateLimit) + "\r\n" + AppStrings.translate("editorTruncateWarning").replace("%chars%", Integer.toString(truncateLimit)); } super.setText(t); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties index f0f7a1305..6887cef54 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/AdvancedSettingsDialog.properties @@ -101,11 +101,11 @@ config.description.useRibbonInterface = Uncheck to use classic interface without config.name.openFolderAfterFlaExport = Open folder after FLA export config.description.openFolderAfterFlaExport = Display output directory after exporting FLA file -config.name.useDetailedLogging = Detailed Logging -config.description.useDetailedLogging = Log detailed error messages and info for debugging purposes +config.name.useDetailedLogging = FFDec detailed Logging +config.description.useDetailedLogging = Log detailed error messages and info for debugging of FFDec -config.name.debugMode = Debug mode -config.description.debugMode = Mode for debugging. Turns on debug menu. +config.name._debugMode = FFDec in debug mode +config.description._debugMode = Mode for debugging FFDec. Turns on debug menu. This has nothing to do with the debugger functionality config.name.resolveConstants = Resolve constants in AS1/2 p-code config.description.resolveConstants = Turn this off to show 'constantxx' instead of real values in P-code window @@ -125,8 +125,8 @@ config.description.paramNamesEnable = Using parameter names in decompiling may c config.name.displayFileName = Show SWF name in title config.description.displayFileName = Display SWF file/url name in the window title (You can make screenshots then) -config.name.debugCopy = Debug recompile -config.description.debugCopy = Tries to compile SWF file again just after opening to ensure it produces same binary code. Use for DEBUGGING only! +config.name._debugCopy = FFDec debug recompile +config.description._debugCopy = Tries to compile SWF file again just after opening to ensure it produces same binary code. Use for DEBUGGING FFDec only! config.name.dumpTags = Dump tags to console config.description.dumpTags = Dump tags to console on reading SWF file @@ -323,8 +323,8 @@ config.description.autoSaveTagModifications = Save the changes when you select a config.name.saveSessionOnExit = Save session on exit config.description.saveSessionOnExit = Save the current session and reopens it after FFDec restart (works only with real files) -config.name.showDebugMenu = Show debug menu -config.description.showDebugMenu = Shows debug menu in the ribbon +config.name._showDebugMenu = Show FFDec debug menu +config.description._showDebugMenu = Shows debug menu in the ribbon for debugging of the decompiler. config.name.allowOnlyOneInstance = Allow only one FFDec instance (Only Windows OS) config.description.allowOnlyOneInstance = FFDec can be then run only once, all files opened will be added to one window. It works only with Windows operating system. @@ -396,27 +396,27 @@ config.name.debugHalt = Halt execution on debug start config.description.debugHalt = Pause SWF on start of debugging. config.name.gui.avm2.splitPane.vars.dividerLocationPercent = (Internal) Debug menu splitter location -config.description.gui.avm2.splitPane.vars.dividerLocationPercent = +config.description.gui.avm2.splitPane.vars.dividerLocationPercent = tip = Tip:\u0020 config.name.gui.action.splitPane.vars.dividerLocationPercent = (Internal) AS1/2 Debug menu splitter location -config.description.gui.action.splitPane.vars.dividerLocationPercent = +config.description.gui.action.splitPane.vars.dividerLocationPercent = config.name.setMovieDelay = Delay before changing the SWF in external player in ms config.description.setMovieDelay = Not recommended to change this value below 1000ms config.name.warning.svgImport = Warn on SVG import -config.description.warning.svgImport = +config.description.warning.svgImport = config.name.shapeImport.useNonSmoothedFill = Use non-smoothed fill when a shape is replaced with an image -config.description.shapeImport.useNonSmoothedFill = +config.description.shapeImport.useNonSmoothedFill = config.name.internalFlashViewer.execute.as12 = AS1/2 in own flash viewer (Experimental) config.description.internalFlashViewer.execute.as12 = Try to execute ActionScript 1/2 during SWF playback using FFDec flash viewer config.name.warning.hexViewNotUpToDate = Show Hex View not up-to-date warning -config.description.warning.hexViewNotUpToDate = +config.description.warning.hexViewNotUpToDate = config.name.displayDupInstructions = Show \u00a7\u00a7dup instructions config.description.displayDupInstructions = Display \u00a7\u00a7dup instructions in the code. Without them, the code can be easily compiled but some dupped code with sideeffects could be executed twice.