lerp polish chart editor lol!

This commit is contained in:
Cameron Taylor 2022-01-28 20:03:38 -05:00
parent d8b6be43ed
commit fc209188f2
3 changed files with 16 additions and 6 deletions

View file

@ -120,7 +120,7 @@
<haxelib name="flixel-ui" />
<!--haxelib name="newgrounds" unless="switch"/> -->
<haxelib name="faxe" if='switch'/>
<haxelib name="polymod" if="cpp"/>
<haxelib name="polymod" if="desktop"/>
<haxelib name="firetongue" />
<!-- <haxelib name="colyseus"/> -->

View file

@ -580,9 +580,17 @@ class ChartingState extends MusicBeatState
Conductor.songPosition = FlxG.sound.music.time;
_song.song = typingShit.text;
playheadTest.y = FlxMath.remapToRange(Conductor.songPosition, 0, FlxG.sound.music.length, 0, FlxG.height);
playheadTest.y = CoolUtil.coolLerp(playheadTest.y, FlxMath.remapToRange(Conductor.songPosition, 0, FlxG.sound.music.length, 0, FlxG.height), 0.5);
strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * SongLoad.getSong()[curSection].lengthInSteps));
var strumLinePos:Float = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * SongLoad.getSong()[curSection].lengthInSteps));
if (FlxG.sound.music != null)
{
if (FlxG.sound.music.playing)
strumLine.y = strumLinePos;
else
strumLine.y = CoolUtil.coolLerp(strumLine.y, strumLinePos, 0.5);
}
/* if (FlxG.sound.music.playing)
{
@ -619,7 +627,7 @@ class ChartingState extends MusicBeatState
vocals.pause();
}
FlxG.sound.music.time = getStrumTime(FlxG.mouse.y) + sectionStartTime();
FlxG.sound.music.time = CoolUtil.coolLerp(FlxG.sound.music.time, getStrumTime(FlxG.mouse.y) + sectionStartTime(), 0.5);
vocals.time = FlxG.sound.music.time;
}
@ -646,7 +654,8 @@ class ChartingState extends MusicBeatState
vocals.pause();
}
FlxG.sound.music.time = FlxMath.remapToRange(FlxG.mouse.screenY, 0, FlxG.height, 0, FlxG.sound.music.length);
FlxG.sound.music.time = CoolUtil.coolLerp(FlxG.sound.music.time,
FlxMath.remapToRange(FlxG.mouse.screenY, 0, FlxG.height, 0, FlxG.sound.music.length), 0.5);
vocals.time = FlxG.sound.music.time;
}
if (FlxG.mouse.justPressed)

View file

@ -1,6 +1,7 @@
package modding;
#if cpp
#if desktop
import polymod.Polymod.ModMetadata;
import polymod.Polymod;
import polymod.backends.OpenFLBackend;
import polymod.backends.PolymodAssets.PolymodAssetType;