fixed everything

highscore would be compatible if the package wasn't changed to KadeDev's own
This commit is contained in:
Lucky56
2021-06-09 00:36:28 +02:00
parent 2d4637cca1
commit fab3e8ecb4
4 changed files with 41 additions and 19 deletions

View File

@ -2458,8 +2458,16 @@ class PlayState extends MusicBeatState
vocals.volume = 0;
if (SONG.validScore)
{
// adjusting the highscore song name to be compatible
// would read original scores if we didn't change packages
var songHighscore = StringTools.replace(PlayState.SONG.song, " ", "-");
switch (songHighscore) {
case 'Dad-Battle': songHighscore = 'Dadbattle';
case 'Philly-Nice': songHighscore = 'Philly';
}
#if !switch
Highscore.saveScore(SONG.song, Math.round(songScore), storyDifficulty);
Highscore.saveScore(songHighscore, Math.round(songScore), storyDifficulty);
#end
}
@ -2547,7 +2555,7 @@ class PlayState extends MusicBeatState
FlxTransitionableState.skipNextTransOut = true;
prevCamFollow = camFollow;
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
PlayState.SONG = Song.loadFromJson(nextSongLowercase + difficulty, PlayState.storyPlaylist[0]);
FlxG.sound.music.stop();
LoadingState.loadAndSwitchState(new PlayState());