mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 05:58:33 +00:00
Fixed Copy / Move to tag tree refreshing
This commit is contained in:
@@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#1770] Links in basictag info (like needed/dependent characters) were barely visible on most themes
|
||||
- Show in Resource command from Hex dump not working for tags inside DefineSprite
|
||||
- File did not appear modified when only header was modified
|
||||
- Copy / Move to tag tree refreshing
|
||||
|
||||
### Changed
|
||||
- [#1455] All tag types are now allowed inside DefineSprite
|
||||
|
||||
@@ -270,9 +270,9 @@ public class Timeline {
|
||||
frame.layersChanged = true;
|
||||
boolean newFrameNeeded = false;
|
||||
for (Tag t : timelined.getTags()) {
|
||||
newFrameNeeded = true;
|
||||
boolean isNested = ShowFrameTag.isNestedTagType(t.getId());
|
||||
if (isNested) {
|
||||
newFrameNeeded = true;
|
||||
frame.innerTags.add(t);
|
||||
}
|
||||
frame.allInnerTags.add(t);
|
||||
@@ -289,25 +289,20 @@ public class Timeline {
|
||||
}
|
||||
|
||||
if (t instanceof FrameLabelTag) {
|
||||
newFrameNeeded = true;
|
||||
frame.label = ((FrameLabelTag) t).getLabelName();
|
||||
frame.namedAnchor = ((FrameLabelTag) t).isNamedAnchor();
|
||||
labelToFrame.put(frame.label, frames.size());
|
||||
} else if (t instanceof StartSoundTag) {
|
||||
newFrameNeeded = true;
|
||||
frame.sounds.add(((StartSoundTag) t).soundId);
|
||||
frame.soundClasses.add(null);
|
||||
frame.soundInfos.add(((StartSoundTag) t).soundInfo);
|
||||
} else if (t instanceof StartSound2Tag) {
|
||||
newFrameNeeded = true;
|
||||
frame.sounds.add(-1);
|
||||
frame.soundClasses.add(((StartSound2Tag) t).soundClassName);
|
||||
frame.soundInfos.add(((StartSoundTag) t).soundInfo);
|
||||
} else if (t instanceof SetBackgroundColorTag) {
|
||||
newFrameNeeded = true;
|
||||
frame.backgroundColor = ((SetBackgroundColorTag) t).backgroundColor;
|
||||
} else if (t instanceof PlaceObjectTypeTag) {
|
||||
newFrameNeeded = true;
|
||||
PlaceObjectTypeTag po = (PlaceObjectTypeTag) t;
|
||||
int depth = po.getDepth();
|
||||
DepthState fl = frame.layers.get(depth);
|
||||
@@ -382,13 +377,11 @@ public class Timeline {
|
||||
}
|
||||
fl.key = characterId != -1;
|
||||
} else if (t instanceof RemoveTag) {
|
||||
newFrameNeeded = true;
|
||||
RemoveTag r = (RemoveTag) t;
|
||||
int depth = r.getDepth();
|
||||
frame.layers.remove(depth);
|
||||
frame.layersChanged = true;
|
||||
} else if (t instanceof DoActionTag) {
|
||||
newFrameNeeded = true;
|
||||
frame.actions.add((DoActionTag) t);
|
||||
actionFrames.put((DoActionTag) t, frame.frame);
|
||||
} else if (t instanceof ShowFrameTag) {
|
||||
|
||||
@@ -1159,6 +1159,8 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
|
||||
private void moveTagToActionPerformed(ActionEvent evt, List<TreeItem> items, SWF targetSwf) {
|
||||
ReadOnlyTagList tags = targetSwf.getTags();;
|
||||
boolean lastIsShowFrame = !tags.isEmpty() && (tags.get(tags.size() - 1) instanceof ShowFrameTag);
|
||||
SWF sourceSwf = items.get(0).getSwf();
|
||||
for (TreeItem item : items) {
|
||||
Tag tag = (Tag) item;
|
||||
@@ -1170,6 +1172,9 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
tag.setModified(true);
|
||||
}
|
||||
|
||||
if (lastIsShowFrame) {
|
||||
targetSwf.frameCount++;
|
||||
}
|
||||
sourceSwf.assignExportNamesToSymbols();
|
||||
targetSwf.assignExportNamesToSymbols();
|
||||
sourceSwf.assignClassesToSymbols();
|
||||
@@ -1185,16 +1190,25 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
|
||||
private void copyTagToActionPerformed(ActionEvent evt, List<TreeItem> items, SWF targetSwf) {
|
||||
try {
|
||||
ReadOnlyTagList tags = targetSwf.getTags();;
|
||||
boolean lastIsShowFrame = !tags.isEmpty() && (tags.get(tags.size() - 1) instanceof ShowFrameTag);
|
||||
for (TreeItem item : items) {
|
||||
Tag tag = (Tag) item;
|
||||
Tag copyTag = tag.cloneTag();
|
||||
copyTag.setSwf(targetSwf, true);
|
||||
copyTag.setTimelined(targetSwf);
|
||||
targetSwf.addTag(copyTag);
|
||||
checkUniqueCharacterId(copyTag);
|
||||
targetSwf.updateCharacters();
|
||||
copyTag.setModified(true);
|
||||
}
|
||||
|
||||
|
||||
if (lastIsShowFrame) {
|
||||
targetSwf.frameCount++;
|
||||
}
|
||||
|
||||
targetSwf.resetTimelines(targetSwf);
|
||||
|
||||
targetSwf.assignExportNamesToSymbols();
|
||||
targetSwf.assignClassesToSymbols();
|
||||
targetSwf.clearImageCache();
|
||||
@@ -1207,6 +1221,8 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
|
||||
private void copyTagWithDependenciesToActionPerformed(ActionEvent evt, List<TreeItem> items, SWF targetSwf) {
|
||||
try {
|
||||
ReadOnlyTagList tags = targetSwf.getTags();;
|
||||
boolean lastIsShowFrame = !tags.isEmpty() && (tags.get(tags.size() - 1) instanceof ShowFrameTag);
|
||||
SWF sourceSwf = items.get(0).getSwf();
|
||||
for (TreeItem item : items) {
|
||||
Set<Tag> copiedTags = new HashSet<>();
|
||||
@@ -1267,6 +1283,10 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lastIsShowFrame) {
|
||||
targetSwf.frameCount++;
|
||||
}
|
||||
|
||||
targetSwf.assignExportNamesToSymbols();
|
||||
targetSwf.assignClassesToSymbols();
|
||||
|
||||
Reference in New Issue
Block a user