mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-23 12:45:36 +00:00
Hilighting compound scripts, Search results exception fix
This commit is contained in:
@@ -342,7 +342,7 @@ public class SearchResultsStorage {
|
||||
public void destroySwf(SWF swf) {
|
||||
String swfId = getOpenableId(swf);
|
||||
for (int i = 0; i < openableIds.size(); i++) {
|
||||
if (openableIds.get(i).equals(swfId)) {
|
||||
if (openableIds.get(i).equals(swfId) && unpackedData.size() > i) {
|
||||
unpackedData.set(i, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,6 +693,10 @@ public class ABCExplorerDialog extends AppDialog {
|
||||
|
||||
if (scriptIndex != -1) {
|
||||
DottedChain scriptNameDc = abc.script_info.get(scriptIndex).getSimplePackName(abc);
|
||||
if (scriptNameDc == null && (sv.getParentValue() instanceof ScriptInfo)) {
|
||||
scriptNameDc = abc.script_info.get(scriptIndex).traits.traits.get(traitIndex).getName(abc).getNameWithNamespace(abc.constants, false);
|
||||
}
|
||||
|
||||
String scriptName = (scriptNameDc == null ? "script_" + scriptIndex : scriptNameDc.toPrintableString(true));
|
||||
mainPanel.gotoScriptTrait(abc.getSwf(), scriptName, classIndex, globalTraitIndex);
|
||||
}
|
||||
|
||||
@@ -1448,27 +1448,49 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
|
||||
String pkg = name.contains(".") ? name.substring(0, name.lastIndexOf(".")) : "";
|
||||
String parts[] = name.split("\\.");
|
||||
|
||||
loopparts:
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
for (TreeItem ti : tree.getFullModel().getAllChildren(item)) {
|
||||
if ((ti instanceof AS3Package) && ((AS3Package) ti).isFlat()) {
|
||||
AS3Package pti = (AS3Package) ti;
|
||||
if ((pkg.isEmpty() && pti.isDefaultPackage()) || (!pti.isDefaultPackage() && pkg.equals(pti.packageName))) {
|
||||
item = pti;
|
||||
i = parts.length - 1 - 1;
|
||||
break;
|
||||
List<Object> rootNodes = new ArrayList<>();
|
||||
rootNodes.add(item);
|
||||
List<? extends TreeItem> firstLevelNodes = tree.getFullModel().getAllChildren(item);
|
||||
for (TreeItem ti :firstLevelNodes) {
|
||||
if ((ti instanceof AS3Package)&&(((AS3Package)ti).isCompoundScript())) {
|
||||
rootNodes.add(ti);
|
||||
}
|
||||
}
|
||||
|
||||
looproot:for (Object root : rootNodes) {
|
||||
item = root;
|
||||
loopparts:
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
boolean found = false;
|
||||
for (TreeItem ti : tree.getFullModel().getAllChildren(item)) {
|
||||
if ((ti instanceof AS3Package) && ((AS3Package) ti).isFlat()) {
|
||||
AS3Package pti = (AS3Package) ti;
|
||||
if ((pkg.isEmpty() && pti.isDefaultPackage()) || (!pti.isDefaultPackage() && pkg.equals(pti.packageName))) {
|
||||
item = pti;
|
||||
i = parts.length - 1 - 1;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ((ti instanceof AS3Package)&&(((AS3Package)ti).isCompoundScript())) {
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ti instanceof AS3ClassTreeItem) {
|
||||
AS3ClassTreeItem cti = (AS3ClassTreeItem) ti;
|
||||
if (ti instanceof AS3ClassTreeItem) {
|
||||
AS3ClassTreeItem cti = (AS3ClassTreeItem) ti;
|
||||
|
||||
if (parts[i].equals(cti.getPrintableNameWithNamespaceSuffix())) {
|
||||
item = ti;
|
||||
break;
|
||||
if (parts[i].equals(cti.getPrintableNameWithNamespaceSuffix())) {
|
||||
item = ti;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
continue looproot;
|
||||
}
|
||||
}
|
||||
break; //found
|
||||
}
|
||||
mainPanel.setTagTreeSelectedNode(mainPanel.getCurrentTree(), (TreeItem) item);
|
||||
mainPanel.reload(true);
|
||||
|
||||
@@ -53,6 +53,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.WeakHashMap;
|
||||
import javax.swing.event.TreeModelEvent;
|
||||
import javax.swing.event.TreeModelListener;
|
||||
@@ -399,6 +400,16 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
||||
newPath.addAll(path);
|
||||
newPath.add(n);
|
||||
|
||||
if (n instanceof AS3Package) {
|
||||
AS3Package pkg = (AS3Package)n;
|
||||
if (obj instanceof AS3Package) {
|
||||
AS3Package opkg = (AS3Package)obj;
|
||||
if (Objects.equals(pkg.packageName, opkg.packageName) && pkg.getAbc() == opkg.getAbc()) {
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (n instanceof AS3ClassTreeItem) {
|
||||
AS3ClassTreeItem te = (AS3ClassTreeItem) n;
|
||||
if (obj == te) {
|
||||
|
||||
Reference in New Issue
Block a user