qaunt sus dragging (WIP)

This commit is contained in:
lunarcleint
2024-02-29 18:44:35 -07:00
parent 1cdb7fe2f6
commit de7d599cdd
2 changed files with 6 additions and 1 deletions
+3
View File
@@ -768,6 +768,8 @@ class Charter extends UIState {
currentCursor = BUTTON;
selection.loop(function (n:CharterNote) {
n.tempSusLength = Math.max((mousePos.y-dragStartPos.y) / 40, -n.susLength);
if (!FlxG.keys.pressed.SHIFT) n.tempSusLength = quantStep(n.tempSusLength);
@:privateAccess n.__susInstaLerp = true;
});
} else {
var undoChanges:Array<NoteSustainChange> = [];
@@ -777,6 +779,7 @@ class Charter extends UIState {
n.susLength += n.tempSusLength;
n.tempSusLength = 0;
@:privateAccess n.__susInstaLerp = false;
n.updatePos(n.step, n.id, n.susLength, n.type);
undoChanges.push({before: oldSusLen, after: n.susLength, note: n});
});
+3 -1
View File
@@ -11,6 +11,7 @@ class CharterNote extends UISprite implements ICharterSelectable {
var angleTween:FlxTween;
var __doAnim:Bool = false;
var __animSpeed:Float = 1;
var __susInstaLerp:Bool = false;
private static var colors:Array<FlxColor> = [
0xFFC24B99,
@@ -150,7 +151,8 @@ class CharterNote extends UISprite implements ICharterSelectable {
sustainDraggable = UIState.state.isOverlapping(sustainHitbox, @:privateAccess sustainHitbox.__rect);
}
sustainSpr.scale.set(10, CoolUtil.fpsLerp(sustainSpr.scale.y, (40 * (susLength+tempSusLength)) + ((susLength+tempSusLength) != 0 ? (height/2) : 0), 1/2));
var sprLength:Float = (40 * (susLength+tempSusLength)) + ((susLength+tempSusLength) != 0 ? (height/2) : 0);
sustainSpr.scale.set(10, __susInstaLerp ? sprLength : CoolUtil.fpsLerp(sustainSpr.scale.y, sprLength, 1/2));
sustainSpr.updateHitbox();
sustainSpr.follow(this, 15, 20);