Added new patches
Adds a Quick Restart and Quick exit to Select Song patch as well as a patch to load saves offline. and of course, credit to Lukino for that offline saving patch.
This commit is contained in:
parent
e34d5e1836
commit
33306c9f5e
17
OfflineSaveLoad.cs
Normal file
17
OfflineSaveLoad.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace TaikoModStuff
|
||||||
|
{
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class OfflineSaveLoad
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(GameTitleManager), "Start")]
|
||||||
|
[HarmonyPostfix]
|
||||||
|
private static void BootManager_Postfix(GameTitleManager __instance)
|
||||||
|
{
|
||||||
|
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MyDataManager.PlayData.LoadData("x_game_save_default_container", "save_data_blob");
|
||||||
|
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MyDataManager.PlayData.LoadData("x_game_save_default_container", "system_data_blob");
|
||||||
|
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MySceneManager.ChangeScene("SongSelect", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
28
Plugin.cs
28
Plugin.cs
@ -18,6 +18,10 @@ namespace TaikoModStuff
|
|||||||
|
|
||||||
public static ConfigEntry<bool> configEnableRecording;
|
public static ConfigEntry<bool> configEnableRecording;
|
||||||
|
|
||||||
|
public static ConfigEntry<bool> configOfflineSaveLoad;
|
||||||
|
public static ConfigEntry<bool> configQuickRestart;
|
||||||
|
public static ConfigEntry<bool> configQuickQuitSong;
|
||||||
|
|
||||||
public override void Load()
|
public override void Load()
|
||||||
{
|
{
|
||||||
// Add configurations
|
// Add configurations
|
||||||
@ -51,6 +55,21 @@ namespace TaikoModStuff
|
|||||||
true,
|
true,
|
||||||
"Enables Game Recording from the Xbox Game Bar where it was previously disabled.");
|
"Enables Game Recording from the Xbox Game Bar where it was previously disabled.");
|
||||||
|
|
||||||
|
configOfflineSaveLoad = Config.Bind("General.Toggles",
|
||||||
|
"OfflineSaveLoad",
|
||||||
|
false,
|
||||||
|
"Loads local save files even when offline. Bypasses the log-in checks. Requires the FreeLocalSaves Plugin.\nEnabling this without FreeLocalSaves can and will wipe your save file.");
|
||||||
|
|
||||||
|
configQuickRestart = Config.Bind("General.Toggles",
|
||||||
|
"QuickRestart",
|
||||||
|
false,
|
||||||
|
"Hit \"Backspace\" on your keyboard to quickly restart a song.");
|
||||||
|
|
||||||
|
configQuickQuitSong = Config.Bind("General.Toggles",
|
||||||
|
"QuickQuitSong",
|
||||||
|
false,
|
||||||
|
"Hit \"Escape\" on your keyboard to quickly quit a song and return to Song Select.");
|
||||||
|
|
||||||
|
|
||||||
var instance = new Harmony(PluginInfo.PLUGIN_NAME);
|
var instance = new Harmony(PluginInfo.PLUGIN_NAME);
|
||||||
instance.PatchAll(typeof(FontChanger));
|
instance.PatchAll(typeof(FontChanger));
|
||||||
@ -58,6 +77,15 @@ namespace TaikoModStuff
|
|||||||
instance.PatchAll(typeof(ForceFramerate));
|
instance.PatchAll(typeof(ForceFramerate));
|
||||||
instance.PatchAll(typeof(RecordingEnable));
|
instance.PatchAll(typeof(RecordingEnable));
|
||||||
|
|
||||||
|
if (Plugin.configOfflineSaveLoad.Value)
|
||||||
|
instance.PatchAll(typeof(OfflineSaveLoad));
|
||||||
|
|
||||||
|
if (Plugin.configQuickRestart.Value)
|
||||||
|
instance.PatchAll(typeof(QuickRestart));
|
||||||
|
|
||||||
|
if (Plugin.configQuickQuitSong.Value)
|
||||||
|
instance.PatchAll(typeof(QuickQuitSong));
|
||||||
|
|
||||||
// Plugin startup logic
|
// Plugin startup logic
|
||||||
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
|
Log.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
|
||||||
}
|
}
|
||||||
|
22
QuickQuitSong.cs
Normal file
22
QuickQuitSong.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
using BepInEx;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace TaikoModStuff
|
||||||
|
{
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class QuickQuitSong
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(EnsoGameManager), "ProcExecPause")]
|
||||||
|
[HarmonyPrefix]
|
||||||
|
static void customProcExecPause()
|
||||||
|
{
|
||||||
|
bool keyDown = Input.GetKeyDown(KeyCode.Escape);
|
||||||
|
if (keyDown)
|
||||||
|
{
|
||||||
|
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MySceneManager.ChangeRelayScene("SongSelect", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
23
QuickRestart.cs
Normal file
23
QuickRestart.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
using BepInEx;
|
||||||
|
using HarmonyLib;
|
||||||
|
|
||||||
|
namespace TaikoModStuff
|
||||||
|
{
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class QuickRestart
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(EnsoGameManager), "ProcExecPause")]
|
||||||
|
[HarmonyPrefix]
|
||||||
|
static void customProcExecPause()
|
||||||
|
{
|
||||||
|
bool keyDown = Input.GetKeyDown(KeyCode.Backspace);
|
||||||
|
if (keyDown)
|
||||||
|
{
|
||||||
|
//TaikoSingletonMonoBehaviour<EnsoGameManager>.Instance.Invoke("RestartPlay", 1);
|
||||||
|
TaikoSingletonMonoBehaviour<CommonObjects>.Instance.MySceneManager.ChangeRelayScene("Enso", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user