mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-03 15:15:32 +00:00
Fix saving + depths selection
This commit is contained in:
@@ -4109,10 +4109,11 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
|
||||
private void collectDepthAsSprites(ActionEvent e) {
|
||||
List<TreeItem> frames = getSelectedItems();
|
||||
Timelined timelined = ((Frame) frames.get(0)).timeline.timelined;
|
||||
Frame first = (Frame) frames.get(0);
|
||||
Timelined timelined = first.timeline.timelined;
|
||||
SWF swf = timelined instanceof SWF ? (SWF) timelined : ((DefineSpriteTag) timelined).getSwf();
|
||||
|
||||
Set<Integer> originalDepths = new HashSet<>();
|
||||
Set<Integer> originalDepths = new TreeSet<>();
|
||||
|
||||
for (TreeItem item : frames) {
|
||||
Frame f = (Frame) item;
|
||||
@@ -4144,7 +4145,13 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
sprite.addTag(showFrame);
|
||||
}
|
||||
|
||||
swf.addTag(sprite);
|
||||
if(replace) {
|
||||
timelined.addTag(timelined.indexOfTag(first.innerTags.get(0)), sprite);
|
||||
} else {
|
||||
timelined.addTag(sprite);
|
||||
}
|
||||
sprite.setTimelined(timelined);
|
||||
sprite.getTimeline();
|
||||
sprites.put(d, sprite);
|
||||
}
|
||||
|
||||
@@ -4183,9 +4190,11 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
}
|
||||
|
||||
if (depth != -1) {
|
||||
if (sprites.containsKey(depth)) {
|
||||
DefineSpriteTag sprite = sprites.get(depth);
|
||||
Tag clone = t.cloneTag();
|
||||
clone.setModified(true);
|
||||
|
||||
if (firstMatrix && i == 0 && clone instanceof PlaceObjectTypeTag) {
|
||||
PlaceObjectTypeTag place = (PlaceObjectTypeTag) clone;
|
||||
if (place.getMatrix() == null) {
|
||||
@@ -4200,7 +4209,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
clone.setTimelined(sprite);
|
||||
sprite.addTag(i, clone);
|
||||
|
||||
@@ -4214,8 +4223,6 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
}
|
||||
}
|
||||
|
||||
Frame first = (Frame) frames.get(0);
|
||||
|
||||
for (Entry<Integer, DefineSpriteTag> entry : sprites.entrySet()) {
|
||||
DefineSpriteTag sprite = entry.getValue();
|
||||
|
||||
@@ -4267,10 +4274,14 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
place.matrix.translateY = minY;
|
||||
}
|
||||
|
||||
place.setTimelined(first.timeline.timelined);
|
||||
place.setTimelined(timelined);
|
||||
first.innerTags.add(place);
|
||||
timelined.addTag(timelined.indexOfTag(first.innerTags.get(0)), place);
|
||||
}
|
||||
}
|
||||
|
||||
sprite.setSwf(swf, true);
|
||||
sprite.resetTimeline();
|
||||
}
|
||||
|
||||
swf.updateCharacters();
|
||||
@@ -4278,6 +4289,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
swf.computeDependentCharacters();
|
||||
swf.computeDependentFrames();
|
||||
}
|
||||
swf.resetTimelines(swf);
|
||||
mainPanel.refreshTree(swf);
|
||||
} catch (InterruptedException | IOException ex) {
|
||||
Logger.getLogger(TagTreeContextMenu.class.getName()).log(Level.SEVERE, null, ex);
|
||||
|
||||
Reference in New Issue
Block a user