From 37dbd09f92cee97957a2cf6a293702f864ecf1af Mon Sep 17 00:00:00 2001 From: Detoria <44783518+theDetourist@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:49:29 -0300 Subject: [PATCH] yoo --- source/PlayState.hx | 53 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index cacd2d3..d5f9a27 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2595,6 +2595,49 @@ class PlayState extends MusicBeatState daNote.visible = true; daNote.active = true; } + + if (!daNote.modifiedByLua) + { + if (FlxG.save.data.downscroll) + { + daNote.y = (strumLine.y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2)); + if(daNote.isSustainNote) + { + // Remember = minus makes notes go up, plus makes them go down + if(daNote.animation.curAnim.name.endsWith('end') && daNote.prevNote != null) + daNote.y += daNote.prevNote.height; + else + daNote.y += daNote.height / 2; + + if((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit) && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= (strumLine.y + Note.swagWidth / 2)) + { + // Clip to strumline + var swagRect = new FlxRect(0, 0, daNote.frameWidth * 2, daNote.frameHeight * 2); + swagRect.height = (strumLine.y + Note.swagWidth / 2 - daNote.y) / daNote.scale.y; + swagRect.y = daNote.frameHeight - swagRect.height; + + daNote.clipRect = swagRect; + } + } + }else + { + daNote.y = (strumLine.y - 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2)); + if(daNote.isSustainNote) + { + daNote.y -= daNote.height / 2; + + if((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit) && daNote.y + daNote.offset.y * daNote.scale.y <= (strumLine.y + Note.swagWidth / 2)) + { + // Clip to strumline + var swagRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y); + swagRect.y = (strumLine.y + Note.swagWidth / 2 - daNote.y) / daNote.scale.y; + swagRect.height -= swagRect.y; + + daNote.clipRect = swagRect; + } + } + } + } if (!daNote.mustPress && daNote.wasGoodHit) { @@ -2637,14 +2680,6 @@ class PlayState extends MusicBeatState notes.remove(daNote, true); daNote.destroy(); } - - if (!daNote.modifiedByLua) - { - if (FlxG.save.data.downscroll) - daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (-0.45 * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2))); - else - daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2))); - } if (daNote.mustPress && !daNote.modifiedByLua) { @@ -3859,7 +3894,7 @@ class PlayState extends MusicBeatState if (generatedMusic) { - notes.sort(FlxSort.byY, FlxSort.DESCENDING); + notes.sort(FlxSort.byY, (FlxG.save.data.downscroll ? FlxSort.ASCENDING : FlxSort.DESCENDING)); } #if windows