2024-01-04 00:53:17 +00:00
|
|
|
package funkin.ui.debug.charting.contextmenus;
|
|
|
|
|
|
|
|
import haxe.ui.containers.menus.Menu;
|
|
|
|
import haxe.ui.containers.menus.MenuItem;
|
|
|
|
import haxe.ui.core.Screen;
|
|
|
|
import funkin.data.song.SongData.SongNoteData;
|
|
|
|
import funkin.ui.debug.charting.commands.FlipNotesCommand;
|
|
|
|
import funkin.ui.debug.charting.commands.RemoveNotesCommand;
|
2024-01-12 11:13:34 +00:00
|
|
|
import funkin.ui.debug.charting.commands.ExtendNoteLengthCommand;
|
2024-01-04 00:53:17 +00:00
|
|
|
|
|
|
|
@:access(funkin.ui.debug.charting.ChartEditorState)
|
|
|
|
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/context-menus/note.xml"))
|
|
|
|
class ChartEditorNoteContextMenu extends ChartEditorBaseContextMenu
|
|
|
|
{
|
|
|
|
var contextmenuFlip:MenuItem;
|
|
|
|
var contextmenuDelete:MenuItem;
|
|
|
|
|
|
|
|
var data:SongNoteData;
|
|
|
|
|
|
|
|
public function new(chartEditorState2:ChartEditorState, xPos2:Float = 0, yPos2:Float = 0, data:SongNoteData)
|
|
|
|
{
|
|
|
|
super(chartEditorState2, xPos2, yPos2);
|
|
|
|
this.data = data;
|
|
|
|
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
function initialize():Void
|
|
|
|
{
|
|
|
|
// NOTE: Remember to use commands here to ensure undo/redo works properly
|
|
|
|
contextmenuFlip.onClick = function(_) {
|
|
|
|
chartEditorState.performCommand(new FlipNotesCommand([data]));
|
|
|
|
}
|
|
|
|
|
2024-01-12 11:13:34 +00:00
|
|
|
contextmenuAddHold.onClick = function(_) {
|
|
|
|
chartEditorState.performCommand(new ExtendNoteLengthCommand(data, 4, STEPS));
|
|
|
|
}
|
|
|
|
|
2024-01-04 00:53:17 +00:00
|
|
|
contextmenuDelete.onClick = function(_) {
|
|
|
|
chartEditorState.performCommand(new RemoveNotesCommand([data]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|