From fe21dfe7e8334d0811d4e892a761fdc918bd0ed1 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 6 Jan 2021 23:02:23 -0500 Subject: [PATCH] charting editor improvements --- source/ChartingState.hx | 47 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index d9c595365..b7001a708 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -514,9 +514,18 @@ class ChartingState extends MusicBeatState if (FlxG.keys.justPressed.R) { if (FlxG.keys.pressed.SHIFT) - changeSection(); + resetSection(); else - changeSection(curSection); + resetSection(true); + } + + if (FlxG.mouse.wheel != 0) + { + FlxG.sound.music.pause(); + vocals.pause(); + + FlxG.sound.music.time -= (FlxG.mouse.wheel * Conductor.stepCrochet * 1); + vocals.time = FlxG.sound.music.time; } if (!FlxG.keys.pressed.SHIFT) @@ -569,9 +578,9 @@ class ChartingState extends MusicBeatState var shiftThing:Int = 1; if (FlxG.keys.pressed.SHIFT) shiftThing = 4; - if (FlxG.keys.justPressed.RIGHT) + if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.D) changeSection(curSection + shiftThing); - if (FlxG.keys.justPressed.LEFT) + if (FlxG.keys.justPressed.LEFT || FlxG.keys.justPressed.A) changeSection(curSection - shiftThing); bpmTxt.text = bpmTxt.text = Std.string(FlxMath.roundDecimal(Conductor.songPosition / 1000, 2)) @@ -604,6 +613,26 @@ class ChartingState extends MusicBeatState return curStep; } + function resetSection(songBeginning:Bool = false):Void + { + updateGrid(); + + FlxG.sound.music.pause(); + vocals.pause(); + + // Basically old shit from changeSection??? + FlxG.sound.music.time = lengthBpmBullshit() * Conductor.stepCrochet * curSection; + + if (songBeginning) + FlxG.sound.music.time = 0; + + vocals.time = FlxG.sound.music.time; + updateCurStep(); + + updateGrid(); + updateSectionUI(); + } + function changeSection(sec:Int = 0, ?updateMusic:Bool = true):Void { trace('changing section' + sec); @@ -627,7 +656,15 @@ class ChartingState extends MusicBeatState daNum++; } - FlxG.sound.music.time = (daLength - lengthBpmBullshit()) * Conductor.stepCrochet; + if (FlxG.keys.pressed.CONTROL) + { + FlxG.sound.music.time = (daLength - lengthBpmBullshit()) * Conductor.stepCrochet; + } + else + { + FlxG.sound.music.time += (lengthBpmBullshit() * Conductor.stepCrochet) * sec; + } + vocals.time = FlxG.sound.music.time; updateCurStep(); }