Merge pull request #314 from theDetourist/completenotefix

Other half of the note trail fix
This commit is contained in:
Kade M 2021-04-26 13:00:34 -07:00 committed by GitHub
commit d6285331a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2596,6 +2596,49 @@ class PlayState extends MusicBeatState
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)
{
if (SONG.song != 'Tutorial')
@ -2638,14 +2681,6 @@ class PlayState extends MusicBeatState
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)
{
daNote.visible = playerStrums.members[Math.floor(Math.abs(daNote.noteData))].visible;
@ -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