mu3-mods/SkipPreMusicRitual/MU3/patch_BattleUI.cs
2024-07-12 08:14:06 +09:00

35 lines
941 B
C#

using MonoMod;
using MU3.Sequence;
using MU3.Util;
using System;
using UnityEngine;
namespace MU3;
class patch_BattleUI: BattleUI {
[MonoModIgnore]
private extern System.Collections.IEnumerator playReadyProc(Action onFinish);
private System.Collections.IEnumerator playReadyProcSkipped(Action onFinish) {
if(!SystemUI.Exists) {
onFinish();
yield break;
}
SystemUI systemUI = SingletonMonoBehaviour<SystemUI>.instance;
float time = 1.5f;
while(0f < time) {
yield return null;
time -= Time.deltaTime;
}
onFinish();
systemUI.removeCanvas(Graphics.Const.SortOrder.UI);
}
public new void playReady(Action onFinish) {
if(patch_PlayMusic.ForceSkipped) {
StartCoroutine(playReadyProcSkipped(onFinish));
} else {
StartCoroutine(playReadyProc(onFinish));
}
}
}