1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-26 06:37:23 +00:00

almost got sustains working

This commit is contained in:
Cameron Taylor 2020-10-18 19:51:01 -07:00
parent bc367a08dc
commit 06ef3c8529

View file

@ -62,7 +62,10 @@ class ChartingState extends MusicBeatState
var _song:Song;
var typingShit:FlxInputText;
var curSelectedNote:Note = new Note(0, 0, null);
/*
* WILL BE THE CURRENT / LAST PLACED NOTE
**/
var curSelectedNote:Array<Dynamic>;
override function create()
{
@ -330,6 +333,7 @@ class ChartingState extends MusicBeatState
{
if (FlxG.mouse.overlaps(note))
{
trace('tryin to delete note...');
deleteNote(note);
}
});
@ -501,9 +505,6 @@ class ChartingState extends MusicBeatState
var daStrumTime = i[0];
var daSus = i[2];
if (daSus == null)
i[2] == 0;
var note:Note = new Note(daStrumTime, daNoteInfo % 4);
note.sustainLength = daSus;
note.setGraphicSize(GRID_SIZE, GRID_SIZE);
@ -512,6 +513,13 @@ class ChartingState extends MusicBeatState
note.y = getYfromStrum(daStrumTime) % gridBG.height;
curRenderedNotes.add(note);
if (daSus > 0)
{
var sustainVis:FlxSprite = new FlxSprite(note.x,
note.y).makeGraphic(8, Math.floor(FlxMath.remapToRange(daSus, 0, Conductor.stepCrochet * 16, 0, gridBG.height)));
curRenderedSustains.add(sustainVis);
}
}
}
@ -536,10 +544,13 @@ class ChartingState extends MusicBeatState
private function addNote():Void
{
var swagNote:NoteMeta = new NoteMeta(Math.round(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16))),
Math.floor(FlxG.mouse.x / GRID_SIZE), 0);
var noteStrum = Math.round(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16)));
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
var noteSus = 0;
_song.notes[curSection].sectionNotes.push(swagNote);
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
trace(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16)));
trace(curSection);