mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-05 05:24:49 +00:00
Fixed #2135 FLA Export - framescripts handling when addFrameScript uses Multinames instead of QNames
This commit is contained in:
@@ -64,7 +64,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
|
||||
private boolean classInitializerIsEmpty;
|
||||
|
||||
private List<Integer> frameTraitNames = new ArrayList<>();
|
||||
private List<String> frameTraitNames = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void delete(ABC abc, boolean d) {
|
||||
@@ -338,14 +338,14 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (callProp.arguments.get(i) instanceof IntegerValueAVM2Item) {
|
||||
if (callProp.arguments.get(i + 1) instanceof GetLexAVM2Item) {
|
||||
GetLexAVM2Item lex = (GetLexAVM2Item) callProp.arguments.get(i + 1);
|
||||
frameTraitNames.add(abc.constants.getMultinameId(lex.propertyName, false));
|
||||
frameTraitNames.add(lex.propertyName.getName(abc.constants, new ArrayList<>(), false, true));
|
||||
} else if (callProp.arguments.get(i + 1) instanceof GetPropertyAVM2Item) {
|
||||
GetPropertyAVM2Item getProp = (GetPropertyAVM2Item) callProp.arguments.get(i + 1);
|
||||
if (getProp.object instanceof ThisAVM2Item) {
|
||||
if (getProp.propertyName instanceof FullMultinameAVM2Item) {
|
||||
FullMultinameAVM2Item framePropName = (FullMultinameAVM2Item) getProp.propertyName;
|
||||
int multinameIndex = framePropName.multinameIndex;
|
||||
frameTraitNames.add(multinameIndex);
|
||||
frameTraitNames.add(abc.constants.getMultiname(multinameIndex).getName(abc.constants, new ArrayList<>(), false, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public class Traits implements Cloneable, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public GraphTextWriter toString(AbcIndexing abcIndex, Class[] traitTypes, Trait parent, ConvertData convertData, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel, List<Integer> ignoredTraitNames, boolean insideInterface) throws InterruptedException {
|
||||
public GraphTextWriter toString(AbcIndexing abcIndex, Class[] traitTypes, Trait parent, ConvertData convertData, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, boolean makePackages, int scriptIndex, int classIndex, GraphTextWriter writer, List<DottedChain> fullyQualifiedNames, boolean parallel, List<String> ignoredTraitNames, boolean insideInterface) throws InterruptedException {
|
||||
|
||||
List<Trait> ordered = new ArrayList<>(traits);
|
||||
loopi:
|
||||
@@ -227,7 +227,7 @@ public class Traits implements Cloneable, Serializable {
|
||||
if (!trait.isVisible(isStatic, abc)) {
|
||||
continue;
|
||||
}
|
||||
if (ignoredTraitNames.contains(trait.name_index)) {
|
||||
if (ignoredTraitNames.contains(trait.getName(abc).getName(abc.constants, new ArrayList<>(), false, false))) {
|
||||
continue;
|
||||
}
|
||||
writer.newLine();
|
||||
|
||||
@@ -2916,7 +2916,7 @@ public class XFLConverter {
|
||||
callStack.add(constructorBody);
|
||||
constructorBody.convert(callStack, abcIndex, new ConvertData(), "??", ScriptExportMode.AS, false, constructorMethodIndex, pack.scriptIndex, classIndex, abc, null, new ScopeStack(), GraphTextWriter.TRAIT_INSTANCE_INITIALIZER, new NulWriter(), new ArrayList<>(), new Traits(), true, new HashSet<>());
|
||||
|
||||
Map<Integer, Multiname> frameToTraitMultiname = new HashMap<>();
|
||||
Map<Integer, String> frameToTraitName = new HashMap<>();
|
||||
|
||||
//find all addFrameScript(xx,this.method) in constructor
|
||||
/*
|
||||
@@ -2946,14 +2946,14 @@ public class XFLConverter {
|
||||
int frame = frameItem.intValue();
|
||||
if (callProp.arguments.get(i + 1) instanceof GetLexAVM2Item) {
|
||||
GetLexAVM2Item lex = (GetLexAVM2Item) callProp.arguments.get(i + 1);
|
||||
frameToTraitMultiname.put(frame, lex.propertyName);
|
||||
frameToTraitName.put(frame, lex.propertyName.getName(abc.constants, new ArrayList<>(), true, false));
|
||||
} else if (callProp.arguments.get(i + 1) instanceof GetPropertyAVM2Item) {
|
||||
GetPropertyAVM2Item getProp = (GetPropertyAVM2Item) callProp.arguments.get(i + 1);
|
||||
if (getProp.object instanceof ThisAVM2Item) {
|
||||
if (getProp.propertyName instanceof FullMultinameAVM2Item) {
|
||||
FullMultinameAVM2Item framePropName = (FullMultinameAVM2Item) getProp.propertyName;
|
||||
int multinameIndex = framePropName.multinameIndex;
|
||||
frameToTraitMultiname.put(frame, abc.constants.getMultiname(multinameIndex));
|
||||
frameToTraitName.put(frame, abc.constants.getMultiname(multinameIndex).getName(abc.constants, new ArrayList<>(), true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2964,18 +2964,18 @@ public class XFLConverter {
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<Multiname, TraitMethodGetterSetter> multinameToMethodTrait = new HashMap<>();
|
||||
Map<String, TraitMethodGetterSetter> multinameToMethodTrait = new HashMap<>();
|
||||
for (Trait trait : instanceInfo.instance_traits.traits) {
|
||||
if (trait instanceof TraitMethodGetterSetter) {
|
||||
Multiname m = abc.constants.getMultiname(trait.name_index);
|
||||
multinameToMethodTrait.put(abc.constants.getMultiname(trait.name_index), (TraitMethodGetterSetter) trait);
|
||||
multinameToMethodTrait.put(abc.constants.getMultiname(trait.name_index).getName(abc.constants, new ArrayList<>(), true, false), (TraitMethodGetterSetter) trait);
|
||||
}
|
||||
}
|
||||
|
||||
for (int frame : frameToTraitMultiname.keySet()) {
|
||||
Multiname multiName = frameToTraitMultiname.get(frame);
|
||||
if (multinameToMethodTrait.containsKey(multiName)) {
|
||||
TraitMethodGetterSetter methodTrait = multinameToMethodTrait.get(multiName);
|
||||
for (int frame : frameToTraitName.keySet()) {
|
||||
String traitName = frameToTraitName.get(frame);
|
||||
if (multinameToMethodTrait.containsKey(traitName)) {
|
||||
TraitMethodGetterSetter methodTrait = multinameToMethodTrait.get(traitName);
|
||||
int methodIndex = methodTrait.method_info;
|
||||
MethodBody frameBody = abc.findBody(methodIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user