forked from akanyan/mu3-mods
66 lines
2.0 KiB
C#
66 lines
2.0 KiB
C#
using MonoMod;
|
|
using MU3.Battle;
|
|
using MU3.Util;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace MU3.Sequence;
|
|
|
|
class patch_PlayMusic: PlayMusic {
|
|
private GameEngine _gameEngine;
|
|
private bool _quickStart = false;
|
|
|
|
[MonoModIgnore]
|
|
private extern bool isPartyPlay();
|
|
|
|
private void Leave_LoadScene() {
|
|
using IniFile iniFile = new("mu3.ini");
|
|
_quickStart = iniFile.getValue("Sequence", "QuickStart", false);
|
|
}
|
|
|
|
private extern void orig_Execute_StartCutscene();
|
|
private void Execute_StartCutscene() {
|
|
orig_Execute_StartCutscene();
|
|
|
|
Singleton<Mod.State>.instance.SkipEntry = false;
|
|
if(_quickStart || Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
|
Singleton<Mod.State>.instance.SkipEntry = true;
|
|
_gameEngine.skipStartCutscene();
|
|
if(isPartyPlay()) {
|
|
setNextState(EState.PartyWaitReady);
|
|
} else {
|
|
setNextState(EState.Countdown);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Leave_Play() {
|
|
if(!_gameEngine.sessionInfo.isTutorial) {
|
|
_gameEngine.StartCoroutine(nuclearSkip());
|
|
}
|
|
}
|
|
|
|
private IEnumerator nuclearSkip() {
|
|
bool enabled = false;
|
|
EState state;
|
|
while((state = getCurrentState()) < EState.End) {
|
|
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
|
if(!isPartyPlay() || state > EState.CalcResult) {
|
|
enabled = true;
|
|
}
|
|
}
|
|
if(enabled) {
|
|
Singleton<Mod.State>.instance.SkipItemFrame = true;
|
|
if(state < EState.CalcResult) {
|
|
setNextState(EState.CalcResult);
|
|
}
|
|
if(state > EState.ShowBonusStart) {
|
|
SingletonMonoBehaviour<SystemUI>.instance.destroySkipButton(true);
|
|
setNextState(EState.End);
|
|
yield break;
|
|
}
|
|
}
|
|
yield return new WaitForEndOfFrame();
|
|
}
|
|
}
|
|
} |