Added #1959 Display frame labels along frames and FrameLabel tags

This commit is contained in:
Jindra Petřík
2023-02-04 19:36:21 +01:00
parent aaa354804e
commit b43f99efe6
4 changed files with 39 additions and 6 deletions

View File

@@ -86,4 +86,10 @@ public class FrameLabelTag extends Tag {
public boolean isNamedAnchor() {
return namedAnchor;
}
@Override
public String toString() {
return getName() + (name.isEmpty() ? "" : " (" + name + ")");
}
}

View File

@@ -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 class Frame implements TreeItem, Exportable {
@Override
public String toString() {
return "frame " + (frame + 1);
String name = "frame " + (frame + 1);
List<String> 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