Skip to content

Commit

Permalink
Selection context menu fix
Browse files Browse the repository at this point in the history
Can someone please tell me why there's a button to select everything in the selection context menu????
  • Loading branch information
Lasercar committed Feb 26, 2025
1 parent 5054c58 commit 2accb4b
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import funkin.ui.debug.charting.commands.CutItemsCommand;
import funkin.ui.debug.charting.commands.RemoveEventsCommand;
import funkin.ui.debug.charting.commands.RemoveItemsCommand;
import funkin.ui.debug.charting.commands.RemoveNotesCommand;
import funkin.ui.debug.charting.commands.FlipNotesCommand;
import funkin.ui.debug.charting.commands.SelectAllItemsCommand;
import funkin.ui.debug.charting.commands.InvertSelectedItemsCommand;
import funkin.ui.debug.charting.commands.DeselectAllItemsCommand;

@:access(funkin.ui.debug.charting.ChartEditorState)
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/context-menus/selection.xml"))
Expand Down Expand Up @@ -36,7 +40,7 @@ class ChartEditorSelectionContextMenu extends ChartEditorBaseContextMenu
contextmenuCopy.onClick = (_) -> {
chartEditorState.copySelection();
};
contextmenuFlip.onClick = (_) -> {
contextmenuDelete.onClick = (_) -> {
if (chartEditorState.currentNoteSelection.length > 0 && chartEditorState.currentEventSelection.length > 0)
{
chartEditorState.performCommand(new RemoveItemsCommand(chartEditorState.currentNoteSelection, chartEditorState.currentEventSelection));
Expand All @@ -54,5 +58,19 @@ class ChartEditorSelectionContextMenu extends ChartEditorBaseContextMenu
// Do nothing???
}
};

contextmenuFlip.onClick = function(_) {
chartEditorState.performCommand(new FlipNotesCommand(chartEditorState.currentNoteSelection));
}

contextmenuSelectAll.onClick = function(_) {
chartEditorState.performCommand(new SelectAllItemsCommand(true, false));
}
contextmenuSelectInverse.onClick = function(_) {
chartEditorState.performCommand(new InvertSelectedItemsCommand());
}
contextmenuSelectNone.onClick = function(_) {
chartEditorState.performCommand(new DeselectAllItemsCommand());
}
}
}

0 comments on commit 2accb4b

Please sign in to comment.