mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 00:10:59 +00:00
Added Scenes folder with (readonly) display of scene frames
This commit is contained in:
@@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- FLA export - show export time
|
- FLA export - show export time
|
||||||
- [#2138] Morphshapes - detect classic easing
|
- [#2138] Morphshapes - detect classic easing
|
||||||
- FLA export - option to disable fixing of shapes
|
- FLA export - option to disable fixing of shapes
|
||||||
|
- Scenes folder with (readonly) display of scene frames
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- [#2021], [#2000] Caret position in editors when using tabs and / or unicode
|
- [#2021], [#2000] Caret position in editors when using tabs and / or unicode
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2023 JPEXS, All rights reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 3.0 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.timeline;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.decompiler.flash.treeitems.Openable;
|
||||||
|
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class Scene implements TreeItem {
|
||||||
|
private SWF swf;
|
||||||
|
public int startFrame;
|
||||||
|
public int endFrame;
|
||||||
|
public String name;
|
||||||
|
|
||||||
|
public Scene(SWF swf, int startFrame, int endFrame, String name) {
|
||||||
|
this.swf = swf;
|
||||||
|
this.startFrame = startFrame;
|
||||||
|
this.endFrame = endFrame;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSceneFrameCount() {
|
||||||
|
return endFrame - startFrame + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SceneFrame getSceneFrame(int sceneFrameIndex) {
|
||||||
|
if (sceneFrameIndex >= getSceneFrameCount()) {
|
||||||
|
throw new IndexOutOfBoundsException("Invalid sceneframe index");
|
||||||
|
}
|
||||||
|
return new SceneFrame(swf, this, startFrame + sceneFrameIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Openable getOpenable() {
|
||||||
|
return swf;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isModified() {
|
||||||
|
return false; //??
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 97 * hash + Objects.hashCode(this.swf);
|
||||||
|
hash = 97 * hash + this.startFrame;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final Scene other = (Scene) obj;
|
||||||
|
if (this.startFrame != other.startFrame) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(this.swf, other.swf);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010-2023 JPEXS, All rights reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 3.0 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library.
|
||||||
|
*/
|
||||||
|
package com.jpexs.decompiler.flash.timeline;
|
||||||
|
|
||||||
|
import com.jpexs.decompiler.flash.SWF;
|
||||||
|
import com.jpexs.decompiler.flash.treeitems.Openable;
|
||||||
|
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class SceneFrame implements TreeItem {
|
||||||
|
private final SWF swf;
|
||||||
|
private final Scene scene;
|
||||||
|
private final int realFrameIndex;
|
||||||
|
|
||||||
|
public SceneFrame(SWF swf, Scene scene, int realFrameIndex) {
|
||||||
|
this.swf = swf;
|
||||||
|
this.scene = scene;
|
||||||
|
this.realFrameIndex = realFrameIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSceneFrameIndex() {
|
||||||
|
return realFrameIndex - scene.startFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Frame getFrame() {
|
||||||
|
return swf.getTimeline().getFrame(realFrameIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "scene frame " + (getSceneFrameIndex() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Openable getOpenable() {
|
||||||
|
return swf;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isModified() {
|
||||||
|
return getFrame().isModified();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 5;
|
||||||
|
hash = 47 * hash + Objects.hashCode(this.scene);
|
||||||
|
hash = 47 * hash + this.realFrameIndex;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final SceneFrame other = (SceneFrame) obj;
|
||||||
|
if (this.realFrameIndex != other.realFrameIndex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(this.scene, other.scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -129,6 +129,8 @@ public class Timeline {
|
|||||||
|
|
||||||
private Map<String, Integer> labelToFrame = new HashMap<>();
|
private Map<String, Integer> labelToFrame = new HashMap<>();
|
||||||
|
|
||||||
|
private List<Scene> scenes = new ArrayList<>();
|
||||||
|
|
||||||
public static final int DRAW_MODE_ALL = 0;
|
public static final int DRAW_MODE_ALL = 0;
|
||||||
public static final int DRAW_MODE_SHAPES = 1;
|
public static final int DRAW_MODE_SHAPES = 1;
|
||||||
public static final int DRAW_MODE_SPRITES = 2;
|
public static final int DRAW_MODE_SPRITES = 2;
|
||||||
@@ -282,6 +284,8 @@ public class Timeline {
|
|||||||
Frame frame = new Frame(this, frameIdx++);
|
Frame frame = new Frame(this, frameIdx++);
|
||||||
frame.layersChanged = true;
|
frame.layersChanged = true;
|
||||||
boolean newFrameNeeded = false;
|
boolean newFrameNeeded = false;
|
||||||
|
scenes = new ArrayList<>();
|
||||||
|
Scene prevScene = null;
|
||||||
for (Tag t : timelined.getTags()) {
|
for (Tag t : timelined.getTags()) {
|
||||||
newFrameNeeded = true;
|
newFrameNeeded = true;
|
||||||
boolean isNested = ShowFrameTag.isNestedTagType(t.getId());
|
boolean isNested = ShowFrameTag.isNestedTagType(t.getId());
|
||||||
@@ -290,6 +294,20 @@ public class Timeline {
|
|||||||
}
|
}
|
||||||
frame.allInnerTags.add(t);
|
frame.allInnerTags.add(t);
|
||||||
|
|
||||||
|
if (id == 0 && (t instanceof DefineSceneAndFrameLabelDataTag)) {
|
||||||
|
DefineSceneAndFrameLabelDataTag sceneData = (DefineSceneAndFrameLabelDataTag) t;
|
||||||
|
scenes = new ArrayList<>();
|
||||||
|
for (int i = 0; i < sceneData.sceneNames.length; i++) {
|
||||||
|
int ioffset = (int) sceneData.sceneOffsets[i];
|
||||||
|
Scene currentScene = new Scene(swf, ioffset, -1, sceneData.sceneNames[i]);
|
||||||
|
scenes.add(currentScene);
|
||||||
|
if (prevScene != null) {
|
||||||
|
prevScene.endFrame = ioffset - 1;
|
||||||
|
}
|
||||||
|
prevScene = currentScene;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (t instanceof ASMSourceContainer) {
|
if (t instanceof ASMSourceContainer) {
|
||||||
ASMSourceContainer asmSourceContainer = (ASMSourceContainer) t;
|
ASMSourceContainer asmSourceContainer = (ASMSourceContainer) t;
|
||||||
if (!asmSourceContainer.getSubItems().isEmpty()) {
|
if (!asmSourceContainer.getSubItems().isEmpty()) {
|
||||||
@@ -446,6 +464,10 @@ public class Timeline {
|
|||||||
frames.add(frame);
|
frames.add(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (prevScene != null) {
|
||||||
|
prevScene.endFrame = frames.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
maxDepth = getMaxDepthInternal();
|
maxDepth = getMaxDepthInternal();
|
||||||
|
|
||||||
detectTweens();
|
detectTweens();
|
||||||
@@ -1521,4 +1543,9 @@ public class Timeline {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Scene> getScenes() {
|
||||||
|
ensureInitialized();
|
||||||
|
return new ArrayList<>(scenes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import com.jpexs.decompiler.flash.tags.base.DrawableTag;
|
|||||||
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
import com.jpexs.decompiler.flash.tags.base.ImageTag;
|
||||||
import com.jpexs.decompiler.flash.tags.base.RenderContext;
|
import com.jpexs.decompiler.flash.tags.base.RenderContext;
|
||||||
import com.jpexs.decompiler.flash.timeline.Frame;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.Scene;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.SceneFrame;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timeline;
|
import com.jpexs.decompiler.flash.timeline.Timeline;
|
||||||
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||||
import com.jpexs.decompiler.flash.types.RECT;
|
import com.jpexs.decompiler.flash.types.RECT;
|
||||||
@@ -294,6 +296,12 @@ public class FolderPreviewPanel extends JPanel {
|
|||||||
Matrix m = new Matrix();
|
Matrix m = new Matrix();
|
||||||
double ow = 1;
|
double ow = 1;
|
||||||
double oh = 1;
|
double oh = 1;
|
||||||
|
if (treeItem instanceof Scene) {
|
||||||
|
treeItem = ((Scene) treeItem).getSceneFrame(0);
|
||||||
|
}
|
||||||
|
if (treeItem instanceof SceneFrame) {
|
||||||
|
treeItem = ((SceneFrame) treeItem).getFrame();
|
||||||
|
}
|
||||||
if (treeItem instanceof Frame) {
|
if (treeItem instanceof Frame) {
|
||||||
Frame fn = (Frame) treeItem;
|
Frame fn = (Frame) treeItem;
|
||||||
RECT rect = swf.displayRect;
|
RECT rect = swf.displayRect;
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ import com.jpexs.decompiler.flash.tags.text.TextParseException;
|
|||||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||||
import com.jpexs.decompiler.flash.timeline.DepthState;
|
import com.jpexs.decompiler.flash.timeline.DepthState;
|
||||||
import com.jpexs.decompiler.flash.timeline.Frame;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.Scene;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.SceneFrame;
|
||||||
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
||||||
import com.jpexs.decompiler.flash.timeline.TagScript;
|
import com.jpexs.decompiler.flash.timeline.TagScript;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timeline;
|
import com.jpexs.decompiler.flash.timeline.Timeline;
|
||||||
@@ -5737,6 +5739,14 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
|
|
||||||
boolean internalViewer = !isAdobeFlashPlayerEnabled();
|
boolean internalViewer = !isAdobeFlashPlayerEnabled();
|
||||||
|
|
||||||
|
Frame frameTreeItem = null;
|
||||||
|
if (treeItem instanceof Frame) {
|
||||||
|
frameTreeItem = (Frame) treeItem;
|
||||||
|
}
|
||||||
|
if (treeItem instanceof SceneFrame) {
|
||||||
|
frameTreeItem = ((SceneFrame) treeItem).getFrame();
|
||||||
|
}
|
||||||
|
|
||||||
if ((treeItem instanceof AS3Package) && ((AS3Package) treeItem).isCompoundScript()) {
|
if ((treeItem instanceof AS3Package) && ((AS3Package) treeItem).isCompoundScript()) {
|
||||||
final ScriptPack scriptLeaf = ((AS3Package) treeItem).getCompoundInitializerPack();
|
final ScriptPack scriptLeaf = ((AS3Package) treeItem).getCompoundInitializerPack();
|
||||||
if (Main.isInited() && (!Main.isWorking() || Main.isDebugging())) {
|
if (Main.isInited() && (!Main.isWorking() || Main.isDebugging())) {
|
||||||
@@ -5810,8 +5820,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
} else {
|
} else {
|
||||||
showDetail(DETAILCARDEMPTYPANEL);
|
showDetail(DETAILCARDEMPTYPANEL);
|
||||||
}
|
}
|
||||||
} else if (treeItem instanceof Frame) {
|
} else if (frameTreeItem != null) {
|
||||||
Frame frame = (Frame) treeItem;
|
Frame frame = frameTreeItem;
|
||||||
Set<Integer> needed = new LinkedHashSet<>();
|
Set<Integer> needed = new LinkedHashSet<>();
|
||||||
|
|
||||||
frame.getNeededCharacters(needed);
|
frame.getNeededCharacters(needed);
|
||||||
@@ -5850,6 +5860,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
} else if (treeItem instanceof SWF) {
|
} else if (treeItem instanceof SWF) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(treeItem, previewPanel, -1, null);
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
|
} else if (treeItem instanceof Scene) {
|
||||||
|
showFolderPreviewList(treePath);
|
||||||
} else if (treeItem instanceof MetadataTag) {
|
} else if (treeItem instanceof MetadataTag) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(treeItem, previewPanel, -1, null);
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
@@ -5874,8 +5886,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
} else if ((treeItem instanceof TextTag) && internalViewer) {
|
} else if ((treeItem instanceof TextTag) && internalViewer) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(treeItem, previewPanel, -1, null);
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
} else if (treeItem instanceof Frame && internalViewer) {
|
} else if (frameTreeItem != null && internalViewer) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(frameTreeItem, previewPanel, -1, null);
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
} else if (treeItem instanceof ShowFrameTag && internalViewer) {
|
} else if (treeItem instanceof ShowFrameTag && internalViewer) {
|
||||||
showPreview(treeItem, previewPanel, getFrameForTreeItem(treeItem), getTimelinedForTreeItem(treeItem));
|
showPreview(treeItem, previewPanel, getFrameForTreeItem(treeItem), getTimelinedForTreeItem(treeItem));
|
||||||
@@ -5883,9 +5895,11 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
} else if ((treeItem instanceof SoundTag)) { //&& isInternalFlashViewerSelected() && (Arrays.asList("mp3", "wav").contains(((SoundTag) tagObj).getExportFormat())))) {
|
} else if ((treeItem instanceof SoundTag)) { //&& isInternalFlashViewerSelected() && (Arrays.asList("mp3", "wav").contains(((SoundTag) tagObj).getExportFormat())))) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(treeItem, previewPanel, -1, null);
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
} else if ((treeItem instanceof Frame) || (treeItem instanceof CharacterTag) || (treeItem instanceof FontTag) || (treeItem instanceof SoundStreamHeadTypeTag)) {
|
} else if (frameTreeItem != null) {
|
||||||
|
showPreview(frameTreeItem, previewPanel, -1, null);
|
||||||
|
showCard(CARDPREVIEWPANEL);
|
||||||
|
} else if ((treeItem instanceof CharacterTag) || (treeItem instanceof FontTag) || (treeItem instanceof SoundStreamHeadTypeTag)) {
|
||||||
showPreview(treeItem, previewPanel, -1, null);
|
showPreview(treeItem, previewPanel, -1, null);
|
||||||
|
|
||||||
showCard(CARDPREVIEWPANEL);
|
showCard(CARDPREVIEWPANEL);
|
||||||
} else if (treeItem instanceof PlaceObjectTypeTag) {
|
} else if (treeItem instanceof PlaceObjectTypeTag) {
|
||||||
showPreview(treeItem, previewPanel, getFrameForTreeItem(treeItem), null);
|
showPreview(treeItem, previewPanel, getFrameForTreeItem(treeItem), null);
|
||||||
@@ -6027,6 +6041,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TagTreeModel.FOLDER_SCENES:
|
||||||
|
folderPreviewItems.addAll(timelined.getTimeline().getScenes());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6045,6 +6062,12 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
|||||||
showCard(CARDFOLDERPREVIEWPANEL);
|
showCard(CARDFOLDERPREVIEWPANEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showFolderPreviewList(TreePath path) {
|
||||||
|
List<TreeItem> items = new ArrayList<>(getCurrentTree().getFullModel().getAllChildren((TreeItem) path.getLastPathComponent()));
|
||||||
|
folderPreviewPanel.setItems(items);
|
||||||
|
showCard(CARDFOLDERPREVIEWPANEL);
|
||||||
|
}
|
||||||
|
|
||||||
private void showFolderList(TreePath path) {
|
private void showFolderList(TreePath path) {
|
||||||
List<TreeItem> items = new ArrayList<>(getCurrentTree().getFullModel().getAllChildren((TreeItem) path.getLastPathComponent()));
|
List<TreeItem> items = new ArrayList<>(getCurrentTree().getFullModel().getAllChildren((TreeItem) path.getLastPathComponent()));
|
||||||
folderListPanel.setItems(path, items);
|
folderListPanel.setItems(path, items);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public enum TreeNodeType {
|
|||||||
AS_INIT,
|
AS_INIT,
|
||||||
PACKAGE,
|
PACKAGE,
|
||||||
FRAME,
|
FRAME,
|
||||||
|
SCENE,
|
||||||
SHOW_FRAME,
|
SHOW_FRAME,
|
||||||
MOVIE,
|
MOVIE,
|
||||||
SOUND,
|
SOUND,
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 664 B |
Binary file not shown.
|
After Width: | Height: | Size: 602 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1251,3 +1251,6 @@ contextmenu.copyTagToReplaceByClass = Copy tag to (replace by class name)
|
|||||||
contextmenu.copyTagToReplaceByExportName = Copy tag to (replace by export name)
|
contextmenu.copyTagToReplaceByExportName = Copy tag to (replace by export name)
|
||||||
|
|
||||||
button.breakpointList = Show breakpoint list
|
button.breakpointList = Show breakpoint list
|
||||||
|
|
||||||
|
node.scenes = scenes
|
||||||
|
contextmenu.showInFramesFolder = Show in frames folder
|
||||||
@@ -1226,3 +1226,6 @@ contextmenu.copyTagToReplaceByClass = Kop\u00edrovat tag do (nahradit podle n\u0
|
|||||||
contextmenu.copyTagToReplaceByExportName = Kop\u00edrovat tag do (nahradit podle exportovan\u00e9ho n\u00e1zvu)
|
contextmenu.copyTagToReplaceByExportName = Kop\u00edrovat tag do (nahradit podle exportovan\u00e9ho n\u00e1zvu)
|
||||||
|
|
||||||
button.breakpointList = Zobrazit seznam breakpoint\u016f
|
button.breakpointList = Zobrazit seznam breakpoint\u016f
|
||||||
|
|
||||||
|
node.scenes = sc\u00e9ny
|
||||||
|
contextmenu.showInFramesFolder = Zobrazit ve slo\u017ece sn\u00edmk\u016f
|
||||||
@@ -90,6 +90,8 @@ import com.jpexs.decompiler.flash.timeline.AS2Package;
|
|||||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||||
import com.jpexs.decompiler.flash.timeline.Frame;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.Scene;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.SceneFrame;
|
||||||
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
||||||
import com.jpexs.decompiler.flash.timeline.TagScript;
|
import com.jpexs.decompiler.flash.timeline.TagScript;
|
||||||
import com.jpexs.decompiler.flash.treeitems.FolderItem;
|
import com.jpexs.decompiler.flash.treeitems.FolderItem;
|
||||||
@@ -376,10 +378,15 @@ public abstract class AbstractTagTree extends JTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((t instanceof Frame)
|
if ((t instanceof Frame)
|
||||||
|| (t instanceof FrameScript)) {
|
|| (t instanceof FrameScript)
|
||||||
|
|| (t instanceof SceneFrame)) {
|
||||||
return TreeNodeType.FRAME;
|
return TreeNodeType.FRAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (t instanceof Scene) {
|
||||||
|
return TreeNodeType.SCENE;
|
||||||
|
}
|
||||||
|
|
||||||
if (t instanceof ShowFrameTag) {
|
if (t instanceof ShowFrameTag) {
|
||||||
return TreeNodeType.SHOW_FRAME;
|
return TreeNodeType.SHOW_FRAME;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ import com.jpexs.decompiler.flash.timeline.AS3Package;
|
|||||||
import com.jpexs.decompiler.flash.timeline.DepthState;
|
import com.jpexs.decompiler.flash.timeline.DepthState;
|
||||||
import com.jpexs.decompiler.flash.timeline.Frame;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.Scene;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.SceneFrame;
|
||||||
import com.jpexs.decompiler.flash.timeline.TagScript;
|
import com.jpexs.decompiler.flash.timeline.TagScript;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timeline;
|
import com.jpexs.decompiler.flash.timeline.Timeline;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timelined;
|
import com.jpexs.decompiler.flash.timeline.Timelined;
|
||||||
@@ -276,6 +278,8 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
|
|
||||||
private JMenuItem showInHexDumpViewTagMenuItem;
|
private JMenuItem showInHexDumpViewTagMenuItem;
|
||||||
|
|
||||||
|
private JMenuItem showInFramesFolderMenuItem;
|
||||||
|
|
||||||
private JMenuItem addFramesMenuItem;
|
private JMenuItem addFramesMenuItem;
|
||||||
|
|
||||||
private JMenuItem addFramesBeforeMenuItem;
|
private JMenuItem addFramesBeforeMenuItem;
|
||||||
@@ -501,6 +505,11 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
importSymbolClassMenuItem.setIcon(View.getIcon("importsymbolclass16"));
|
importSymbolClassMenuItem.setIcon(View.getIcon("importsymbolclass16"));
|
||||||
add(importSymbolClassMenuItem);
|
add(importSymbolClassMenuItem);
|
||||||
|
|
||||||
|
showInFramesFolderMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showInFramesFolder"));
|
||||||
|
showInFramesFolderMenuItem.addActionListener(this::showInFramesFolderActionPerformed);
|
||||||
|
showInFramesFolderMenuItem.setIcon(View.getIcon("frame16"));
|
||||||
|
add(showInFramesFolderMenuItem);
|
||||||
|
|
||||||
showInResourcesViewTagMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showInResources"));
|
showInResourcesViewTagMenuItem = new JMenuItem(mainPanel.translate("contextmenu.showInResources"));
|
||||||
showInResourcesViewTagMenuItem.addActionListener(this::showInResourcesViewActionPerformed);
|
showInResourcesViewTagMenuItem.addActionListener(this::showInResourcesViewActionPerformed);
|
||||||
showInResourcesViewTagMenuItem.setIcon(View.getIcon("folder16"));
|
showInResourcesViewTagMenuItem.setIcon(View.getIcon("folder16"));
|
||||||
@@ -1130,6 +1139,7 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
showInResourcesViewTagMenuItem.setVisible(false);
|
showInResourcesViewTagMenuItem.setVisible(false);
|
||||||
showInTagListViewTagMenuItem.setVisible(false);
|
showInTagListViewTagMenuItem.setVisible(false);
|
||||||
showInHexDumpViewTagMenuItem.setVisible(false);
|
showInHexDumpViewTagMenuItem.setVisible(false);
|
||||||
|
showInFramesFolderMenuItem.setVisible(false);
|
||||||
addFramesMenuItem.setVisible(false);
|
addFramesMenuItem.setVisible(false);
|
||||||
addFramesBeforeMenuItem.setVisible(false);
|
addFramesBeforeMenuItem.setVisible(false);
|
||||||
addFramesAfterMenuItem.setVisible(false);
|
addFramesAfterMenuItem.setVisible(false);
|
||||||
@@ -1370,6 +1380,10 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
showInHexDumpViewTagMenuItem.setVisible(true);
|
showInHexDumpViewTagMenuItem.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((firstItem instanceof Scene) || (firstItem instanceof SceneFrame)) {
|
||||||
|
showInFramesFolderMenuItem.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (firstItem instanceof SWF) {
|
if (firstItem instanceof SWF) {
|
||||||
importImagesMenuItem.setVisible(true);
|
importImagesMenuItem.setVisible(true);
|
||||||
importShapesMenuItem.setVisible(true);
|
importShapesMenuItem.setVisible(true);
|
||||||
@@ -1696,6 +1710,14 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item instanceof Scene) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item instanceof SceneFrame) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (item instanceof Frame) {
|
if (item instanceof Frame) {
|
||||||
insideFrame = true;
|
insideFrame = true;
|
||||||
Frame frame = (Frame) item;
|
Frame frame = (Frame) item;
|
||||||
@@ -3564,6 +3586,18 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showInFramesFolderActionPerformed(ActionEvent evt) {
|
||||||
|
TreeItem item = getCurrentItem();
|
||||||
|
if (item instanceof SceneFrame) {
|
||||||
|
item = ((SceneFrame) item).getFrame();
|
||||||
|
}
|
||||||
|
if (item instanceof Scene) {
|
||||||
|
item = ((Scene) item).getSceneFrame(0).getFrame();
|
||||||
|
}
|
||||||
|
mainPanel.setTagTreeSelectedNode(mainPanel.tagTree, item);
|
||||||
|
mainPanel.updateMenu();
|
||||||
|
}
|
||||||
|
|
||||||
private void showInResourcesViewActionPerformed(ActionEvent evt) {
|
private void showInResourcesViewActionPerformed(ActionEvent evt) {
|
||||||
TreeItem item = getCurrentItem();
|
TreeItem item = getCurrentItem();
|
||||||
mainPanel.showView(MainPanel.VIEW_RESOURCES);
|
mainPanel.showView(MainPanel.VIEW_RESOURCES);
|
||||||
@@ -3578,6 +3612,12 @@ public class TagTreeContextMenu extends JPopupMenu {
|
|||||||
if (item instanceof TagScript) {
|
if (item instanceof TagScript) {
|
||||||
item = ((TagScript) item).getTag();
|
item = ((TagScript) item).getTag();
|
||||||
}
|
}
|
||||||
|
if (item instanceof SceneFrame) {
|
||||||
|
item = ((SceneFrame) item).getFrame();
|
||||||
|
}
|
||||||
|
if (item instanceof Scene) {
|
||||||
|
item = ((Scene) item).getSceneFrame(0).getFrame();
|
||||||
|
}
|
||||||
mainPanel.setTagTreeSelectedNode(mainPanel.tagListTree, item);
|
mainPanel.setTagTreeSelectedNode(mainPanel.tagListTree, item);
|
||||||
mainPanel.updateMenu();
|
mainPanel.updateMenu();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ import com.jpexs.decompiler.flash.timeline.AS2Package;
|
|||||||
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
import com.jpexs.decompiler.flash.timeline.AS3Package;
|
||||||
import com.jpexs.decompiler.flash.timeline.Frame;
|
import com.jpexs.decompiler.flash.timeline.Frame;
|
||||||
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
import com.jpexs.decompiler.flash.timeline.FrameScript;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.Scene;
|
||||||
|
import com.jpexs.decompiler.flash.timeline.SceneFrame;
|
||||||
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
import com.jpexs.decompiler.flash.timeline.SoundStreamFrameRange;
|
||||||
import com.jpexs.decompiler.flash.timeline.TagScript;
|
import com.jpexs.decompiler.flash.timeline.TagScript;
|
||||||
import com.jpexs.decompiler.flash.timeline.Timeline;
|
import com.jpexs.decompiler.flash.timeline.Timeline;
|
||||||
@@ -92,6 +94,8 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
|
|
||||||
public static final String FOLDER_SCRIPTS = "scripts";
|
public static final String FOLDER_SCRIPTS = "scripts";
|
||||||
|
|
||||||
|
public static final String FOLDER_SCENES = "scenes";
|
||||||
|
|
||||||
private final List<TreeModelListener> listeners = new ArrayList<>();
|
private final List<TreeModelListener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
private final TagTreeRoot root = new TagTreeRoot();
|
private final TagTreeRoot root = new TagTreeRoot();
|
||||||
@@ -261,6 +265,10 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
for (int i = 0; i < frameCount; i++) {
|
for (int i = 0; i < frameCount; i++) {
|
||||||
frames.add(timeline.getFrame(i));
|
frames.add(timeline.getFrame(i));
|
||||||
}
|
}
|
||||||
|
List<TreeItem> scenes = new ArrayList<>();
|
||||||
|
|
||||||
|
List<Scene> sceneList = timeline.getScenes();
|
||||||
|
scenes.addAll(sceneList);
|
||||||
|
|
||||||
for (int i = sounds.size() - 1; i >= 0; i--) {
|
for (int i = sounds.size() - 1; i >= 0; i--) {
|
||||||
TreeItem sound = sounds.get(i);
|
TreeItem sound = sounds.get(i);
|
||||||
@@ -285,6 +293,7 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.fonts"), FOLDER_FONTS, swf, fonts);
|
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.fonts"), FOLDER_FONTS, swf, fonts);
|
||||||
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.binaryData"), FOLDER_BINARY_DATA, swf, binaryData);
|
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.binaryData"), FOLDER_BINARY_DATA, swf, binaryData);
|
||||||
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.frames"), FOLDER_FRAMES, swf, frames);
|
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.frames"), FOLDER_FRAMES, swf, frames);
|
||||||
|
addFolderItem(nodeList, emptyFolders, addAllFolders, translate("node.scenes"), FOLDER_SCENES, swf, scenes);
|
||||||
addFolderItem(nodeList, emptyFolders, true /*always add*/, translate("node.others"), FOLDER_OTHERS, swf, others);
|
addFolderItem(nodeList, emptyFolders, true /*always add*/, translate("node.others"), FOLDER_OTHERS, swf, others);
|
||||||
|
|
||||||
Map<Tag, TagScript> currentTagScriptCache = new HashMap<>();
|
Map<Tag, TagScript> currentTagScriptCache = new HashMap<>();
|
||||||
@@ -418,6 +427,15 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (obj instanceof SceneFrame && n instanceof SceneFrame) {
|
||||||
|
// SceneFrames are always recreated, so compare them by frame and swf
|
||||||
|
SceneFrame nds = (SceneFrame) n;
|
||||||
|
SceneFrame objs = (SceneFrame) obj;
|
||||||
|
if (objs.getFrame().frame == nds.getFrame().frame && objs.getOpenable() == nds.getOpenable()) {
|
||||||
|
return newPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (obj instanceof FolderItem && n instanceof FolderItem) {
|
if (obj instanceof FolderItem && n instanceof FolderItem) {
|
||||||
// FolderItems are always recreated, so compare them by name and swf
|
// FolderItems are always recreated, so compare them by name and swf
|
||||||
FolderItem nds = (FolderItem) n;
|
FolderItem nds = (FolderItem) n;
|
||||||
@@ -521,6 +539,13 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
return ((OpenableList) parentNode).items;
|
return ((OpenableList) parentNode).items;
|
||||||
} else if (parentNode instanceof SWF) {
|
} else if (parentNode instanceof SWF) {
|
||||||
return getSwfFolders((SWF) parentNode);
|
return getSwfFolders((SWF) parentNode);
|
||||||
|
} else if (parentNode instanceof Scene) {
|
||||||
|
Scene scene = (Scene) parentNode;
|
||||||
|
List<SceneFrame> sceneFrames = new ArrayList<>();
|
||||||
|
for (int i = 0; i < scene.getSceneFrameCount(); i++) {
|
||||||
|
sceneFrames.add(scene.getSceneFrame(i));
|
||||||
|
}
|
||||||
|
return sceneFrames;
|
||||||
} else if (parentNode instanceof FolderItem) {
|
} else if (parentNode instanceof FolderItem) {
|
||||||
return ((FolderItem) parentNode).subItems;
|
return ((FolderItem) parentNode).subItems;
|
||||||
} else if (parentNode instanceof Frame) {
|
} else if (parentNode instanceof Frame) {
|
||||||
@@ -614,6 +639,8 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
return ((OpenableList) parentNode).items.get(index);
|
return ((OpenableList) parentNode).items.get(index);
|
||||||
} else if (parentNode instanceof SWF) {
|
} else if (parentNode instanceof SWF) {
|
||||||
return getSwfFolders((SWF) parentNode).get(index);
|
return getSwfFolders((SWF) parentNode).get(index);
|
||||||
|
} else if (parentNode instanceof Scene) {
|
||||||
|
return ((Scene) parentNode).getSceneFrame(index);
|
||||||
} else if (parentNode instanceof FolderItem) {
|
} else if (parentNode instanceof FolderItem) {
|
||||||
return ((FolderItem) parentNode).subItems.get(index);
|
return ((FolderItem) parentNode).subItems.get(index);
|
||||||
} else if (parentNode instanceof Frame) {
|
} else if (parentNode instanceof Frame) {
|
||||||
@@ -687,6 +714,8 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
return mappedSize + ((OpenableList) parentNode).items.size();
|
return mappedSize + ((OpenableList) parentNode).items.size();
|
||||||
} else if (parentNode instanceof SWF) {
|
} else if (parentNode instanceof SWF) {
|
||||||
return mappedSize + getSwfFolders((SWF) parentNode).size();
|
return mappedSize + getSwfFolders((SWF) parentNode).size();
|
||||||
|
} else if (parentNode instanceof Scene) {
|
||||||
|
return mappedSize + ((Scene) parentNode).getSceneFrameCount();
|
||||||
} else if (parentNode instanceof HeaderItem) {
|
} else if (parentNode instanceof HeaderItem) {
|
||||||
return mappedSize + 0;
|
return mappedSize + 0;
|
||||||
} else if (parentNode instanceof FolderItem) {
|
} else if (parentNode instanceof FolderItem) {
|
||||||
@@ -763,6 +792,8 @@ public class TagTreeModel extends AbstractTagTreeModel {
|
|||||||
return indexOfAdd(baseIndex, ((OpenableList) parentNode).items.indexOf(childNode));
|
return indexOfAdd(baseIndex, ((OpenableList) parentNode).items.indexOf(childNode));
|
||||||
} else if (parentNode instanceof SWF) {
|
} else if (parentNode instanceof SWF) {
|
||||||
return indexOfAdd(baseIndex, getSwfFolders((SWF) parentNode).indexOf(childNode));
|
return indexOfAdd(baseIndex, getSwfFolders((SWF) parentNode).indexOf(childNode));
|
||||||
|
} else if (parentNode instanceof Scene) {
|
||||||
|
return getAllChildren(parentNode).indexOf(childNode);
|
||||||
} else if (parentNode instanceof FolderItem) {
|
} else if (parentNode instanceof FolderItem) {
|
||||||
return indexOfAdd(baseIndex, ((FolderItem) parentNode).subItems.indexOf(childNode));
|
return indexOfAdd(baseIndex, ((FolderItem) parentNode).subItems.indexOf(childNode));
|
||||||
} else if (parentNode instanceof Frame) {
|
} else if (parentNode instanceof Frame) {
|
||||||
|
|||||||
Reference in New Issue
Block a user