forked from akanyan/mu3-mods
feat(SkipCutscenes): autocontinue
Also fix the "continue?" screen
This commit is contained in:
@ -23,12 +23,15 @@ class patch_Scene_38_End: Scene_38_End {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extern void orig_End_Init();
|
||||||
private void End_Init() {
|
private void End_Init() {
|
||||||
|
if(!Singleton<Mod.State>.instance.SkipPlay) {
|
||||||
|
orig_End_Init();
|
||||||
|
} else {
|
||||||
SystemUI instance = SingletonMonoBehaviour<SystemUI>.instance;
|
SystemUI instance = SingletonMonoBehaviour<SystemUI>.instance;
|
||||||
instance.Panel.popState();
|
instance.Panel.popState();
|
||||||
if(!Singleton<Mod.State>.instance.SkipPlay) {
|
commonWindow_.transform.localScale = new UnityEngine.Vector3(0, 0, 0);
|
||||||
instance.fadeOut();
|
|
||||||
}
|
|
||||||
commonWindow_.end();
|
commonWindow_.end();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
36
Extras/SkipCutscenes/MU3/patch_Scene_38_End.cs
Normal file
36
Extras/SkipCutscenes/MU3/patch_Scene_38_End.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using MonoMod;
|
||||||
|
using MU3.Util;
|
||||||
|
|
||||||
|
namespace MU3;
|
||||||
|
|
||||||
|
class patch_Scene_38_End: Scene_38_End {
|
||||||
|
private Mode<Scene_38_End, State> mode_;
|
||||||
|
private int result_;
|
||||||
|
private UICommonWindow commonWindow_;
|
||||||
|
private UIContinueDialog uiContinueDialog_;
|
||||||
|
|
||||||
|
[MonoModIgnore]
|
||||||
|
private enum State {
|
||||||
|
SendResultContinue = 2,
|
||||||
|
End = 6
|
||||||
|
}
|
||||||
|
|
||||||
|
[MonoModIgnore]
|
||||||
|
private extern void destroy(int result);
|
||||||
|
|
||||||
|
private void Init_Term() {
|
||||||
|
using IniFile ini = new IniFile("mu3.ini");
|
||||||
|
if(ini.getValue("Sequence", "AutoContinue", false) && mode_.get() != (int)State.End) {
|
||||||
|
mode_.set(State.SendResultContinue);
|
||||||
|
commonWindow_.transform.localScale = new UnityEngine.Vector3(0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndContinue_Proc() {
|
||||||
|
if(commonWindow_ != null && commonWindow_.IsEnd) {
|
||||||
|
destroy(result_);
|
||||||
|
} else if(uiContinueDialog_ != null && uiContinueDialog_.IsEnd) {
|
||||||
|
destroy(result_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
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;
|
||||||
@ -45,6 +46,7 @@ class TestModePageModConfig: TestModePage {
|
|||||||
private List<Option> _options;
|
private List<Option> _options;
|
||||||
private Dictionary<string, string> _onOff;
|
private Dictionary<string, string> _onOff;
|
||||||
private bool _isDisableGPActive;
|
private bool _isDisableGPActive;
|
||||||
|
private bool _isSkipCutscenesActive;
|
||||||
private MethodInfo _writeToFile;
|
private MethodInfo _writeToFile;
|
||||||
|
|
||||||
protected new void Awake() {
|
protected new void Awake() {
|
||||||
@ -62,6 +64,7 @@ class TestModePageModConfig: TestModePage {
|
|||||||
{ "ON", "1" }
|
{ "ON", "1" }
|
||||||
};
|
};
|
||||||
_isDisableGPActive = typeof(UICredit).GetMethod("orig_initialize") != null;
|
_isDisableGPActive = typeof(UICredit).GetMethod("orig_initialize") != null;
|
||||||
|
_isSkipCutscenesActive = typeof(Notes.NotesManager).GetMethod("orig_reset") != null;
|
||||||
_writeToFile = typeof(IniFile).GetMethod("writeToFile", BindingFlags.Instance | BindingFlags.NonPublic);
|
_writeToFile = typeof(IniFile).GetMethod("writeToFile", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||||
|
|
||||||
writeOtherOptions();
|
writeOtherOptions();
|
||||||
@ -127,7 +130,16 @@ class TestModePageModConfig: TestModePage {
|
|||||||
"QuickStart",
|
"QuickStart",
|
||||||
_onOff,
|
_onOff,
|
||||||
0,
|
0,
|
||||||
typeof(Notes.NotesManager).GetMethod("orig_reset") != null,
|
_isSkipCutscenesActive,
|
||||||
|
"Sequence"
|
||||||
|
));
|
||||||
|
|
||||||
|
_options.Add(new Option(
|
||||||
|
"AUTOCONTINUE",
|
||||||
|
"AutoContinue",
|
||||||
|
_onOff,
|
||||||
|
0,
|
||||||
|
_isSkipCutscenesActive,
|
||||||
"Sequence"
|
"Sequence"
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user