diff --git a/CHANGELOG.md b/CHANGELOG.md index 683151416..140602236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ All notable changes to this project will be documented in this file. (CharacterSet, GenCommand, NameCharacter, DefineTextFormat, FontRef) - DefineVideo tag support (Flash 4) - SerialNumber tag support (before Flash 7) +- FreeCharacter tag support +- SyncFrame tag support ### Fixed - [#2474] Gotos incorrectly decompiled diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/DefineBeforeUsageFixer.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/DefineBeforeUsageFixer.java index c2e6ca167..d509bf4ff 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/DefineBeforeUsageFixer.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/DefineBeforeUsageFixer.java @@ -16,9 +16,11 @@ */ package com.jpexs.decompiler.flash; +import com.jpexs.decompiler.flash.tags.FreeCharacterTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; import com.jpexs.decompiler.flash.tags.base.RemoveTag; @@ -64,11 +66,8 @@ public class DefineBeforeUsageFixer { int i = 0; for (int j = 0; j < swf.getTags().size(); j++) { Tag t2 = swf.getTags().get(j); - if ((t2 instanceof CharacterIdTag) - && !(t2 instanceof PlaceObjectTypeTag) - && !(t2 instanceof RemoveTag) - && !(t2 instanceof VideoFrameTag)) { - CharacterIdTag chit = (CharacterIdTag) t2; + if (t2 instanceof CharacterModifier) { + CharacterModifier chit = (CharacterModifier) t2; if (chit.getCharacterId() == characterId) { swf.removeTag(j); swf.addTag(usageIndex + i, (Tag) chit); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index 107e51db8..e2cd52b82 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.CXFORM; import com.jpexs.decompiler.flash.types.annotations.SWFType; @@ -35,7 +35,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 2) -public class DefineButtonCxformTag extends Tag implements CharacterIdTag { +public class DefineButtonCxformTag extends Tag implements CharacterModifier { public static final int ID = 23; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index cdd829351..432f7f528 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.SOUNDINFO; import com.jpexs.decompiler.flash.types.annotations.SWFType; @@ -35,7 +35,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 2) -public class DefineButtonSoundTag extends Tag implements CharacterIdTag { +public class DefineButtonSoundTag extends Tag implements CharacterModifier { public static final int ID = 17; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java index 6c46e0dde..1963541ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.ZONERECORD; import com.jpexs.decompiler.flash.types.annotations.EnumValue; @@ -40,7 +40,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 8) -public class DefineFontAlignZonesTag extends Tag implements CharacterIdTag { +public class DefineFontAlignZonesTag extends Tag implements CharacterModifier { public static final int ID = 73; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java index c068401cb..834f5089b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.decompiler.flash.types.annotations.SWFVersion; @@ -34,7 +34,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 9) -public class DefineFontNameTag extends Tag implements CharacterIdTag { +public class DefineFontNameTag extends Tag implements CharacterModifier { public static final int ID = 88; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index 7bcd0b5a4..46efb49f0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -22,7 +22,7 @@ import com.jpexs.decompiler.flash.SWFOutputStream; import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle; import com.jpexs.decompiler.flash.exporters.commonshape.Matrix; import com.jpexs.decompiler.flash.exporters.commonshape.Point; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.DrawableTag; import com.jpexs.decompiler.flash.tags.base.RenderContext; @@ -46,7 +46,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 8) -public class DefineScalingGridTag extends Tag implements CharacterIdTag { +public class DefineScalingGridTag extends Tag implements CharacterModifier { public static final int ID = 78; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextFormatTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextFormatTag.java index 8f69eb266..6d951b538 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextFormatTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineTextFormatTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.RECT; import com.jpexs.decompiler.flash.types.annotations.SWFType; @@ -36,7 +36,7 @@ import java.util.List; * @author JPEXS */ @SWFVersion(from = 3) -public class DefineTextFormatTag extends Tag implements CharacterIdTag { +public class DefineTextFormatTag extends Tag implements CharacterModifier { public static final int ID = 42; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeAllTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeAllTag.java index cac9c7d03..88f1c39dc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeAllTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeAllTag.java @@ -24,7 +24,7 @@ import com.jpexs.helpers.ByteArrayRange; import java.io.IOException; /** - * FreeAll tag - undocumented. + * FreeAll tag - undocumented. Seems to do nothing. * * @author JPEXS */ diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeCharacterTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeCharacterTag.java index 884efba77..694b7ff90 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeCharacterTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FreeCharacterTag.java @@ -25,10 +25,11 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.decompiler.flash.types.annotations.SWFVersion; import com.jpexs.helpers.ByteArrayRange; import java.io.IOException; +import java.util.Map; import java.util.Set; /** - * FreeCharacter tag - undocumented. + * FreeCharacter tag - undocumented. Frees a character. * * @author JPEXS */ @@ -89,4 +90,13 @@ public class FreeCharacterTag extends Tag implements CharacterIdTag { public void getNeededCharacters(Set needed, SWF swf) { needed.add(characterId); } + + @Override + public Map getNameProperties() { + Map ret = super.getNameProperties(); + ret.put("chid", "" + characterId); + return ret; + } + + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/NameCharacterTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/NameCharacterTag.java index 410d3ed89..12fe8cf96 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/NameCharacterTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/NameCharacterTag.java @@ -19,7 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; -import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.types.BasicType; import com.jpexs.decompiler.flash.types.annotations.SWFType; import com.jpexs.decompiler.flash.types.annotations.SWFVersion; @@ -34,7 +34,7 @@ import java.util.Set; * @author JPEXS */ @SWFVersion(from = 3) -public class NameCharacterTag extends Tag implements CharacterIdTag { +public class NameCharacterTag extends Tag implements CharacterModifier { public static final int ID = 40; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java index 3df248023..8fc83fcca 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java @@ -53,6 +53,8 @@ public class ShowFrameTag extends Tag { add(SoundStreamBlockTag.ID); add(SetTabIndexTag.ID); add(GenCommandTag.ID); + add(FreeCharacterTag.ID); + add(SyncFrameTag.ID); /*add(SoundStreamHeadTag.ID); add(SoundStreamHead2Tag.ID);*/ } 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 c4be9f6de..dc20751c8 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 @@ -413,6 +413,10 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable { addTagInfo(map, map2, NameCharacterTag.ID, NameCharacterTag.class, NameCharacterTag.NAME); addTagInfo(map, map2, CharacterSetTag.ID, CharacterSetTag.class, CharacterSetTag.NAME); addTagInfo(map, map2, SerialNumberTag.ID, SerialNumberTag.class, SerialNumberTag.NAME); + + addTagInfo(map, map2, FreeCharacterTag.ID, FreeCharacterTag.class, FreeCharacterTag.NAME); + addTagInfo(map, map2, SyncFrameTag.ID, SyncFrameTag.class, SyncFrameTag.NAME); + knownTagInfosById = map; knownTagInfosByName = map2; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterModifier.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterModifier.java new file mode 100644 index 000000000..74e75221b --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/CharacterModifier.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2010-2025 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.tags.base; + +/** + * A CharacterIdTag that modifies the character somehow + * @author JPEXS + */ +public interface CharacterModifier extends CharacterIdTag { + +} diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontInfoTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontInfoTag.java index c6b3ffe8f..a416df5da 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontInfoTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/base/FontInfoTag.java @@ -29,7 +29,7 @@ import java.util.Map; * * @author JPEXS */ -public abstract class FontInfoTag extends Tag implements CharacterIdTag { +public abstract class FontInfoTag extends Tag implements CharacterModifier { /** * Font ID diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java index fd821d70e..7dcf683b5 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/AbstractTagTree.java @@ -54,7 +54,6 @@ import com.jpexs.decompiler.flash.tags.DefineSceneAndFrameLabelDataTag; import com.jpexs.decompiler.flash.tags.DefineSoundTag; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DefineTextFormatTag; -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; @@ -65,6 +64,8 @@ import com.jpexs.decompiler.flash.tags.EndTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.FrameLabelTag; +import com.jpexs.decompiler.flash.tags.FreeCharacterTag; +import com.jpexs.decompiler.flash.tags.GenCommandTag; import com.jpexs.decompiler.flash.tags.ImportAssets2Tag; import com.jpexs.decompiler.flash.tags.ImportAssetsTag; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; @@ -89,6 +90,7 @@ import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag; import com.jpexs.decompiler.flash.tags.StartSound2Tag; import com.jpexs.decompiler.flash.tags.StartSoundTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.SyncFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.TagStub; import com.jpexs.decompiler.flash.tags.UnknownTag; @@ -105,7 +107,6 @@ import com.jpexs.decompiler.flash.tags.base.RemoveTag; import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import com.jpexs.decompiler.flash.tags.base.StaticTextTag; -import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.tags.gfx.DefineExternalSound; @@ -877,7 +878,10 @@ public abstract class AbstractTagTree extends JTree { RemoveObjectTag.ID, RemoveObject2Tag.ID, ShowFrameTag.ID, FrameLabelTag.ID, StartSoundTag.ID, StartSound2Tag.ID, VideoFrameTag.ID, SoundStreamBlockTag.ID, SoundStreamHeadTag.ID, SoundStreamHead2Tag.ID, - SetTabIndexTag.ID, PlaceImagePrivateTag.ID + SetTabIndexTag.ID, PlaceImagePrivateTag.ID, + GenCommandTag.ID, + FreeCharacterTag.ID, + SyncFrameTag.ID ); } diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagIdClassMap.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagIdClassMap.java index eb1e634db..24f228013 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagIdClassMap.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagIdClassMap.java @@ -66,6 +66,7 @@ import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.FontRefTag; import com.jpexs.decompiler.flash.tags.FrameLabelTag; +import com.jpexs.decompiler.flash.tags.FreeCharacterTag; import com.jpexs.decompiler.flash.tags.GenCommandTag; import com.jpexs.decompiler.flash.tags.ImportAssets2Tag; import com.jpexs.decompiler.flash.tags.ImportAssetsTag; @@ -92,6 +93,7 @@ import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag; import com.jpexs.decompiler.flash.tags.StartSound2Tag; import com.jpexs.decompiler.flash.tags.StartSoundTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.SyncFrameTag; import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.tags.gfx.DefineExternalGradient; @@ -207,6 +209,9 @@ public class TagIdClassMap { addTag(NameCharacterTag.ID, NameCharacterTag.class); addTag(CharacterSetTag.ID, CharacterSetTag.class); addTag(SerialNumberTag.ID, SerialNumberTag.class); + + addTag(FreeCharacterTag.ID, FreeCharacterTag.class); + addTag(SyncFrameTag.ID, SyncFrameTag.class); } private static void addTag(int tagId, Class cl) { diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java index f34ba8724..5dd14dd73 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTree.java @@ -47,7 +47,6 @@ import com.jpexs.decompiler.flash.tags.DefineShapeTag; import com.jpexs.decompiler.flash.tags.DefineSoundTag; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DefineText2Tag; -import com.jpexs.decompiler.flash.tags.DefineTextFormatTag; import com.jpexs.decompiler.flash.tags.DefineTextTag; import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag; import com.jpexs.decompiler.flash.tags.DefineVideoTag; @@ -62,12 +61,12 @@ import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.FontRefTag; import com.jpexs.decompiler.flash.tags.FrameLabelTag; +import com.jpexs.decompiler.flash.tags.FreeCharacterTag; import com.jpexs.decompiler.flash.tags.GenCommandTag; import com.jpexs.decompiler.flash.tags.ImportAssets2Tag; import com.jpexs.decompiler.flash.tags.ImportAssetsTag; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; import com.jpexs.decompiler.flash.tags.MetadataTag; -import com.jpexs.decompiler.flash.tags.NameCharacterTag; import com.jpexs.decompiler.flash.tags.PlaceImagePrivateTag; import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; import com.jpexs.decompiler.flash.tags.PlaceObject3Tag; @@ -87,6 +86,7 @@ import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag; import com.jpexs.decompiler.flash.tags.StartSound2Tag; import com.jpexs.decompiler.flash.tags.StartSoundTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.SyncFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.VideoFrameTag; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; @@ -300,7 +300,10 @@ public class TagTree extends AbstractTagTree { StartSoundTag.ID, StartSound2Tag.ID, VideoFrameTag.ID, SoundStreamBlockTag.ID, SoundStreamHeadTag.ID, SoundStreamHead2Tag.ID, SetTabIndexTag.ID, PlaceImagePrivateTag.ID, - GenCommandTag.ID); + GenCommandTag.ID, + FreeCharacterTag.ID, + SyncFrameTag.ID + ); break; case TagTreeModel.FOLDER_OTHERS: ret = Arrays.asList( diff --git a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java index a5efb653c..e3b01b6e5 100644 --- a/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/tagtree/TagTreeContextMenu.java @@ -80,6 +80,7 @@ import com.jpexs.decompiler.flash.tags.DoInitActionTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.FileAttributesTag; import com.jpexs.decompiler.flash.tags.FrameLabelTag; +import com.jpexs.decompiler.flash.tags.FreeCharacterTag; import com.jpexs.decompiler.flash.tags.MetadataTag; import com.jpexs.decompiler.flash.tags.PlaceImagePrivateTag; import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; @@ -93,6 +94,7 @@ import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag; import com.jpexs.decompiler.flash.tags.StartSound2Tag; import com.jpexs.decompiler.flash.tags.StartSoundTag; import com.jpexs.decompiler.flash.tags.SymbolClassTag; +import com.jpexs.decompiler.flash.tags.SyncFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.TagTypeInfo; import com.jpexs.decompiler.flash.tags.UnknownTag; @@ -101,6 +103,7 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.BinaryDataInterface; import com.jpexs.decompiler.flash.tags.base.ButtonTag; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; +import com.jpexs.decompiler.flash.tags.base.CharacterModifier; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.DepthTag; import com.jpexs.decompiler.flash.tags.base.DrawableTag; @@ -5625,11 +5628,8 @@ public class TagTreeContextMenu extends JPopupMenu { int i = 0; for (int j = 0; j < swf.getTags().size(); j++) { Tag t2 = swf.getTags().get(j); - if ((t2 instanceof CharacterIdTag) - && !(t2 instanceof PlaceObjectTypeTag) - && !(t2 instanceof RemoveTag) - && !(t2 instanceof VideoFrameTag)) { - CharacterIdTag chit = (CharacterIdTag) t2; + if (t2 instanceof CharacterModifier) { + CharacterModifier chit = (CharacterModifier) t2; if (chit.getCharacterId() == characterId) { swf.removeTag(j); swf.addTag(usageIndex + i, (Tag) chit); @@ -5866,7 +5866,9 @@ public class TagTreeContextMenu extends JPopupMenu { || (tag instanceof StartSoundTag) || (tag instanceof StartSound2Tag) || (tag instanceof SoundStreamBlockTag) - || (tag instanceof DoActionTag); + || (tag instanceof DoActionTag) + || (tag instanceof FreeCharacterTag) + || (tag instanceof SyncFrameTag); } public void copyOrMoveTags(Set items, boolean move, Timelined targetTimelined, Tag position) {