mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-01 10:55:12 +00:00
Added #2124 Copy tags to other SWFs and replace same classes / export names
This commit is contained in:
@@ -413,6 +413,9 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
|
||||
|
||||
private static final DecompilerPool decompilerPool = new DecompilerPool();
|
||||
|
||||
@Internal
|
||||
private Map<String, Integer> exportNameToCharacter = new HashMap<>();
|
||||
|
||||
@Internal
|
||||
private AbcIndexing abcIndex;
|
||||
|
||||
@@ -822,6 +825,14 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
|
||||
int charId = classToCharacter.get(className);
|
||||
return getCharacter(charId);
|
||||
}
|
||||
|
||||
public CharacterTag getCharacterByExportName(String exportName) {
|
||||
if (!exportNameToCharacter.containsKey(exportName)) {
|
||||
return null;
|
||||
}
|
||||
int charId = exportNameToCharacter.get(exportName);
|
||||
return getCharacter(charId);
|
||||
}
|
||||
|
||||
public String getExportName(int characterId) {
|
||||
CharacterTag characterTag = getCharacters().get(characterId);
|
||||
@@ -1821,6 +1832,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
|
||||
}
|
||||
|
||||
public void assignExportNamesToSymbols() {
|
||||
exportNameToCharacter.clear();
|
||||
HashMap<Integer, String> exportNames = new HashMap<>(importedTagToExportNameMapping);
|
||||
for (Tag t : getTags()) {
|
||||
if (t instanceof ExportAssetsTag) {
|
||||
@@ -1830,6 +1842,7 @@ public final class SWF implements SWFContainerItem, Timelined, Openable {
|
||||
String name = eat.names.get(i);
|
||||
if ((!exportNames.containsKey(tagId)) && (!exportNames.containsValue(name))) {
|
||||
exportNames.put(tagId, name);
|
||||
exportNameToCharacter.put(name, tagId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user