From 188674b64c104b643b100a136b87624edb45f7d9 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sat, 17 Oct 2020 14:33:35 -0700 Subject: [PATCH] CHARTING SYSTEM IN PROGRESS --- source/ChartingState.hx | 20 +++++++++++++++++++- source/PlayState.hx | 11 ++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 8d012ff78..6495ce02d 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -172,6 +172,11 @@ class ChartingState extends MusicBeatState stepperLength.value = _song.notes[curSection].lengthInSteps; stepperLength.name = "section_length"; + var copyButton:FlxButton = new FlxButton(110, 8, "Copy last section", function() + { + copySection(); + }); + check_mustHitSection = new FlxUICheckBox(10, 30, null, null, "Must hit section", 100); check_mustHitSection.name = 'check_mustHit'; check_mustHitSection.checked = true; @@ -184,6 +189,7 @@ class ChartingState extends MusicBeatState tab_group_section.add(stepperLength); tab_group_section.add(check_mustHitSection); + tab_group_section.add(copyButton); UI_box.addGroup(tab_group_section); } @@ -392,6 +398,18 @@ class ChartingState extends MusicBeatState } } + function copySection() + { + var daSec = FlxMath.maxInt(curSection, 1); + + for (note in _song.notes[daSec - 1].notes) + { + _song.notes[daSec].notes.push([note[0] + Conductor.stepCrochet * _song.notes[daSec].lengthInSteps, note[1]]); + } + + updateGrid(); + } + function updateSectionUI():Void { var sec = _song.notes[curSection]; @@ -445,7 +463,7 @@ class ChartingState extends MusicBeatState private function addNote():Void { _song.notes[curSection].notes.push([ - Math.round(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 32))), + Math.round(getStrumTime(dummyArrow.y) + (curSection * (Conductor.stepCrochet * 16))), Math.floor(FlxG.mouse.x / GRID_SIZE) ]); diff --git a/source/PlayState.hx b/source/PlayState.hx index b111368bf..a11a283e8 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -270,11 +270,8 @@ class PlayState extends MusicBeatState sectionScores[1].push(0); var daStrumTime:Float = songNotes[0]; - trace(daStrumTime); var daNoteData:Int = songNotes[1]; - // var daStrumTime:Float = daStrumTime; - var oldNote:Note; if (unspawnNotes.length > 0) oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; @@ -572,13 +569,13 @@ class PlayState extends MusicBeatState { switch (Math.abs(daNote.noteData)) { - case 1: - dad.playAnim('singUP'); case 2: - dad.playAnim('singRIGHT'); + dad.playAnim('singUP'); case 3: + dad.playAnim('singRIGHT'); + case 1: dad.playAnim('singDOWN'); - case 4: + case 0: dad.playAnim('singLEFT'); }