forked from akanyan/mu3-mods
feat: implement SelectBGM
This commit is contained in:
22
SelectBGM/MU3/patch_Scene_32_PrePlayMusic_ChapterSelect.cs
Normal file
22
SelectBGM/MU3/patch_Scene_32_PrePlayMusic_ChapterSelect.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using MU3.Game;
|
||||
using MU3.Sequence;
|
||||
using MU3.Util;
|
||||
using MU3.ViewData;
|
||||
|
||||
namespace MU3;
|
||||
class patch_Scene_32_PrePlayMusic_ChapterSelect: Scene_32_PrePlayMusic_ChapterSelect {
|
||||
private ChapterSelectorItemViewData _selectItemViewData;
|
||||
private extern void orig_onChangeElement(int index, int indexRaw);
|
||||
private void onChangeElement(int index, int indexRaw) {
|
||||
patch_GameBGM.WithholdPlay = true;
|
||||
orig_onChangeElement(index, indexRaw);
|
||||
patch_GameBGM.WithholdPlay = false;
|
||||
|
||||
int selectorID = (
|
||||
(_selectItemViewData.memoryChapterViewData == null)
|
||||
? null
|
||||
: _selectItemViewData.memoryChapterViewData.memoryChapterData
|
||||
)?.getMemoryChapterSelectorID() ?? patch_Play.RecentID;
|
||||
Singleton<GameSound>.instance.gameBGM.playBGM(233, selectorID);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user