mu3-mods/InfiniteStory/MU3/patch_Scene_32_PrePlayMusic_MusicSelect.cs
jujuforce 2204fb4756 fix: shop confirmation dialog not showing (#7)
Co-authored-by: Jujuforce <jujuforce@gmail.com>
Co-authored-by: akanyan <alicechecker01@proton.me>
Co-authored-by: あかニャン <akanyan@noreply.gitea.tendokyu.moe>
Reviewed-on: #7
Co-authored-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
Co-committed-by: jujuforce <jujuforce@noreply.gitea.tendokyu.moe>
2024-08-30 14:53:27 +00:00

30 lines
1.1 KiB
C#

using MonoMod;
using MU3.ViewData;
namespace MU3;
class patch_Scene_32_PrePlayMusic_MusicSelect: Scene_32_PrePlayMusic_MusicSelect {
private MusicSelectViewDataList _selectList;
private UIMusicSelector _selector;
private UIDialogBase _dialogBase;
[MonoModIgnore]
private extern void onFinishPlayScenario(int status, bool flag);
[MonoModIgnore]
private extern void updateSystemUIPanel();
private extern void orig_Execute_Select();
private void Execute_Select() {
// Walk around the warning dialog
if(_dialogBase == null && !_selector.isDecided && !_selector.isCanceled && (_selector.isPressed || _selector.isPressedDisabledElement)) {
MusicSelectViewData musicViewData = _selectList.getMusicViewData(_selector.selectIndex);
if(musicViewData != null && musicViewData.kind == MusicSelectViewData.Kind.Scenario
&& musicViewData.scenarioViewData.ngReason == ScenarioViewData.PlayNGReason.None) {
onFinishPlayScenario(0, false);
updateSystemUIPanel();
return;
}
}
orig_Execute_Select();
}
}