40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using BepInEx;
|
|
using BepInEx.Configuration;
|
|
using HarmonyLib;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace GlitchRestore;
|
|
|
|
[BepInPlugin("com.kobold60.extrasaves", "Extra Saves", "0.1.0")]
|
|
public class Plugin : BaseUnityPlugin {
|
|
private Harmony harmony = null!;
|
|
|
|
[HarmonyPatch(typeof(StartMenuLogic), "Start")]
|
|
internal static class ExtraSlots {
|
|
private static void Prefix(ref List<SaveSlotUIButton> ___saveButtuns) {
|
|
Console.WriteLine("Adjusting save slot count!");
|
|
if (___saveButtuns.Count < 6 && ___saveButtuns.Count > 0) {
|
|
SaveSlotUIButton newButton = new SaveSlotUIButton();
|
|
___saveButtuns.Add(new SaveSlotUIButton());
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Awake() {
|
|
Log.Init(Logger);
|
|
RCGLifeCycle.DontDestroyForever(gameObject);
|
|
|
|
// Load patches from any class annotated with @HarmonyPatch
|
|
harmony = Harmony.CreateAndPatchAll(typeof(Plugin).Assembly);
|
|
|
|
Logger.LogInfo($"Plugin com.kobold60.extrasaves is loaded!");
|
|
}
|
|
|
|
|
|
private void OnDestroy() {
|
|
// Make sure to clean up resources here to support hot reloading
|
|
|
|
harmony.UnpatchSelf();
|
|
}
|
|
} |