From af3e47be0790bb650550613bac2fffb4b46c75bf Mon Sep 17 00:00:00 2001 From: Kade M Date: Fri, 4 Jun 2021 14:40:05 -0700 Subject: [PATCH] snappers --- source/ChartingState.hx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 9e2ccb2..9575ab4 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -660,21 +660,16 @@ class ChartingState extends MusicBeatState } var writingNotes:Bool = false; - var doSnapShit:Bool = false; + var doSnapShit:Bool = true; override function update(elapsed:Float) { updateHeads(); - snapText.text = "Snap: 1/" + snap + " (Control + Left or Right to change.)\nAdd Notes: 1-8 (or click)\n"; + snapText.text = "Snap: 1/" + snap + " (" + (doSnapShit ? "Control to disable" : "Snap Disabled, Control to renable") + ")\nAdd Notes: 1-8 (or click)\n"; curStep = recalculateSteps(); - if (FlxG.keys.justPressed.ALT && UI_box.selected_tab == 0) - { - writingNotes = !writingNotes; - } - /*if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.RIGHT) snap = snap * 2; if (FlxG.keys.pressed.CONTROL && FlxG.keys.justPressed.LEFT) @@ -685,7 +680,7 @@ class ChartingState extends MusicBeatState snap = 1;*/ if (FlxG.keys.justPressed.CONTROL) - doSnapShit = false; + doSnapShit = !doSnapShit; Conductor.songPosition = FlxG.sound.music.time; _song.song = typingShit.text; @@ -944,6 +939,10 @@ class ChartingState extends MusicBeatState resetSection(); } + + if (FlxG.sound.music.time < 0 || curStep < 0) + FlxG.sound.music.time = 0; + if (FlxG.mouse.wheel != 0) { FlxG.sound.music.pause(); @@ -951,16 +950,13 @@ class ChartingState extends MusicBeatState var stepMs = curStep * Conductor.stepCrochet; - if (FlxG.sound.music.time < 0 || curStep < 0) - FlxG.sound.music.time = 0; - trace(Conductor.stepCrochet / snap); if (doSnapShit) - FlxG.sound.music.time = (stepMs + (Conductor.stepCrochet / snap)) * FlxG.mouse.wheel; + FlxG.sound.music.time = stepMs - (FlxG.mouse.wheel * Conductor.stepCrochet / snap); else - FlxG.sound.music.time = (stepMs + (Conductor.stepCrochet / 16)) * FlxG.mouse.wheel; + FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.stepCrochet * 0.4); trace(stepMs + " + " + Conductor.stepCrochet / snap + " -> " + FlxG.sound.music.time); vocals.time = FlxG.sound.music.time;