Skip to content

Commit

Permalink
Fix issue with scene_12 on 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ALLMarvelous committed Jan 28, 2025
1 parent c8b17ac commit 9b47bee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions Data/Bms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using CustomAlbums.Utilities;
using Il2CppAssets.Scripts.GameCore.Managers;
using Il2CppAssets.Scripts.PeroTools.Commons;
using Il2CppFormulaBase;
using Il2CppGameLogic;
using Il2CppPeroPeroGames.GlobalDefines;

Expand Down Expand Up @@ -331,6 +330,9 @@ public void InitNoteData()
{
NoteData = new Dictionary<string, NoteConfigData>();

// NOTE: PPG has officially gone mad. The new scene 12 does not appear in the scene list, so we can't really use the scene list anymore.
Span<int> sceneSpan = stackalloc int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };

foreach (var config in NoteDataMananger.instance.noteDatas)
{
// Ignore april fools variants (these are handled elsewhere)
Expand All @@ -355,16 +357,14 @@ public void InitNoteData()
if (anyScene)
{
scenes = new List<string>();
foreach (var scene in Singleton<StageBattleComponent>.instance.sceneInfo)

foreach (var scene in sceneSpan)
{
// Special handling for collectibles in touhou scene
if (config.GetNoteType() is NoteType.Hp or NoteType.Music && scene.Value == 8)
if (config.GetNoteType() is NoteType.Hp or NoteType.Music && scene == 8)
continue;

// Fix for 10+ scenes
var sceneSuffix = scene.Value.ToString().Length == 1
? $"0{scene.Value}"
: scene.Value.ToString();
var sceneSuffix = scene.ToString().PadLeft(2, '0');
scenes.Add($"scene_{sceneSuffix}");
}
}
Expand Down Expand Up @@ -417,6 +417,7 @@ public JsonArray GetNoteData()
var speedGround = speedAir;

var objectId = 1;

for (var i = 0; i < Notes.Count; i++)
{
var note = Notes[i];
Expand All @@ -433,6 +434,7 @@ public JsonArray GetNoteData()
pathway = 1;
else if (channelType.HasFlag(ChannelType.Ground) || channelType.HasFlag(ChannelType.Event))
pathway = 0;

if (pathway == -1) continue;

// ReSharper disable once SwitchStatementHandlesSomeKnownEnumValuesWithDefault
Expand Down Expand Up @@ -474,6 +476,7 @@ public JsonArray GetNoteData()

var speed = pathway == 1 ? speedAir : speedGround;
var scene = Info["GENRE"]?.GetValue<string>();

if (!NoteData!.TryGetValue(GetNoteDataKey(bmsKey, pathway, speed, scene), out var configData))
continue;

Expand Down
8 changes: 4 additions & 4 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomAlbums")]
[assembly: AssemblyCopyright("Copyright © Muse Dash Modding Community 2024")]
[assembly: AssemblyCopyright("Copyright © Muse Dash Modding Community 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -29,8 +29,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.3.0")]
[assembly: AssemblyFileVersion("4.1.3.0")]
[assembly: MelonInfo(typeof(CustomAlbums.Main), "CustomAlbums", "4.1.3", "Team Baller")]
[assembly: AssemblyVersion("4.1.4.0")]
[assembly: AssemblyFileVersion("4.1.4.0")]
[assembly: MelonInfo(typeof(CustomAlbums.Main), "CustomAlbums", "4.1.4", "Two Fellas")]
[assembly: MelonGame("PeroPeroGames", "MuseDash")]
[assembly: MelonColor(255, 0, 255, 150)]

0 comments on commit 9b47bee

Please sign in to comment.