From c1954d76c17f72b187c93b5d03ac7bb71bddd0e2 Mon Sep 17 00:00:00 2001 From: akanyan Date: Mon, 8 Jul 2024 03:33:38 +0900 Subject: [PATCH] feat(SkipPreMusic): now triggered by LMenu --- SkipPreMusicRitual/MU3.Battle/patch_GameEngine.cs | 7 ------- SkipPreMusicRitual/MU3.Sequence/patch_PlayMusic.cs | 10 ++++++++-- SkipPreMusicRitual/MU3/patch_BattleUI.cs | 7 ++++++- 3 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 SkipPreMusicRitual/MU3.Battle/patch_GameEngine.cs diff --git a/SkipPreMusicRitual/MU3.Battle/patch_GameEngine.cs b/SkipPreMusicRitual/MU3.Battle/patch_GameEngine.cs deleted file mode 100644 index 095b18c..0000000 --- a/SkipPreMusicRitual/MU3.Battle/patch_GameEngine.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace MU3.Battle; - -class patch_GameEngine: GameEngine { - public new bool isStartCutsceneFinish() { - return true; - } -} \ No newline at end of file diff --git a/SkipPreMusicRitual/MU3.Sequence/patch_PlayMusic.cs b/SkipPreMusicRitual/MU3.Sequence/patch_PlayMusic.cs index 0c1ebc6..3d079be 100644 --- a/SkipPreMusicRitual/MU3.Sequence/patch_PlayMusic.cs +++ b/SkipPreMusicRitual/MU3.Sequence/patch_PlayMusic.cs @@ -1,14 +1,20 @@ using MU3.Battle; +using MU3.Util; namespace MU3.Sequence; class patch_PlayMusic: PlayMusic { private GameEngine _gameEngine; private extern void orig_Execute_StartCutscene(); + public static bool ForceSkipped { get; private set; } private void Execute_StartCutscene() { orig_Execute_StartCutscene(); - _gameEngine.skipStartCutscene(); - setNextState(EState.Countdown); + ForceSkipped = false; + if(Singleton.instance.getStateOn(UIInput.Key.MenuLeft)) { + _gameEngine.skipStartCutscene(); + setNextState(EState.Countdown); + ForceSkipped = true; + } } } \ No newline at end of file diff --git a/SkipPreMusicRitual/MU3/patch_BattleUI.cs b/SkipPreMusicRitual/MU3/patch_BattleUI.cs index 3322980..95352a7 100644 --- a/SkipPreMusicRitual/MU3/patch_BattleUI.cs +++ b/SkipPreMusicRitual/MU3/patch_BattleUI.cs @@ -1,11 +1,16 @@ -using MU3.Util; +using MU3.Sequence; +using MU3.Util; using System; using UnityEngine; namespace MU3; class patch_BattleUI: BattleUI { + private extern System.Collections.IEnumerator orig_playReadyProc(Action onFinish); private System.Collections.IEnumerator playReadyProc(Action onFinish) { + if(!patch_PlayMusic.ForceSkipped) { + yield return orig_playReadyProc(onFinish); + } if(!SystemUI.Exists) { onFinish(); yield break;