susnote clip for downscroll still looks like shit tho

This commit is contained in:
MtH 2021-03-31 03:02:12 +02:00
parent 95e53ebc38
commit 6b979e50cb
2 changed files with 25 additions and 9 deletions

View file

@ -184,6 +184,8 @@ class Note extends FlxSprite
}
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
if (PreferencesMenu.getPref('downscroll'))
prevNote.angle = 0;
prevNote.updateHitbox();
// prevNote.setGraphicSize();
}

View file

@ -1647,22 +1647,36 @@ class PlayState extends MusicBeatState
daNote.active = true;
}
var strumLineMid = strumLine.y + Note.swagWidth / 2;
if (PreferencesMenu.getPref('downscroll'))
{
daNote.y = (strumLine.y + (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
if (daNote.isSustainNote && (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
&& daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= strumLineMid)
{
// div by scale because cliprect is affected by scale i THINK
var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);
swagRect.height = (strumLineMid - daNote.y) / daNote.scale.y;
daNote.clipRect = swagRect;
}
}
else
{
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
// i am so fucking sorry for this if condition
if (daNote.isSustainNote
&& daNote.y + daNote.offset.y <= strumLine.y + Note.swagWidth / 2
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit))))
if (daNote.isSustainNote && (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
&& daNote.y + daNote.offset.y * daNote.scale.y <= strumLineMid)
{
var swagRect = new FlxRect(0, strumLine.y + Note.swagWidth / 2 - daNote.y, daNote.width * 2, daNote.height * 2);
swagRect.y /= daNote.scale.y;
swagRect.height -= swagRect.y;
var swagRect:FlxRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);
swagRect.y = (strumLineMid - daNote.y) / daNote.scale.y;
swagRect.height -= swagRect.y;
daNote.clipRect = swagRect;
}
}
if (!daNote.mustPress && daNote.wasGoodHit)
{