Skip to content

Commit

Permalink
Update for 0.04.4d to fix the Edit > Delete menu option
Browse files Browse the repository at this point in the history
  • Loading branch information
Retera committed Oct 31, 2022
1 parent 0cfbf3c commit a2f2f71
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public static String getEditorMetaDataDisplayKey(int level, final GameObject met
if (upgradeExtensionLevel > 0) {
metaDataName += Integer.toString(upgradeExtensionLevel);
}
} else if (repeats && index == -1) {
} else if (repeats && (index == -1 || repeatCount >= 10)) {
if (level == 0) {
level = 1;
}
Expand Down
17 changes: 16 additions & 1 deletion matrixeater/src/com/matrixeater/src/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,21 @@ public void actionPerformed(final ActionEvent e) {
}
};
AbstractAction deleteAction = new AbstractAction("Delete") {
@Override
public void actionPerformed(final ActionEvent e) {
final ModelPanel mpanel = currentModelPanel();
if (mpanel != null) {
if (animationModeState) {
timeSliderPanel.deleteSelectedKeyframes();
} else {
mpanel.getUndoManager()
.pushAction(mpanel.getModelEditorManager().getModelEditor().deleteSelectedComponents());
}
}
repaintSelfAndChildren(mpanel);
}
};
AbstractAction deleteHotkeyAction = new AbstractAction("Delete") {
@Override
public void actionPerformed(final ActionEvent e) {
final ModelPanel mpanel = currentModelPanel();
Expand Down Expand Up @@ -2137,7 +2152,7 @@ private void linkActions(final JComponent root) {
root.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("control Y"),
"Redo");

root.getActionMap().put("Delete", deleteAction);
root.getActionMap().put("Delete", deleteHotkeyAction);
root.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("DELETE"), "Delete");

root.getActionMap().put("CloneSelection", cloneAction);
Expand Down

0 comments on commit a2f2f71

Please sign in to comment.