1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-08-20 07:25:59 +00:00

Chart Editor: Sustain Note polish (#223)

* light lerp polish on ghost sustains

* small hold fix

* small number tweak

---------

Co-authored-by: Eric <ericmyllyoja@gmail.com>
This commit is contained in:
Cameron Taylor 2023-11-21 15:10:18 -05:00 committed by GitHub
parent b121a6bc65
commit 620cd50c1d
2 changed files with 8 additions and 3 deletions

View file

@ -3399,13 +3399,14 @@ class ChartEditorState extends HaxeUIState
gridGhostHoldNote.noteData = gridGhostNote.noteData;
gridGhostHoldNote.noteDirection = gridGhostNote.noteData.getDirection();
gridGhostHoldNote.setHeightDirectly(dragLengthPixels);
gridGhostHoldNote.setHeightDirectly(dragLengthPixels, true);
gridGhostHoldNote.updateHoldNotePosition(renderedHoldNotes);
}
else
{
gridGhostHoldNote.visible = false;
gridGhostHoldNote.setHeightDirectly(0);
}
}

View file

@ -9,6 +9,7 @@ import flixel.graphics.frames.FlxTileFrames;
import flixel.math.FlxPoint;
import funkin.play.notes.SustainTrail;
import funkin.data.song.SongData.SongNoteData;
import flixel.math.FlxMath;
/**
* A sprite that can be used to display the trail of a hold note in a chart.
@ -42,9 +43,12 @@ class ChartEditorHoldNoteSprite extends SustainTrail
* Set the height directly, to a value in pixels.
* @param h The desired height in pixels.
*/
public function setHeightDirectly(h:Float)
public function setHeightDirectly(h:Float, ?lerp:Bool = false)
{
sustainLength = h / (getScrollSpeed() * Constants.PIXELS_PER_MS);
if (lerp != null && lerp) sustainLength = FlxMath.lerp(sustainLength, h / (getScrollSpeed() * Constants.PIXELS_PER_MS), 0.25);
else
sustainLength = h / (getScrollSpeed() * Constants.PIXELS_PER_MS);
fullSustainLength = sustainLength;
}