diff --git a/CHANGELOG.md b/CHANGELOG.md index 3331e7421..db1eeaf38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - [#1795] AS3 P-code - optional (default parameter values) saving - [#1785] AS1/2 try..catch block in for..in - [#1770] Links in basictag info (like needed/dependent characters) were barely visible on most themes +- Show in Resource command from Hex dump not working for tags inside DefineSprite ### Changed - [#1455] All tag types are now allowed inside DefineSprite diff --git a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java index 62b0d5487..ecb7cc178 100644 --- a/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java +++ b/src/com/jpexs/decompiler/flash/gui/dumpview/DumpTree.java @@ -78,6 +78,7 @@ import com.jpexs.decompiler.flash.tags.SoundStreamHead2Tag; import com.jpexs.decompiler.flash.tags.SoundStreamHeadTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; +import com.jpexs.decompiler.flash.timeline.Timelined; import com.jpexs.helpers.Helper; import com.jpexs.helpers.MemoryInputStream; import java.awt.Color; @@ -489,19 +490,29 @@ public class DumpTree extends JTree { repaint(); } + private Tag searchTimelinedForTag(Timelined timelined, long address) { + for (Tag tag : timelined.getTags()) { + if (tag.getOriginalRange().getPos() == address) { + return tag; + } + if (tag instanceof DefineSpriteTag) { + Tag subSpriteFound = searchTimelinedForTag(((DefineSpriteTag)tag), address); + if (subSpriteFound != null) { + return subSpriteFound; + } + } + } + return null; + } + private void gotoTagButtonActionPerformed(ActionEvent evt) { TreePath[] paths = getSelectionPaths(); DumpInfoSpecial dumpInfo = (DumpInfoSpecial) paths[0].getLastPathComponent(); SWF swf = DumpInfoSwfNode.getSwfNode(dumpInfo).getSwf(); long address = (long) (Long) dumpInfo.specialValue; - Tag foundTag = null; - for (Tag tag : swf.getTags()) { - if (tag.getOriginalRange().getPos() == address) { - foundTag = tag; - break; - } - } + + Tag foundTag = searchTimelinedForTag(swf, address); if (foundTag != null) { mainPanel.getMainFrame().getMenu().showResourcesView();