Skip to content

Commit bcbfa90

Browse files
committed
Fix Freeplay Difficulty Inst Suffix
1 parent b39f0d9 commit bcbfa90

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

source/funkin/backend/chart/Chart.hx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ class Chart {
8484
}
8585

8686
public static function loadChartMeta(songName:String, difficulty:String = '', fromMods:Bool = true, includeMetaDifficulties:Bool = true):ChartMetaData {
87-
trace(songName, difficulty, fromMods, includeMetaDifficulties);
88-
8987
var metaPath = Paths.file('songs/${songName}/meta.json');
9088
var metaDiffPath = Paths.file('songs/${songName}/meta-${difficulty}.json');
9189

source/funkin/menus/FreeplayState.hx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class FreeplayState extends MusicBeatState
256256
#if PRELOAD_ALL
257257
var dontPlaySongThisFrame = false;
258258
autoplayElapsed += elapsed;
259-
if (!disableAutoPlay && !songInstPlaying && (autoplayElapsed > timeUntilAutoplay || FlxG.keys.justPressed.SPACE)) {
259+
if (!disableAutoPlay && !songInstPlaying && (autoplayElapsed > timeUntilAutoplay)) {
260260
if (curPlayingInst != (curPlayingInst = Paths.inst(curSong.name, curSongDifficulty, curSong.instSuffix))) {
261261
var streamed = false;
262262
if (Options.streamedMusic) {
@@ -362,30 +362,31 @@ class FreeplayState extends MusicBeatState
362362
{
363363
if (change == 0 && !force) return;
364364

365-
var curSong = songs[curSelected];
366-
var validDifficulties = curSong.difficulties.length > 0;
367-
var event = event("onChangeDiff", EventManager.get(MenuChangeEvent).recycle(curDifficulty, validDifficulties ? FlxMath.wrap(curDifficulty + change, 0, curSong.difficulties.length-1) : 0, change));
365+
var song = songs[curSelected];
366+
var validDifficulties = song.difficulties.length > 0;
367+
var event = event("onChangeDiff", EventManager.get(MenuChangeEvent).recycle(curDifficulty, validDifficulties ? FlxMath.wrap(curDifficulty + change, 0, song.difficulties.length-1) : 0, change));
368368

369369
if (event.cancelled) {
370-
updateCurSongMeta();
370+
if (force) updateCurSongMeta();
371371
return;
372372
}
373373

374+
var prevInstSuffix = curSong.instSuffix;
374375
curDifficulty = event.value;
375376
updateCurSongMeta();
376377
updateScore();
377378

378379
#if PRELOAD_ALL
379-
if (songs[curSelected] != curSong) {
380+
if (curSong.instSuffix != prevInstSuffix) {
380381
autoplayElapsed = 0;
381382
songInstPlaying = false;
382383
}
383384
#end
384385

385-
if (curSong.difficulties.length > 1)
386-
diffText.text = '< ${curSong.difficulties[curDifficulty].toUpperCase()} >';
386+
if (song.difficulties.length > 1)
387+
diffText.text = '< ${song.difficulties[curDifficulty].toUpperCase()} >';
387388
else
388-
diffText.text = validDifficulties ? curSong.difficulties[curDifficulty].toUpperCase() : "-";
389+
diffText.text = validDifficulties ? song.difficulties[curDifficulty].toUpperCase() : "-";
389390
}
390391

391392
function updateScore() {

0 commit comments

Comments
 (0)