diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a5024c77..260a83f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] ### Added - #1202 Check for modifications outside FFDec and ask user to reload +- #1155, #1602 AS3 remove trait button ### Fixed - #1298 AS1/2 properly decompiled setProperty/getProperty diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 53981892a..ae57b96b8 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -68,6 +68,7 @@ import com.jpexs.decompiler.flash.gui.abc.tablemodels.UIntTableModel; import com.jpexs.decompiler.flash.gui.controls.JPersistentSplitPane; import com.jpexs.decompiler.flash.gui.editor.LinkHandler; import com.jpexs.decompiler.flash.gui.tagtree.TagTreeModel; +import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.importers.As3ScriptReplaceException; import com.jpexs.decompiler.flash.importers.As3ScriptReplaceExceptionItem; import com.jpexs.decompiler.flash.importers.As3ScriptReplacerInterface; @@ -922,6 +923,12 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener= 0 && traitId < abc.class_info.get(classIndex).static_traits.traits.size()) { + traitIndex = traitId; + traits = staticTraits; + } else { + if (traitId >= 0 && traitId < staticTraits.traits.size() + instanceTraits.traits.size()) { + traitIndex = traitId - staticTraits.traits.size(); + traits = instanceTraits; + } else { + traits = null; + } + } + + if (traits == null) { + return; + } + + if (View.showConfirmDialog(null, AppStrings.translate("message.confirm.removetrait"), AppStrings.translate("message.warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION) { + traits.traits.remove(traitIndex); + ((Tag) abc.parentTag).setModified(true); + reload(); + } + } + private void addTraitButtonActionPerformed(ActionEvent evt) { int class_index = decompiledTextArea.getClassIndex(); if (class_index < 0) { diff --git a/src/com/jpexs/decompiler/flash/gui/graphics/traitremove16.png b/src/com/jpexs/decompiler/flash/gui/graphics/traitremove16.png new file mode 100644 index 000000000..9fbae6725 Binary files /dev/null and b/src/com/jpexs/decompiler/flash/gui/graphics/traitremove16.png differ diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index c1e28abef..696f03f36 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -777,3 +777,8 @@ filter.iggy = Iggy files (*.iggy) script.seemsBroken = WARNING: The code decompilation contains \u00a7\u00a7 instructions. \ This is usually caused by an obfuscation (See Settings/Automatic deobfuscation) \ or a nonstandard compiler used (Haxe, etc.). + +#after 13.0.3 +button.removetrait = Remove trait + +message.confirm.removetrait = Do you really want to remove selected trait? \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index 12acf6c58..3ce9fe72b 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -755,3 +755,8 @@ filter.iggy = Iggy soubory (*.iggy) script.seemsBroken = VAROV\u00c1N\u00cd: K\u00f3d dekompilace obsahuje \u00a7\u00a7 instrukce. \ To je obvykle zp\u016fsobeno n\u011bjakou obfuskac\u00ed (viz Nastaven\u00ed/Automatick\u00e1 deobfuskace) \ nebo pou\u017eit\u00edm nestandardn\u00edho kompil\u00e1toru (Haxe, etc.). + +#after 13.0.3 +button.removetrait = Odstranit vlastnost + +message.confirm.removetrait = Opravdu chcete odstranit vybranou vlastnost? \ No newline at end of file