mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 17:50:43 +00:00
Fixed Copy/Move with dependencies order of tags
BUTTONRECORD/CLIPACTIONRECORD swf / tag set
This commit is contained in:
@@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.types.ARGB;
|
||||
import com.jpexs.decompiler.flash.types.BasicType;
|
||||
import com.jpexs.decompiler.flash.types.CLIPACTIONRECORD;
|
||||
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
|
||||
import com.jpexs.decompiler.flash.types.HasSwfAndTag;
|
||||
import com.jpexs.decompiler.flash.types.RGB;
|
||||
import com.jpexs.decompiler.flash.types.RGBA;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Conditional;
|
||||
@@ -1228,6 +1229,9 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
ASMSource asv = (ASMSource) v;
|
||||
asv.setSourceTag(editedTag);
|
||||
}
|
||||
if (v instanceof HasSwfAndTag) {
|
||||
((HasSwfAndTag) obj).setSwfAndTag(editedTag.getSwf(), editedTag);
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
//ignore
|
||||
}
|
||||
@@ -1259,6 +1263,10 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
if ((obj instanceof CLIPACTIONS) && (v instanceof CLIPACTIONRECORD)) {
|
||||
((CLIPACTIONRECORD) v).setParentClipActions((CLIPACTIONS) obj);
|
||||
}
|
||||
|
||||
if (obj instanceof HasSwfAndTag) {
|
||||
((HasSwfAndTag) obj).setSwfAndTag(editedTag.getSwf(), editedTag);
|
||||
}
|
||||
|
||||
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
||||
//ignore
|
||||
|
||||
@@ -2686,20 +2686,13 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
Set<Integer> needed = new LinkedHashSet<>();
|
||||
Tag tag = (Tag) item;
|
||||
tag.getNeededCharactersDeep(needed);
|
||||
List<Integer> neededList = new ArrayList<>();
|
||||
if (tag instanceof CharacterTag) {
|
||||
needed.add(((CharacterTag) tag).getCharacterId());
|
||||
}
|
||||
for (Integer characterId : needed) {
|
||||
neededList.add(characterId);
|
||||
}
|
||||
|
||||
// first add dependencies in reverse order
|
||||
for (int n = neededList.size() - 1; n >= 0; n--) {
|
||||
int characterId = neededList.get(n);
|
||||
CharacterTag neededTag = sourceSwf.getCharacter(characterId);
|
||||
if (!newItems.contains(neededTag)) {
|
||||
newItems.add(neededTag);
|
||||
}
|
||||
newItems.add(neededTag);
|
||||
}
|
||||
newItems.add(item);
|
||||
}
|
||||
return newItems;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user