Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use preview Timings for FreePlay Song Preview #2729

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions source/funkin/ui/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,7 @@ class FreeplayState extends MusicBeatSubState
else
{
var potentiallyErect:String = (currentDifficulty == "erect") || (currentDifficulty == "nightmare") ? "-erect" : "";
final previewTiming:Array<Float> = daSongCapsule.songData.getPreviewTiming();
FunkinSound.playMusic(daSongCapsule.songData.songId,
{
startingVolume: 0.0,
Expand All @@ -1901,11 +1902,11 @@ class FreeplayState extends MusicBeatSubState
partialParams:
{
loadPartial: true,
start: 0.05,
end: 0.25
start: previewTiming[0],
end: previewTiming[1],
},
onLoad: function() {
FlxG.sound.music.fadeIn(2, 0, 0.4);
FlxG.sound.music.fadeIn(2, 0, 0.6);
}
});
}
Expand Down Expand Up @@ -2043,6 +2044,9 @@ class FreeplaySongData
public var scoringRank:Null<ScoringRank> = null;

var displayedVariations:Array<String> = [Constants.DEFAULT_VARIATION];

public inline function getPreviewTiming():Array<Float>
return [song._data.playData.previewStart / 100000, song._data.playData.previewEnd / 100000]; // 100000 = ms -> seconds

function set_currentDifficulty(value:String):String
{
Expand Down