mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-15 09:48:26 +00:00
P-code display and edit traits outside classes
AS3 P-code limit of instruction matching added to configuration
This commit is contained in:
@@ -890,7 +890,9 @@ public class ABC {
|
||||
}
|
||||
|
||||
public boolean isStaticTraitId(int classIndex, int traitId) {
|
||||
if (traitId < class_info.get(classIndex).static_traits.traits.size()) {
|
||||
if (classIndex == -1) {
|
||||
return true;
|
||||
} else if (traitId < class_info.get(classIndex).static_traits.traits.size()) {
|
||||
return true;
|
||||
} else if (traitId < class_info.get(classIndex).static_traits.traits.size() + instance_info.get(classIndex).instance_traits.traits.size()) {
|
||||
return false;
|
||||
|
||||
@@ -240,6 +240,10 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
}
|
||||
|
||||
Trait trait = traits.get(t);
|
||||
|
||||
if (!(trait instanceof TraitClass)) {
|
||||
writer.startTrait(t);
|
||||
}
|
||||
Multiname name = trait.getName(abc);
|
||||
Namespace ns = name.getNamespace(abc.constants);
|
||||
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
|
||||
@@ -247,7 +251,9 @@ public class ScriptPack extends AS3ClassTreeItem {
|
||||
} else {
|
||||
trait.toString(null, convertData, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<>(), parallel);
|
||||
}
|
||||
|
||||
if (!(trait instanceof TraitClass)) {
|
||||
writer.endTrait();
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1314,7 +1314,7 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
writer.newLine();
|
||||
int ip = 0;
|
||||
int largeLimit = 20000;
|
||||
int largeLimit = Configuration.limitAs3PCodeOffsetMatching.get();
|
||||
boolean markOffsets = code.size() <= largeLimit;
|
||||
|
||||
if (exportMode == ScriptExportMode.HEX) {
|
||||
|
||||
@@ -697,6 +697,10 @@ public final class Configuration {
|
||||
@ConfigurationCategory("ui")
|
||||
public static ConfigurationItem<Boolean> useAsTypeIcons = null;
|
||||
|
||||
@ConfigurationDefaultInt(20000)
|
||||
@ConfigurationCategory("limit")
|
||||
public static ConfigurationItem<Integer> limitAs3PCodeOffsetMatching = null;
|
||||
|
||||
private enum OSId {
|
||||
WINDOWS, OSX, UNIX
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user