mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-23 05:15:14 -04: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:
parent
b121a6bc65
commit
620cd50c1d
2 changed files with 8 additions and 3 deletions
source/funkin/ui/debug/charting
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue