1
0
forked from akanyan/mu3-mods

fix(SkipCutscenes): interaction with restart

This commit is contained in:
2025-01-11 23:59:27 +00:00
parent ff8bdbdd22
commit e3b1f1885c
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,6 @@
using MonoMod; using MonoMod;
using MU3.Battle; using MU3.Battle;
using MU3.Notes;
using MU3.Util; using MU3.Util;
using System.Collections; using System.Collections;
using UnityEngine; using UnityEngine;
@ -10,6 +11,9 @@ class patch_PlayMusic: PlayMusic {
private GameEngine _gameEngine; private GameEngine _gameEngine;
private bool _quickStart = false; private bool _quickStart = false;
[MonoModIgnore]
private NotesManager ntMgr => null;
[MonoModIgnore] [MonoModIgnore]
private extern bool isPartyPlay(); private extern bool isPartyPlay();
@ -42,8 +46,13 @@ class patch_PlayMusic: PlayMusic {
private IEnumerator nuclearSkip() { private IEnumerator nuclearSkip() {
bool enabled = false; bool enabled = false;
var initialFrame = ntMgr.getCurrentFrame();
EState state; EState state;
while((state = getCurrentState()) < EState.End) { while((state = getCurrentState()) < EState.End) {
if(initialFrame > ntMgr.getCurrentFrame()) {
// The run must have been restarted
yield break;
}
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) { if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
if(!isPartyPlay() || state > EState.CalcResult) { if(!isPartyPlay() || state > EState.CalcResult) {
enabled = true; enabled = true;

View File

@ -1,5 +1,4 @@
using MU3.TestMode; using MU3.TestMode;
using MU3.Util;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;