forked from akanyan/mu3-mods
feat: rework reward skip; move it to SkipCutscenes
This commit is contained in:
@ -8,20 +8,11 @@ class patch_Scene_30_NoticeReward: Scene_30_NoticeReward {
|
|||||||
|
|
||||||
[MonoModIgnore]
|
[MonoModIgnore]
|
||||||
private enum State {
|
private enum State {
|
||||||
RankingReward = 2,
|
RankingReward = 2
|
||||||
FadeOut = 8,
|
|
||||||
}
|
}
|
||||||
private void Start() {
|
private void Start() {
|
||||||
using IniFile iniFile = new("mu3.ini");
|
|
||||||
|
|
||||||
var quickLogin = iniFile.getValue("Sequence", "QuickLogin", false);
|
|
||||||
|
|
||||||
_mode = new Mode<Scene_30_NoticeReward, State>(this);
|
_mode = new Mode<Scene_30_NoticeReward, State>(this);
|
||||||
if(quickLogin) {
|
_mode.set(State.RankingReward);
|
||||||
_mode.set(State.FadeOut);
|
SingletonMonoBehaviour<SystemUI>.instance.Panel.pushState(0, show: true);
|
||||||
} else {
|
|
||||||
_mode.set(State.RankingReward);
|
|
||||||
SingletonMonoBehaviour<SystemUI>.instance.Panel.pushState(0, show: true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
8
Extras/SkipCutscenes/MU3.Mod/State.cs
Normal file
8
Extras/SkipCutscenes/MU3.Mod/State.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
using MU3.Util;
|
||||||
|
|
||||||
|
namespace MU3.Mod;
|
||||||
|
|
||||||
|
class State: Singleton<State> {
|
||||||
|
public bool SkipItemFrame { get; set; }
|
||||||
|
public bool SkipEntry { get; set; }
|
||||||
|
}
|
@ -3,7 +3,6 @@ using MU3.Battle;
|
|||||||
using MU3.Data;
|
using MU3.Data;
|
||||||
using MU3.Game;
|
using MU3.Game;
|
||||||
using MU3.Util;
|
using MU3.Util;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace MU3.Sequence;
|
namespace MU3.Sequence;
|
||||||
|
|
||||||
@ -11,7 +10,6 @@ class patch_PlayMusic: PlayMusic {
|
|||||||
private GameEngine _gameEngine;
|
private GameEngine _gameEngine;
|
||||||
private SessionInfo _sessionInfo;
|
private SessionInfo _sessionInfo;
|
||||||
private bool _nuclearSkip = false;
|
private bool _nuclearSkip = false;
|
||||||
public static bool ForceSkipped { get; private set; }
|
|
||||||
|
|
||||||
[MonoModIgnore]
|
[MonoModIgnore]
|
||||||
private extern bool isPartyPlay();
|
private extern bool isPartyPlay();
|
||||||
@ -19,9 +17,9 @@ class patch_PlayMusic: PlayMusic {
|
|||||||
private extern void orig_Execute_StartCutscene();
|
private extern void orig_Execute_StartCutscene();
|
||||||
private void Execute_StartCutscene() {
|
private void Execute_StartCutscene() {
|
||||||
orig_Execute_StartCutscene();
|
orig_Execute_StartCutscene();
|
||||||
ForceSkipped = false;
|
Singleton<Mod.State>.instance.SkipEntry = false;
|
||||||
if(Singleton<Sys.System>.instance.config.isQuickStart || Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
if(Singleton<Sys.System>.instance.config.isQuickStart || Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||||
ForceSkipped = true;
|
Singleton<Mod.State>.instance.SkipEntry = true;
|
||||||
_gameEngine.skipStartCutscene();
|
_gameEngine.skipStartCutscene();
|
||||||
if(isPartyPlay()) {
|
if(isPartyPlay()) {
|
||||||
setNextState(EState.PartyWaitReady);
|
setNextState(EState.PartyWaitReady);
|
||||||
|
17
Extras/SkipCutscenes/MU3/patch_ANM_Frame.cs
Normal file
17
Extras/SkipCutscenes/MU3/patch_ANM_Frame.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using MU3.Util;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace MU3;
|
||||||
|
|
||||||
|
class patch_ANM_Frame: ANM_Frame {
|
||||||
|
private GameObject currentBonus;
|
||||||
|
|
||||||
|
public extern bool orig_isStampAnimEnd();
|
||||||
|
public new bool isStampAnimEnd() {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipItemFrame) {
|
||||||
|
return orig_isStampAnimEnd();
|
||||||
|
} else {
|
||||||
|
return currentBonus.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).normalizedTime > 0.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -25,7 +25,7 @@ class patch_BattleUI: BattleUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public new void playReady(Action onFinish) {
|
public new void playReady(Action onFinish) {
|
||||||
if(patch_PlayMusic.ForceSkipped) {
|
if(Singleton<Mod.State>.instance.SkipEntry) {
|
||||||
StartCoroutine(playReadyProcSkipped(onFinish));
|
StartCoroutine(playReadyProcSkipped(onFinish));
|
||||||
} else {
|
} else {
|
||||||
StartCoroutine(playReadyProc(onFinish));
|
StartCoroutine(playReadyProc(onFinish));
|
||||||
|
@ -12,17 +12,26 @@ class patch_DailyBonus: DailyBonus {
|
|||||||
|
|
||||||
private float waitCount;
|
private float waitCount;
|
||||||
private State _state;
|
private State _state;
|
||||||
|
|
||||||
private extern void orig_Update();
|
private extern void orig_Update();
|
||||||
private void Update() {
|
private void Update() {
|
||||||
if(_state < State.ItemWindow) {
|
if(_state < State.ItemWindow) {
|
||||||
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.Decision)) {
|
|
||||||
waitCount = 100.0f;
|
|
||||||
}
|
|
||||||
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
if(Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||||
waitCount = 100.0f;
|
waitCount = 100.0f;
|
||||||
_state = State.ExitWait;
|
Singleton<Mod.State>.instance.SkipItemFrame = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
orig_Update();
|
orig_Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extern void orig_onFinishDialog();
|
||||||
|
private void onFinishDialog() {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipItemFrame) {
|
||||||
|
orig_onFinishDialog();
|
||||||
|
} else {
|
||||||
|
_state = State.ExitWait;
|
||||||
|
waitCount = 100f;
|
||||||
|
Singleton<Mod.State>.instance.SkipItemFrame = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
27
Extras/SkipCutscenes/MU3/patch_UIGetItem.cs
Normal file
27
Extras/SkipCutscenes/MU3/patch_UIGetItem.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
using MU3.Util;
|
||||||
|
|
||||||
|
namespace MU3;
|
||||||
|
|
||||||
|
class patch_UIGetItem: UIGetItem {
|
||||||
|
private int state_;
|
||||||
|
private float time_;
|
||||||
|
|
||||||
|
public extern bool orig_isOutEnd();
|
||||||
|
public new bool isOutEnd() {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipItemFrame) {
|
||||||
|
return orig_isOutEnd();
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public extern void orig_start(Kind kind);
|
||||||
|
private void start(Kind kind) {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipItemFrame) {
|
||||||
|
orig_start(kind);
|
||||||
|
} else {
|
||||||
|
state_ = 3;
|
||||||
|
time_ = 100f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
Extras/SkipCutscenes/MU3/patch_UIPurchaseCardDialog.cs
Normal file
25
Extras/SkipCutscenes/MU3/patch_UIPurchaseCardDialog.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using MU3.Util;
|
||||||
|
using MU3.ViewData;
|
||||||
|
|
||||||
|
namespace MU3;
|
||||||
|
|
||||||
|
class patch_UIPurchaseCardDialog: UIPurchaseCardDialog {
|
||||||
|
private ChapterCardViewData cardViewData_;
|
||||||
|
private OnFinish onFinish_;
|
||||||
|
private int state_;
|
||||||
|
|
||||||
|
private extern void orig_Start();
|
||||||
|
private void Start() {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipItemFrame) {
|
||||||
|
orig_Start();
|
||||||
|
} else {
|
||||||
|
state_ = 5;
|
||||||
|
Destroy(gameObject, 0.1f);
|
||||||
|
gameObject.transform.SetParent(null);
|
||||||
|
if(onFinish_ != null) {
|
||||||
|
onFinish_(cardViewData_, 0);
|
||||||
|
onFinish_ = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user