undo (chat saw it)
This commit is contained in:
parent
200714f866
commit
d360ed048d
@ -85,6 +85,9 @@ class ChartingState extends MusicBeatState
|
|||||||
var leftIcon:HealthIcon;
|
var leftIcon:HealthIcon;
|
||||||
var rightIcon:HealthIcon;
|
var rightIcon:HealthIcon;
|
||||||
|
|
||||||
|
private var lastNote:Note;
|
||||||
|
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
curSection = lastSection;
|
curSection = lastSection;
|
||||||
@ -587,8 +590,6 @@ class ChartingState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
trace('tryin to delete note');
|
|
||||||
trace(note.noteData);
|
|
||||||
deleteNote(note);
|
deleteNote(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -656,6 +657,19 @@ class ChartingState extends MusicBeatState
|
|||||||
|
|
||||||
if (!typingShit.hasFocus)
|
if (!typingShit.hasFocus)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (FlxG.keys.pressed.CONTROL)
|
||||||
|
{
|
||||||
|
if (FlxG.keys.justPressed.Z && lastNote != null)
|
||||||
|
{
|
||||||
|
trace(curRenderedNotes.members.contains(lastNote) ? "delete note" : "add note");
|
||||||
|
if (curRenderedNotes.members.contains(lastNote))
|
||||||
|
deleteNote(lastNote);
|
||||||
|
else
|
||||||
|
addNote(lastNote);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var shiftThing:Int = 1;
|
var shiftThing:Int = 1;
|
||||||
if (FlxG.keys.pressed.SHIFT)
|
if (FlxG.keys.pressed.SHIFT)
|
||||||
shiftThing = 4;
|
shiftThing = 4;
|
||||||
@ -959,6 +973,10 @@ class ChartingState extends MusicBeatState
|
|||||||
note.x = Math.floor(daNoteInfo * GRID_SIZE);
|
note.x = Math.floor(daNoteInfo * GRID_SIZE);
|
||||||
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)));
|
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)));
|
||||||
|
|
||||||
|
if (curSelectedNote != null)
|
||||||
|
if (curSelectedNote[0] == note.strumTime)
|
||||||
|
lastNote = note;
|
||||||
|
|
||||||
curRenderedNotes.add(note);
|
curRenderedNotes.add(note);
|
||||||
|
|
||||||
if (daSus > 0)
|
if (daSus > 0)
|
||||||
@ -1006,6 +1024,7 @@ class ChartingState extends MusicBeatState
|
|||||||
|
|
||||||
function deleteNote(note:Note):Void
|
function deleteNote(note:Note):Void
|
||||||
{
|
{
|
||||||
|
lastNote = note;
|
||||||
for (i in _song.notes[curSection].sectionNotes)
|
for (i in _song.notes[curSection].sectionNotes)
|
||||||
{
|
{
|
||||||
if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
|
if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
|
||||||
@ -1034,23 +1053,20 @@ class ChartingState extends MusicBeatState
|
|||||||
updateGrid();
|
updateGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addNote():Void
|
private function addNote(?n:Note):Void
|
||||||
{
|
{
|
||||||
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
||||||
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
||||||
var noteSus = 0;
|
var noteSus = 0;
|
||||||
|
|
||||||
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
|
if (n != null)
|
||||||
|
_song.notes[curSection].sectionNotes.push([n.strumTime, n.noteData, n.sustainLength]);
|
||||||
|
else
|
||||||
|
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
|
||||||
|
|
||||||
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
var thingy = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
||||||
|
|
||||||
if (FlxG.keys.pressed.CONTROL)
|
curSelectedNote = thingy;
|
||||||
{
|
|
||||||
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]);
|
|
||||||
}
|
|
||||||
|
|
||||||
trace(noteStrum);
|
|
||||||
trace(curSection);
|
|
||||||
|
|
||||||
updateGrid();
|
updateGrid();
|
||||||
updateNoteUI();
|
updateNoteUI();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user