Added: #1383 AS Debugger - debugging nested SWFs

This commit is contained in:
Jindra Petřík
2024-08-05 11:17:25 +02:00
parent c3389dbfd1
commit 84d6ad8591
45 changed files with 1409 additions and 192 deletions
@@ -81,6 +81,7 @@ import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.timeline.AS3Package;
import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
import com.jpexs.decompiler.flash.treeitems.Openable;
import com.jpexs.decompiler.flash.treeitems.OpenableList;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.helpers.CancellableWorker;
import com.jpexs.helpers.Helper;
@@ -1432,6 +1433,37 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
setVisible(true);
}
public void hilightScript(String nameIncludingSwfHash) {
if (!nameIncludingSwfHash.contains(":")) {
throw new RuntimeException("Script name should conatin swfHash");
}
String swfHash = nameIncludingSwfHash.substring(nameIncludingSwfHash.indexOf(":"));
String name = nameIncludingSwfHash.substring(nameIncludingSwfHash.indexOf(":") + 1);
Openable openable = null;
if (swfHash.equals("main")) {
openable = Main.getRunningSWF();
} else if (swfHash.startsWith("loaded_")) {
String hashToSearch = swfHash.substring("loaded_".length());
loop:for (OpenableList sl : Main.getMainFrame().getPanel().getSwfs()) {
for (int s = 0; s < sl.size(); s++) {
Openable op = sl.get(s);
String t = op.getTitleOrShortFileName();
if (t == null) {
t = "";
}
if (t.endsWith(":" + hashToSearch)) { //this one is already opened
openable = op;
break loop;
}
}
}
}
if (openable != null) {
hilightScript(openable, name);
}
}
/**
* Hilights specific script.
*