Initial commit
This commit is contained in:
commit
ccbde43d83
5 changed files with 469 additions and 0 deletions
31
Plugin.cs
Normal file
31
Plugin.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using BepInEx;
|
||||
using HarmonyLib;
|
||||
using MyBox;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SaveOnQuit
|
||||
{
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded! Applying patch...");
|
||||
Harmony harmony = new Harmony("com.orpticon.SaveOnQuit");
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
public static class SaveOnQuitPatch
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(EscapeMenuManager), "Quit")]
|
||||
public static class EscapeMenuManager_Quit_Patch
|
||||
{
|
||||
public static void Prefix()
|
||||
{
|
||||
Singleton<SaveManager>.Instance.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue