More hilighting fix

This commit is contained in:
Jindra Petřík
2023-09-30 19:23:52 +02:00
parent 1b35496f4f
commit d5de31973e
3 changed files with 13 additions and 6 deletions

View File

@@ -215,6 +215,7 @@ import com.jpexs.decompiler.flash.types.shaperecords.StraightEdgeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.StyleChangeRecord;
import com.jpexs.decompiler.flash.types.sound.SoundFormat;
import com.jpexs.decompiler.flash.xfl.FLAVersion;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.helpers.ByteArrayRange;
import com.jpexs.helpers.CancellableWorker;
import com.jpexs.helpers.Helper;
@@ -1852,7 +1853,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
updateClassesList();
reload(true);
ABCPanel abcPanel = getABCPanel();
abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.decompiledTextArea.getScriptLeaf().getClassPath().toRawString());
abcPanel.hilightScript(abcPanel.getSwf(), abcPanel.decompiledTextArea.getScriptLeaf().getClassPath().toString());
});
}
}
@@ -2555,15 +2556,16 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
return;
}
String documentClass = swf.getDocumentClass();
String documentClass = swf.getDocumentClass();
if (documentClass != null && currentView != VIEW_DUMP) {
String documentClassPrintable = DottedChain.parseNoSuffix(documentClass).toPrintableString(true);
List<ABCContainerTag> abcList = swf.getAbcList();
if (!abcList.isEmpty()) {
ABCPanel abcPanel = getABCPanel();
for (ABCContainerTag c : abcList) {
if (c.getABC().findClassByName(documentClass) > -1) {
if (c.getABC().findClassByName(documentClassPrintable) > -1) {
abcPanel.setAbc(c.getABC());
abcPanel.hilightScript(swf, documentClass);
abcPanel.hilightScript(swf, documentClassPrintable);
break;
}
}

View File

@@ -1393,6 +1393,11 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
setVisible(true);
}
/**
* Hilights specific script.
* @param openable
* @param name Full name of the script. It must be printable - deobfuscated, not raw!
*/
public void hilightScript(Openable openable, String name) {
TreeItem scriptNode = null;

View File

@@ -151,9 +151,9 @@ public class UsageFrame extends AppDialog implements MouseListener {
decompiledTextArea.addScriptListener(setTrait);
String scriptName;
if (icu.getClassIndex() > -1) {
scriptName = icu.getAbc().instance_info.get(icu.getClassIndex()).getName(icu.getAbc().constants).getNameWithNamespace(icu.getAbc().constants, true).toRawString();
scriptName = icu.getAbc().instance_info.get(icu.getClassIndex()).getName(icu.getAbc().constants).getNameWithNamespace(icu.getAbc().constants, true).toPrintableString(true);
} else if (icu.getScriptIndex() > -1) {
scriptName = icu.getAbc().script_info.get(icu.getScriptIndex()).getSimplePackName(icu.getAbc()).toRawString();
scriptName = icu.getAbc().script_info.get(icu.getScriptIndex()).getSimplePackName(icu.getAbc()).toPrintableString(true);
} else {
scriptName = "";
}