diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index fda2316dc..db87d2f65 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -2451,6 +2451,7 @@ public final class SWF implements TreeItem, Timelined { for (ASMSource src : actionsMap.keySet()) { actionsMap.put(src, Action.removeNops(0, actionsMap.get(src), version, 0, ""/*FIXME path*/)); src.setActions(actionsMap.get(src)); + src.setModified(); } deobfuscation.deobfuscateInstanceNames(deobfuscated, renameType, tags, selected); return ret; diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 5d7259ee6..d0371c84d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -1675,8 +1675,8 @@ public class SWFInputStream extends InputStream { * @return CLIPACTIONRECORD value * @throws IOException */ - public CLIPACTIONRECORD readCLIPACTIONRECORD(SWF swf) throws IOException { - CLIPACTIONRECORD ret = new CLIPACTIONRECORD(swf, this, getPos()); + public CLIPACTIONRECORD readCLIPACTIONRECORD(SWF swf, Tag tag) throws IOException { + CLIPACTIONRECORD ret = new CLIPACTIONRECORD(swf, this, getPos(), tag); if (ret.eventFlags.isClear()) { return null; } @@ -1691,13 +1691,13 @@ public class SWFInputStream extends InputStream { * @return CLIPACTIONS value * @throws IOException */ - public CLIPACTIONS readCLIPACTIONS(SWF swf) throws IOException { + public CLIPACTIONS readCLIPACTIONS(SWF swf, Tag tag) throws IOException { CLIPACTIONS ret = new CLIPACTIONS(); ret.reserved = readUI16(); ret.allEventFlags = readCLIPEVENTFLAGS(); CLIPACTIONRECORD cr; ret.clipActionRecords = new ArrayList<>(); - while ((cr = readCLIPACTIONRECORD(swf)) != null) { + while ((cr = readCLIPACTIONRECORD(swf, tag)) != null) { ret.clipActionRecords.add(cr); } return ret; @@ -2032,10 +2032,10 @@ public class SWFInputStream extends InputStream { * @return List of BUTTONCONDACTION values * @throws IOException */ - public List readBUTTONCONDACTIONList(SWF swf) throws IOException { + public List readBUTTONCONDACTIONList(SWF swf, Tag tag) throws IOException { List ret = new ArrayList<>(); BUTTONCONDACTION bc; - while (!(bc = readBUTTONCONDACTION(swf)).isLast) { + while (!(bc = readBUTTONCONDACTION(swf, tag)).isLast) { ret.add(bc); } ret.add(bc); @@ -2049,8 +2049,8 @@ public class SWFInputStream extends InputStream { * @return BUTTONCONDACTION value * @throws IOException */ - public BUTTONCONDACTION readBUTTONCONDACTION(SWF swf) throws IOException { - BUTTONCONDACTION ret = new BUTTONCONDACTION(swf, this, getPos()); + public BUTTONCONDACTION readBUTTONCONDACTION(SWF swf, Tag tag) throws IOException { + BUTTONCONDACTION ret = new BUTTONCONDACTION(swf, this, getPos(), tag); //ret.actions = readActionList(); return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java index 5df7f8ae2..5cdde2c22 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFOutputStream.java @@ -454,7 +454,7 @@ public class SWFOutputStream extends OutputStream { * @throws IOException */ public void writeTag(Tag tag) throws IOException { - byte[] data = tag.getData(); + byte[] data = tag.getDataOrOriginalData(); write(getTagHeader(tag, data, version)); write(data); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java index cd84ec6bd..0067e5abf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ABC.java @@ -53,6 +53,7 @@ import com.jpexs.decompiler.flash.abc.usages.MethodReturnTypeMultinameUsage; import com.jpexs.decompiler.flash.abc.usages.MultinameUsage; import com.jpexs.decompiler.flash.abc.usages.TypeNameMultinameUsage; import com.jpexs.decompiler.flash.helpers.collections.MyEntry; +import com.jpexs.decompiler.flash.tags.ABCContainerTag; import com.jpexs.helpers.utf8.Utf8PrintWriter; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -86,6 +87,7 @@ public class ABC { private static final Logger logger = Logger.getLogger(ABC.class.getName()); private final AVM2Deobfuscation deobfuscation; public SWF swf; + public ABCContainerTag parentTag; public int addMethodBody(MethodBody body) { bodies = Arrays.copyOf(bodies, bodies.length + 1); @@ -324,8 +326,9 @@ public class ABC { } } - public ABC(InputStream is, SWF swf) throws IOException { + public ABC(InputStream is, SWF swf, ABCContainerTag tag) throws IOException { this.swf = swf; + this.parentTag = tag; ABCInputStream ais = new ABCInputStream(is); minor_version = ais.readU16(); major_version = ais.readU16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/FontPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/FontPanel.java index 30f611ae9..f680f5ec1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/FontPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/FontPanel.java @@ -137,6 +137,7 @@ public class FontPanel extends javax.swing.JPanel { } } } + ft.setModified(true); SWF.clearImageCache(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java index d38b4f1a1..e44bc83d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -78,6 +78,7 @@ import com.jpexs.decompiler.flash.tags.DefineText2Tag; import com.jpexs.decompiler.flash.tags.DefineTextTag; import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag; import com.jpexs.decompiler.flash.tags.DoActionTag; +import com.jpexs.decompiler.flash.tags.DoInitActionTag; import com.jpexs.decompiler.flash.tags.EndTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; @@ -2220,6 +2221,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec } }, text)) { + textTag.setModified(true); return true; } } catch (ParseException ex) { @@ -2346,6 +2348,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec SWF swf = it.getSwf(); if (it instanceof DefineBitsTag) { DefineBitsJPEG2Tag jpeg2Tag = new DefineBitsJPEG2Tag(swf, it.getOriginalData(), it.getPos(), it.getCharacterId(), data); + jpeg2Tag.setModified(true); swf.tags.set(swf.tags.indexOf(it), jpeg2Tag); swf.updateCharacters(); refreshTree(); @@ -2374,6 +2377,7 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec File selfile = Helper.fixDialogFile(fc.getSelectedFile()); byte[] data = Helper.readFile(selfile.getAbsolutePath()); bt.binaryData = data; + bt.setModified(true); reload(true); } } @@ -2845,6 +2849,12 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec if (frameCnt > fn.getFrame()) { break; } + + if (item instanceof DoActionTag || item instanceof DoInitActionTag) { + // todo: Maybe DoABC tags should be removed, too + continue; + } + Tag t = (Tag) item; Set needed = t.getDeepNeededCharacters(swf.characters); for (int n : needed) { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java index 9d5195c0c..4695374df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ASMSourceEditorPane.java @@ -33,6 +33,7 @@ import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.helpers.HilightedText; import com.jpexs.decompiler.flash.helpers.HilightedTextWriter; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.helpers.Helper; import java.io.ByteArrayInputStream; @@ -221,6 +222,7 @@ public class ASMSourceEditorPane extends LineMarkedEditorPane implements CaretLi acode.getBytes(abc.bodies[bodyIndex].codeBytes); abc.bodies[bodyIndex].code = acode; } + ((Tag) abc.parentTag).setModified(true); } catch (IOException ex) { } catch (InterruptedException ex) { } catch (ParseException ex) { 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 722d8ded8..c58aafd73 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/action/ActionPanel.java @@ -727,6 +727,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene } else { src.setActions(ASMParser.parse(0, src.getPos(), true, text, src.getSwf().version, false)); } + src.setModified(); setSource(this.src, false); View.showMessageDialog(this, AppStrings.translate("message.action.saved")); saveButton.setVisible(false); @@ -749,6 +750,7 @@ public class ActionPanel extends JPanel implements ActionListener, SearchListene try { ActionScriptParser par = new ActionScriptParser(); src.setActions(par.actionsFromString(decompiledEditor.getText())); + src.setModified(); setSource(src, false); View.showMessageDialog(this, AppStrings.translate("message.action.saved")); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index bab869991..a298ea932 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -84,6 +84,7 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { @Override public void setImage(byte[] data) { imageData = data; + setModified(true); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index 7e44a18d0..48a10e2af 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -62,6 +62,7 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { bitmapAlphaData = new byte[0]; } imageData = data; + setModified(true); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index 9c3222b1b..038fe5a04 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -79,6 +79,7 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { } else { bitmapAlphaData = new byte[0]; } + setModified(true); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index bdc45db84..4fc642b4e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -104,6 +104,7 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { sos2.writeBytesZlib(bitmapDataOS.toByteArray()); zlibBitmapData = zlibOS.toByteArray(); decompressed = false; + setModified(true); } public DefineBitsLossless2Tag(SWF swf, byte[] data, long pos) throws IOException { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index fde3e359f..2153c011d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -103,6 +103,7 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { sos2.writeBytesZlib(bitmapDataOS.toByteArray()); zlibBitmapData = zlibOS.toByteArray(); decompressed = false; + setModified(true); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index 3b1151059..4a7fb8d04 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -113,7 +113,7 @@ public class DefineButton2Tag extends ButtonTag implements Container { int actionOffset = sis.readUI16(); characters = sis.readBUTTONRECORDList(true); if (actionOffset > 0) { - actions = sis.readBUTTONCONDACTIONList(swf); + actions = sis.readBUTTONCONDACTIONList(swf, this); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index e6febb491..a19493bca 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -211,6 +211,11 @@ public class DefineButtonTag extends ButtonTag implements ASMSource { this.actionBytes = actionBytes; } + @Override + public void setModified() { + setModified(true); + } + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index ff6465ef7..5e9fd5011 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -282,6 +282,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { this.soundData = newSoundData; this.soundType = newSoundType; this.soundFormat = newSoundFormat; + setModified(true); return true; } return false; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index d9b1011d4..fd91c4478 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -78,7 +78,7 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { SWFInputStream sis = new SWFInputStream(is, swf.version); flags = sis.readUI32(); name = sis.readString(); - abc = new ABC(is, swf); + abc = new ABC(is, swf, this); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index 83fed28a9..e2bf98a73 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -61,7 +61,7 @@ public class DoABCTag extends Tag implements ABCContainerTag { public DoABCTag(SWF swf, byte[] data, long pos) throws IOException { super(swf, ID, "DoABC", data, pos); InputStream is = new ByteArrayInputStream(data); - abc = new ABC(is, swf); + abc = new ABC(is, swf, this); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index 532a34e1e..7f7c038f7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -146,6 +146,11 @@ public class DoActionTag extends Tag implements ASMSource { this.actionBytes = actionBytes; } + @Override + public void setModified() { + setModified(true); + } + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 470f7f017..b3fda9f70 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -159,6 +159,11 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { this.actionBytes = actionBytes; } + @Override + public void setModified() { + setModified(true); + } + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index 753e60c13..559e89857 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -253,7 +253,7 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO clipDepth = sis.readUI16(); } if (placeFlagHasClipActions) { - clipActions = sis.readCLIPACTIONS(swf); + clipActions = sis.readCLIPACTIONS(swf, this); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 57aefc2e6..79726d436 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -372,7 +372,7 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO } if (placeFlagHasClipActions) { - clipActions = sis.readCLIPACTIONS(swf); + clipActions = sis.readCLIPACTIONS(swf, this); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java index 7ddfea03d..c454139e8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject4Tag.java @@ -374,7 +374,7 @@ public class PlaceObject4Tag extends CharacterIdTag implements Container, PlaceO } if (placeFlagHasClipActions) { - clipActions = sis.readCLIPACTIONS(swf); + clipActions = sis.readCLIPACTIONS(swf, this); } amfData = sis.readBytesEx(sis.available()); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java index 3fb67d667..0be3d08a9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -298,6 +298,13 @@ public class Tag implements NeedsCharacters, Exportable, ContainerItem, Serializ return data; } + public byte[] getDataOrOriginalData() { + if (modified) { + return getData(); + } + return data; + } + /** * Returns string representation of the object * diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java index e673cbc19..84c7a01e6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ASMSource.java @@ -62,6 +62,8 @@ public interface ASMSource extends TreeItem { * @param actions Action list */ public void setActions(List actions); + + public void setModified(); public byte[] getActionBytes(); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index 8bf3c7776..5472b591e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionListReader; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.ContainerItem; import com.jpexs.decompiler.flash.tags.base.Exportable; @@ -47,6 +48,7 @@ import java.util.logging.Logger; public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem, Serializable { private final SWF swf; + private final Tag tag; private final long pos; @Override @@ -59,8 +61,9 @@ public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem, S return pos; } - public BUTTONCONDACTION(SWF swf, InputStream is, long containerOffset) throws IOException { + public BUTTONCONDACTION(SWF swf, InputStream is, long containerOffset, Tag tag) throws IOException { this.swf = swf; + this.tag = tag; SWFInputStream sis = new SWFInputStream(is, swf.version); pos = containerOffset; int condActionSize = sis.readUI16(); @@ -217,6 +220,13 @@ public class BUTTONCONDACTION implements ASMSource, Exportable, ContainerItem, S this.actionBytes = actionBytes; } + @Override + public void setModified() { + if (tag != null) { + tag.setModified(true); + } + } + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 78874373a..cfcdb1274 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionListReader; import com.jpexs.decompiler.flash.exporters.modes.ScriptExportMode; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.ContainerItem; import com.jpexs.decompiler.flash.tags.base.Exportable; @@ -91,6 +92,8 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, S @Internal private final SWF swf; @Internal + private final Tag tag; + @Internal private long pos; @Internal private long hdrPos; @@ -98,13 +101,15 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, S //Constructor for Generic tag editor. TODO:Handle this somehow better public CLIPACTIONRECORD() { swf = null; + tag = null; eventFlags = new CLIPEVENTFLAGS(); actionBytes = new byte[0]; hdrPos = 0; } - public CLIPACTIONRECORD(SWF swf, InputStream is, long pos) throws IOException { + public CLIPACTIONRECORD(SWF swf, InputStream is, long pos, Tag tag) throws IOException { this.swf = swf; + this.tag = tag; SWFInputStream sis = new SWFInputStream(is, swf.version); eventFlags = sis.readCLIPEVENTFLAGS(); if (eventFlags.isClear()) { @@ -224,6 +229,13 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable, ContainerItem, S this.actionBytes = actionBytes; } + @Override + public void setModified() { + if (tag != null) { + tag.setModified(true); + } + } + @Override public GraphTextWriter getActionBytesAsHex(GraphTextWriter writer) { return Helper.byteArrayToHexWithHeader(writer, actionBytes);