Skip to content

Commit

Permalink
Start on save stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Aug 25, 2024
1 parent e5bd088 commit 9b55366
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Winch/Patches/SaveManagerPatcher.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using HarmonyLib;
using Winch.Core;

namespace Winch.Patches
{
[HarmonyPatch(typeof(SaveManager))]
internal static class SaveManagerPatcher
{
[HarmonyPrefix]
[HarmonyPatch(nameof(SaveManager.SaveGameFile))]
public static void SaveGameFile(SaveManager __instance, bool useBackupHistory)
{
WinchCore.Log.Debug($"SaveGameFile({useBackupHistory})");
}

[HarmonyPostfix]
[HarmonyPatch(nameof(SaveManager.Load))]
public static void Load(SaveManager __instance, int slot, ref bool __result)
{
WinchCore.Log.Debug($"Load({slot}) => {__result}");
}

[HarmonyPostfix]
[HarmonyPatch(nameof(SaveManager.CreateSaveData))]
public static void CreateSaveData(SaveManager __instance, int slot)
{
WinchCore.Log.Debug($"CreateSaveData({slot})");
}

[HarmonyPostfix]
[HarmonyPatch(nameof(SaveManager.DeleteSaveFile))]
public static void DeleteSaveFile(SaveManager __instance, int slot)
{
WinchCore.Log.Debug($"DeleteSaveFile({slot})");

}
}
}

0 comments on commit 9b55366

Please sign in to comment.