This repository has been archived by the owner on Sep 30, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added better song parsing error handling. Fixed bug where you'd somet…
…imes get stuck while playing a song.
- Loading branch information
Showing
6 changed files
with
81 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Linq; | ||
|
||
namespace SongLoaderPlugin | ||
{ | ||
/// There's a bug in Beat Saber, where | ||
/// if you pause a song mid-playthrough, | ||
/// and go back to menu, start playing another song, | ||
/// the new level difficulty isn't updated throughout all the game managers. | ||
/// So when you play a custom song that only has Expert difficulty, | ||
/// pause and go play another custom song that only has Easy difficulty, | ||
/// you're going to have problems. | ||
/// So here instead of returning null when it can't find any difficulty level, | ||
/// We're going to return the first difficulty level. | ||
|
||
public class CustomLevelStaticData : LevelStaticData | ||
{ | ||
public override DifficultyLevel GetDifficultyLevel(Difficulty difficulty) | ||
{ | ||
foreach (var difficultyLevel in _difficultyLevels) | ||
{ | ||
if (difficultyLevel.difficulty == difficulty) | ||
{ | ||
return difficultyLevel; | ||
} | ||
} | ||
|
||
return difficultyLevels.First(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters