1
0
forked from akanyan/mu3-mods

fix(SelectBGM): scoreboard bgm

This commit is contained in:
2025-01-04 02:36:33 +00:00
parent 1f01b460ba
commit 3b75874ef3
5 changed files with 40 additions and 12 deletions

View File

@ -7,8 +7,6 @@ namespace MU3.Sequence;
class patch_Play: Play {
private LocalSessionInfo _localSessionInfo;
public static int RecentID = 6;
private extern void orig_Enter_Login();
private void Enter_Login() {
orig_Enter_Login();
@ -21,19 +19,20 @@ class patch_Play: Play {
if(index < 0 || index > 6) {
index = 6;
}
RecentID = index;
Singleton<Mod.State>.instance.RecentBGM = index;
Singleton<GameSound>.instance.gameBGM.playBGM(233, index);
}
private extern void orig_Enter_ChapterSelect();
private void Enter_ChapterSelect() {
patch_GameBGM.WithholdPlay = true;
var state = Singleton<Mod.State>.instance;
state.WithholdPlay = true;
orig_Enter_ChapterSelect();
patch_GameBGM.WithholdPlay = false;
state.WithholdPlay = false;
int selectorID = SingletonStateMachine<DataManager, DataManager.EState>.instance.getMemoryChapterData(
_localSessionInfo.chapterSelection.memoryChapterId
)?.getMemoryChapterSelectorID() ?? RecentID;
)?.getMemoryChapterSelectorID() ?? state.RecentBGM;
Singleton<GameSound>.instance.gameBGM.playBGM(233, selectorID);
}
}

View File

@ -0,0 +1,19 @@
using MU3.Data;
using MU3.Game;
using MU3.Util;
namespace MU3.Sequence;
class patch_PlayMusic: PlayMusic {
private SessionInfo _sessionInfo;
private extern void orig_Enter_ShowBonusStart();
private void Enter_ShowBonusStart() {
orig_Enter_ShowBonusStart();
int selectorID = SingletonStateMachine<DataManager, DataManager.EState>.instance.getMemoryChapterData(
_sessionInfo.chapterSelection.memoryChapterId
)?.getMemoryChapterSelectorID() ?? Singleton<Mod.State>.instance.RecentBGM;
Singleton<GameSound>.instance.gameBGM.playBGM(236, selectorID);
}
}