mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 02:51:23 +00:00
Timeline with selection.
Do not enable buttons when frozen.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2024 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DefaultTagNameResolver implements TagNameResolverInterface {
|
||||
|
||||
@Override
|
||||
public String getTagName(Tag tag) {
|
||||
return tag.toString();
|
||||
}
|
||||
}
|
||||
@@ -306,6 +306,24 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
|
||||
private JPanel topPanel;
|
||||
|
||||
private TagNameResolverInterface tagNameResolver = new DefaultTagNameResolver();
|
||||
|
||||
private boolean showAllDepthLevelsInfo = true;
|
||||
|
||||
private boolean selectionMode = false;
|
||||
|
||||
public void setSelectionMode(boolean selectionMode) {
|
||||
this.selectionMode = selectionMode;
|
||||
}
|
||||
|
||||
public void setTagNameResolver(TagNameResolverInterface tagNameResolver) {
|
||||
this.tagNameResolver = tagNameResolver;
|
||||
}
|
||||
|
||||
public void setShowAllDepthLevelsInfo(boolean showAllDepthLevelsInfo) {
|
||||
this.showAllDepthLevelsInfo = showAllDepthLevelsInfo;
|
||||
}
|
||||
|
||||
public void setTopPanelVisible(boolean visible) {
|
||||
topPanel.setVisible(visible);
|
||||
}
|
||||
@@ -1121,8 +1139,11 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (SwingUtilities.isLeftMouseButton(e)) {
|
||||
if (altDown) {
|
||||
if (altDown || selectionMode) {
|
||||
if (depthStateUnderCursor != null) {
|
||||
if (selectionMode) {
|
||||
selectDepth(depthStateUnderCursor.depth);
|
||||
}
|
||||
firePlaceObjectSelected();
|
||||
}
|
||||
return;
|
||||
@@ -2335,7 +2356,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
lastMouseEvent = e;
|
||||
redraw();
|
||||
ButtonTag button = iconPanel.mouseOverButton;
|
||||
if (button != null && freeTransformDepth == -1) {
|
||||
if (button != null && freeTransformDepth == -1 && !frozen) {
|
||||
DefineButtonSoundTag sounds = button.getSounds();
|
||||
if (!muted && sounds != null && sounds.buttonSoundChar2 != 0) { // OverUpToOverDown
|
||||
CharacterTag soundCharTag = swf.getCharacter(sounds.buttonSoundChar2);
|
||||
@@ -2380,7 +2401,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
lastMouseEvent = e;
|
||||
redraw();
|
||||
ButtonTag button = iconPanel.mouseOverButton;
|
||||
if (!muted && button != null && freeTransformDepth == -1) {
|
||||
if (!muted && button != null && freeTransformDepth == -1 && !frozen) {
|
||||
DefineButtonSoundTag sounds = button.getSounds();
|
||||
if (sounds != null && sounds.buttonSoundChar3 != 0) { // OverDownToOverUp
|
||||
CharacterTag soundCharTag = swf.getCharacter(sounds.buttonSoundChar3);
|
||||
@@ -3264,6 +3285,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
|
||||
renderContext.mouseButton = mouseButton;
|
||||
renderContext.stateUnderCursor = new ArrayList<>();
|
||||
renderContext.enableButtons = !frozen;
|
||||
|
||||
SerializableImage img;
|
||||
try {
|
||||
@@ -3431,7 +3453,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
}
|
||||
}
|
||||
|
||||
boolean handCursor = renderContext.mouseOverButton != null || !autoPlayed;
|
||||
boolean handCursor = renderContext.mouseOverButton != null || !autoPlayed && !frozen;
|
||||
|
||||
if (showObjectsUnderCursor && autoPlayed) {
|
||||
|
||||
@@ -3445,12 +3467,16 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
for (int i = renderContext.stateUnderCursor.size() - 1; i >= 0; i--) {
|
||||
DepthState ds = renderContext.stateUnderCursor.get(i);
|
||||
if (!first) {
|
||||
if (!showAllDepthLevelsInfo) {
|
||||
break;
|
||||
}
|
||||
ret.append(", ");
|
||||
}
|
||||
|
||||
first = false;
|
||||
CharacterTag c = ds.getCharacter();
|
||||
ret.append(c.toString());
|
||||
|
||||
ret.append(tagNameResolver.getTagName(c));
|
||||
if (ds.depth > -1) {
|
||||
ret.append(" ");
|
||||
ret.append(AppStrings.translate("imagePanel.depth"));
|
||||
@@ -3500,7 +3526,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
}
|
||||
if (freeTransformDepth == -1 && hilightedPoints == null) {
|
||||
Cursor newCursor;
|
||||
if (iconPanel.isAltDown()) {
|
||||
if (iconPanel.isAltDown() && !selectionMode) {
|
||||
if (depthStateUnderCursor == null) {
|
||||
newCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2024 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import com.jpexs.decompiler.flash.tags.Tag;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public interface TagNameResolverInterface {
|
||||
public String getTagName(Tag tag);
|
||||
}
|
||||
Reference in New Issue
Block a user