diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 6078edd77..591d881bc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -531,11 +531,31 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T helpBand.addCommandButton(helpUsUpdatesCommandButton, RibbonElementPriority.TOP); RibbonTask helpTask = new RibbonTask(translate("menu.help"), helpBand); + RibbonTask debugTask = null; + if (Configuration.debugMode.get()) { + //----------------------------------------- DEBUG ----------------------------------- + + JRibbonBand debugBand = new JRibbonBand("Debug", null); + debugBand.setResizePolicies((List) Arrays.asList(new CoreRibbonResizePolicies.Mirror(debugBand.getControlPanel()), new IconRibbonBandResizePolicy(debugBand.getControlPanel()))); + + JCommandButton removeNonScriptsCommandButton = new JCommandButton(fixCommandTitle("Remove non scripts"), View.getResizableIcon("update16")); + assignListener(removeNonScriptsCommandButton, "REMOVENONSCRIPTS"); + + JCommandButton refreshDecompiledCommandButton = new JCommandButton(fixCommandTitle("Refresh decompiled script"), View.getResizableIcon("update16")); + assignListener(refreshDecompiledCommandButton, "REFRESHDECOMPILED"); + + debugBand.addCommandButton(removeNonScriptsCommandButton, RibbonElementPriority.MEDIUM); + debugBand.addCommandButton(refreshDecompiledCommandButton, RibbonElementPriority.MEDIUM); + debugTask = new RibbonTask("Debug", debugBand); + } rib.addTask(fileTask); rib.addTask(toolsTask); rib.addTask(settingsTask); rib.addTask(helpTask); + if (debugTask != null) { + rib.addTask(debugTask); + } RibbonApplicationMenu mainMenu = new RibbonApplicationMenu(); @@ -2949,6 +2969,25 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T }.execute(); } break; + case "REMOVENONSCRIPTS": + List tags = new ArrayList<>(swf.tags); + for (Tag tag : tags) { + System.out.println(tag.getClass()); + if (!(tag instanceof ABCContainerTag || tag instanceof ASMSource)) { + swf.removeTag(tag); + } + } + showCard(CARDEMPTYPANEL); + refreshTree(); + break; + case "REFRESHDECOMPILED": + clearCache(); + if (abcPanel != null) { + abcPanel.reload(); + } + reload(true); + doFilter(); + break; } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java index 38ad9b141..263bb2444 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -632,10 +632,10 @@ public class ActionPanel extends JPanel implements ActionListener { if (val) { if (rawEdit) { - editor.setContentType("text/flasm"); + editor.setContentType("text/plain"); setText(srcHexOnly); } else { - editor.setContentType("text/plain"); + editor.setContentType("text/flasm"); setText(srcNoHex); } editor.setEditable(true);