mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 07:20:46 +00:00
#742 Can't edit frames fixed, Container/ContainerItems refactored, build fixed on linux (Pull request #12)
This commit is contained in:
@@ -37,6 +37,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFArray;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.AnnotationParseException;
|
||||
import com.jpexs.decompiler.flash.types.annotations.parser.ConditionEvaluator;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -663,10 +664,10 @@ public class GenericTagTreePanel extends GenericTagPanel {
|
||||
SWF swf = tag.getSwf();
|
||||
try {
|
||||
byte[] data = tag.getData();
|
||||
SWFInputStream tagDataStream = new SWFInputStream(swf, data, 0, data.length);
|
||||
SWFInputStream tagDataStream = new SWFInputStream(swf, data, tag.getDataPos(), data.length);
|
||||
TagStub copy = new TagStub(swf, tag.getId(), "Unresolved", tag.getOriginalRange(), tagDataStream);
|
||||
copy.forceWriteAsLong = tag.forceWriteAsLong;
|
||||
this.editedTag = SWFInputStream.resolveTag(copy, 0, false, true, false);
|
||||
editedTag = SWFInputStream.resolveTag(copy, 0, false, true, false);
|
||||
} catch (InterruptedException ex) {
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(GenericTagTreePanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
|
||||
@@ -83,7 +83,6 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ButtonTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
||||
import com.jpexs.decompiler.flash.tags.base.DrawableTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.FontTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||
@@ -897,37 +896,38 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
|
||||
if (selectedNodeSwf != swf) {
|
||||
continue;
|
||||
}
|
||||
if (d instanceof ContainerItem) {
|
||||
ContainerItem n = (ContainerItem) d;
|
||||
TreeNodeType nodeType = TagTree.getTreeNodeType(n);
|
||||
|
||||
if (d instanceof Tag || d instanceof ASMSource) {
|
||||
TreeNodeType nodeType = TagTree.getTreeNodeType(d);
|
||||
if (nodeType == TreeNodeType.IMAGE) {
|
||||
images.add((Tag) n);
|
||||
images.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.SHAPE) {
|
||||
shapes.add((Tag) n);
|
||||
shapes.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.MORPH_SHAPE) {
|
||||
morphshapes.add((Tag) n);
|
||||
morphshapes.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.AS) {
|
||||
as12scripts.add(n);
|
||||
as12scripts.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.MOVIE) {
|
||||
movies.add((Tag) n);
|
||||
movies.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.SOUND) {
|
||||
sounds.add((Tag) n);
|
||||
sounds.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.BINARY_DATA) {
|
||||
binaryData.add((Tag) n);
|
||||
binaryData.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.TEXT) {
|
||||
texts.add((Tag) n);
|
||||
texts.add((Tag) d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.FONT) {
|
||||
fonts.add((Tag) n);
|
||||
fonts.add((Tag) d);
|
||||
}
|
||||
}
|
||||
|
||||
if (d instanceof Frame) {
|
||||
Frame fn = (Frame) d;
|
||||
Timelined parent = fn.timeline.timelined;
|
||||
|
||||
@@ -48,7 +48,6 @@ import com.jpexs.decompiler.flash.tags.VideoFrameTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.AloneTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
||||
import com.jpexs.decompiler.flash.tags.base.FontTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
|
||||
@@ -562,8 +561,8 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
||||
List<Tag> subs = fn.timeline.tags;
|
||||
List<Integer> doneCharacters = new ArrayList<>();
|
||||
int frameCnt = 0;
|
||||
for (ContainerItem item : subs) {
|
||||
if (item instanceof ShowFrameTag) {
|
||||
for (Tag t : subs) {
|
||||
if (t instanceof ShowFrameTag) {
|
||||
frameCnt++;
|
||||
continue;
|
||||
}
|
||||
@@ -571,12 +570,11 @@ public class PreviewPanel extends JSplitPane implements ActionListener {
|
||||
break;
|
||||
}
|
||||
|
||||
if (item instanceof DoActionTag || item instanceof DoInitActionTag) {
|
||||
if (t instanceof DoActionTag || t instanceof DoInitActionTag) {
|
||||
// todo: Maybe DoABC tags should be removed, too
|
||||
continue;
|
||||
}
|
||||
|
||||
Tag t = (Tag) item;
|
||||
Set<Integer> needed = new HashSet<>();
|
||||
t.getNeededCharactersDeep(needed);
|
||||
for (int n : needed) {
|
||||
|
||||
@@ -94,7 +94,6 @@ import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.VideoFrameTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.tags.base.ButtonTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.MorphShapeTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ShapeTag;
|
||||
@@ -472,37 +471,38 @@ public class TagTree extends JTree {
|
||||
if (d.getSwf() != swf) {
|
||||
continue;
|
||||
}
|
||||
if (d instanceof ContainerItem) {
|
||||
ContainerItem n = (ContainerItem) d;
|
||||
TreeNodeType nodeType = TagTree.getTreeNodeType(n);
|
||||
|
||||
if (d instanceof Tag || d instanceof ASMSource) {
|
||||
TreeNodeType nodeType = TagTree.getTreeNodeType(d);
|
||||
if (nodeType == TreeNodeType.IMAGE) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.SHAPE) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.MORPH_SHAPE) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.AS) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.MOVIE) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.SOUND) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.BINARY_DATA) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.TEXT) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
if (nodeType == TreeNodeType.FONT) {
|
||||
ret.add(n);
|
||||
ret.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
if (d instanceof Frame) {
|
||||
ret.add(d);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,7 @@ import com.jpexs.decompiler.flash.tags.ShowFrameTag;
|
||||
import com.jpexs.decompiler.flash.tags.SoundStreamBlockTag;
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.tags.base.Container;
|
||||
import com.jpexs.decompiler.flash.tags.base.ContainerItem;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSourceContainer;
|
||||
import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag;
|
||||
import com.jpexs.decompiler.flash.timeline.AS2Package;
|
||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||
@@ -252,11 +251,9 @@ public class TagTreeModel implements TreeModel {
|
||||
}
|
||||
|
||||
if (!hasInnerFrames) {
|
||||
if (tag instanceof Container) {
|
||||
for (ContainerItem item : ((Container) tag).getSubItems()) {
|
||||
if (item instanceof ASMSource) {
|
||||
tagSubNodes.add(item);
|
||||
}
|
||||
if (tag instanceof ASMSourceContainer) {
|
||||
for (ASMSource asm : ((ASMSourceContainer) tag).getSubItems()) {
|
||||
tagSubNodes.add(asm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user