Format .hx files
Co-Authored-By: Eric <4635334+EliteMasterEric@users.noreply.github.com>
This commit is contained in:
@@ -7,16 +7,13 @@ import funkin.data.song.SongDataUtils;
|
||||
/**
|
||||
* Command that selects all notes and/or events above or past the time given in the chart editor.
|
||||
*/
|
||||
@:nullSafety
|
||||
@:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
@:nullSafety @:access(funkin.ui.debug.charting.ChartEditorState)
|
||||
class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
{
|
||||
var time:Float;
|
||||
var above:Bool;
|
||||
|
||||
var notes:Array<SongNoteData>;
|
||||
var events:Array<SongEventData>;
|
||||
|
||||
var shouldSelectNotes:Bool;
|
||||
var shouldSelectEvents:Bool;
|
||||
|
||||
@@ -34,16 +31,15 @@ class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
|
||||
public function execute(state:ChartEditorState):Void
|
||||
{
|
||||
if(above)
|
||||
if (above)
|
||||
{
|
||||
if (shouldSelectNotes)
|
||||
{
|
||||
for (i in 0...state.currentSongChartNoteData.length)
|
||||
{
|
||||
if (state.currentSongChartNoteData[i].time < time)
|
||||
notes.push(state.currentSongChartNoteData[i]);
|
||||
if (state.currentSongChartNoteData[i].time < time) notes.push(state.currentSongChartNoteData[i]);
|
||||
else
|
||||
//We've reached the end of the notes above this time,
|
||||
// We've reached the end of the notes above this time,
|
||||
// there's no reason to waste our time running this loop to completion
|
||||
break;
|
||||
}
|
||||
@@ -52,9 +48,7 @@ class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
{
|
||||
for (i in 0...state.currentSongChartEventData.length)
|
||||
{
|
||||
if (state.currentSongChartEventData[i].time < time)
|
||||
events.push(state.currentSongChartEventData[i]);
|
||||
|
||||
if (state.currentSongChartEventData[i].time < time) events.push(state.currentSongChartEventData[i]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -67,8 +61,11 @@ class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
for (i in 0...state.currentSongChartNoteData.length)
|
||||
{
|
||||
// Backwards for loop (kinda). Neat!
|
||||
if (state.currentSongChartNoteData[state.currentSongChartNoteData.length - i - 1].time > time)
|
||||
notes.push(state.currentSongChartNoteData[state.currentSongChartNoteData.length - i- 1]);
|
||||
if (state.currentSongChartNoteData[
|
||||
state.currentSongChartNoteData.length - i - 1
|
||||
].time > time) notes.push(state.currentSongChartNoteData[
|
||||
state.currentSongChartNoteData.length - i - 1
|
||||
]);
|
||||
else
|
||||
// We've reached the end of the notes below this time,
|
||||
// there's no reason to waste our time running this loop to completion
|
||||
@@ -79,8 +76,11 @@ class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
{
|
||||
for (i in 0...state.currentSongChartEventData.length)
|
||||
{
|
||||
if (state.currentSongChartEventData[state.currentSongChartEventData.length - i - 1].time > time)
|
||||
events.push(state.currentSongChartEventData[state.currentSongChartEventData.length- i- 1]);
|
||||
if (state.currentSongChartEventData[
|
||||
state.currentSongChartEventData.length - i - 1
|
||||
].time > time) events.push(state.currentSongChartEventData[
|
||||
state.currentSongChartEventData.length - i - 1
|
||||
]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -98,7 +98,6 @@ class SelectAllItemsBetweenTimeCommand implements ChartEditorCommand
|
||||
state.currentEventSelection.push(event);
|
||||
}
|
||||
|
||||
|
||||
// I don't think it's neccesary to copy this code in, but someone will make an issue out of this if I don't, I'm sure.
|
||||
// If we just selected one or more events (and no notes), then we should make the event data toolbox display the event data for the selected event.
|
||||
if (this.notes.length == 0 && this.events.length == 1)
|
||||
|
||||
Reference in New Issue
Block a user