Additional character info tags now placed under the character in the tree

Few icons for tags (metadata,fileattributes,setbackground,place and remove tags)
This commit is contained in:
Jindra Petřík
2015-04-06 09:09:17 +02:00
parent 406fc032b2
commit 73f3bb10cc
27 changed files with 161 additions and 69 deletions

View File

@@ -352,7 +352,7 @@ public final class SWF implements SWFContainerItem, Timelined {
di.getChildInfos().clear();
}
public Map<Integer, CharacterTag> getCharacters() {
if (characters == null) {
synchronized (this) {
@@ -857,9 +857,11 @@ public final class SWF implements SWFContainerItem, Timelined {
this.tags = tags;
if (!checkOnly) {
checkInvalidSprites();
Map<Integer, CharacterTag> chars = new HashMap<>();
parseCharacters(tags, chars);
characters = chars;
assignExportNamesToSymbols();
assignClassesToSymbols();
SWFDecompilerPlugin.fireSwfParsed(this);
} else {
boolean hasNonUnknownTag = false;
@@ -950,8 +952,8 @@ public final class SWF implements SWFContainerItem, Timelined {
}
}
for (Tag t : tags) {
if (t instanceof CharacterIdTag) {
CharacterIdTag ct = (CharacterIdTag) t;
if (t instanceof CharacterTag) {
CharacterTag ct = (CharacterTag) t;
if (exportNames.containsKey(ct.getCharacterId())) {
ct.setExportName(exportNames.get(ct.getCharacterId()));
}
@@ -1939,7 +1941,7 @@ public final class SWF implements SWFContainerItem, Timelined {
cnt++;
informListeners("rename", "class " + cnt + "/" + classCount);
DoInitActionTag dia = (DoInitActionTag) t;
String exportName = dia.getExportName();
String exportName = characters.containsKey(dia.spriteId)?characters.get(dia.spriteId).getExportName():"_unk_";
final String pkgPrefix = "__Packages.";
String[] classNameParts = null;
if ((exportName != null) && exportName.startsWith(pkgPrefix)) {