diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fc33ca67f..bd132d5fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added +- [#1959] Display frame labels along frames and FrameLabel tags + ### Fixed - [#1960] Hide tag tree root handles as it was in previous versions - [#1964] Freezing on releasing mouse while shape transforming (deadlock) @@ -2939,6 +2942,7 @@ All notable changes to this project will be documented in this file. [alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9 [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 +[#1959]: https://www.free-decompiler.com/flash/issues/1959 [#1960]: https://www.free-decompiler.com/flash/issues/1960 [#1964]: https://www.free-decompiler.com/flash/issues/1964 [#1961]: https://www.free-decompiler.com/flash/issues/1961 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java index 982e57ae3e..52e2a40604 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java @@ -86,4 +86,10 @@ public String getLabelName() { public boolean isNamedAnchor() { return namedAnchor; } + + @Override + public String toString() { + return getName() + (name.isEmpty() ? "" : " (" + name + ")"); + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java index 84d623219b..04354fe346 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Frame.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.timeline; import com.jpexs.decompiler.flash.tags.DoActionTag; +import com.jpexs.decompiler.flash.tags.FrameLabelTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSourceContainer; @@ -93,7 +94,17 @@ public Openable getOpenable() { @Override public String toString() { - return "frame " + (frame + 1); + String name = "frame " + (frame + 1); + List labels = new ArrayList<>(); + for (Tag t : innerTags) { + if (t instanceof FrameLabelTag) { + labels.add(((FrameLabelTag)t).name); + } + } + if (!labels.isEmpty()) { + name += " (" + String.join(", ", labels) + ")"; + } + return name; } @Override diff --git a/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java b/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java index 0ce39df73f..d35a48f9f5 100644 --- a/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SelectTagPositionDialog.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.gui.tagtree.TagTree; import com.jpexs.decompiler.flash.tags.DefineSpriteTag; import com.jpexs.decompiler.flash.tags.DoInitActionTag; +import com.jpexs.decompiler.flash.tags.FrameLabelTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.timeline.Timelined; @@ -163,9 +164,11 @@ private static class MyFrame { private final int frame; private boolean invalid; + private List labels; - public MyFrame(int frame) { + public MyFrame(int frame, List labels) { this.frame = frame; + this.labels = labels; } public int getFrame() { @@ -182,7 +185,11 @@ public boolean isInvalid() { @Override public String toString() { - return "frame " + frame; + String name = "frame " + frame; + if (!labels.isEmpty()) { + name += " (" + String.join(", ", labels) + ")"; + } + return name; } } @@ -190,7 +197,8 @@ private void populateNodes(MyTreeNode root, Timelined tim) { int f = 1; MyTreeNode frameNode = new MyTreeNode(); - frameNode.setData(new MyFrame(1)); + List labels = new ArrayList<>(); + frameNode.setData(new MyFrame(1, labels)); frameNode.setParent(root); root.addChild(frameNode); @@ -204,12 +212,16 @@ private void populateNodes(MyTreeNode root, Timelined tim) { populateNodes(node, (DefineSpriteTag) t); } } + if (t instanceof FrameLabelTag) { + labels.add(((FrameLabelTag)t).name); + } if (t instanceof ShowFrameTag) { f++; frameNode = new MyTreeNode(); - frameNode.setData(new MyFrame(f)); + labels = new ArrayList<>(); + frameNode.setData(new MyFrame(f, labels)); frameNode.setParent(root); - root.addChild(frameNode); + root.addChild(frameNode); } } if (frameNode.isLeaf()) {