-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatability with CustomJSONData
Infinite mode wasn't working when the CustomJSONData plugin was installed. When starting infinite mode, Infinite Beat Saber would call `BeatmapData.InsertBeatmapEventDataInOrder` which would lead to the exception: ``` KeyNotFoundException: The given key 'CustomJSONData.CustomBeatmap.CustomBPMChangeBeatmapEventData' was not present in the dictionary. ``` The problem was that CustomJSONData converted all of the map's `BeatmapDataItems` to its own `BeatmapDataItem` subclasses (e.g. `CustomBPMChangeBeatmapEventData`). Part of Beat Saber's `InsertBeatmapEventDataInOrder` implementation blows up when given a `BeatmapDataItem` with which it isn't familiar. `BeatmapRemixer.AddCustomJSONDataProcessors` fixes this problem. See that method's comment for details. The solution required Infinite Beat Saber to depend on CustomJSONData and depending on CustomJSONData required updating Infinite Beat Saber from .NET Framework 4.7.2 to 4.8.
- Loading branch information
Showing
7 changed files
with
72 additions
and
8 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
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,15 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace InfiniteBeatSaber.Extensions | ||
{ | ||
internal static class DictionaryExtensions | ||
{ | ||
public static void AddIfMissing<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, TValue value) | ||
{ | ||
if (!dictionary.ContainsKey(key)) | ||
{ | ||
dictionary.Add(key, value); | ||
} | ||
} | ||
} | ||
} |
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