From fddb2f53616c4018583c4338f7b9db2b651646c4 Mon Sep 17 00:00:00 2001
From: Lionmeow <49107380+Lionmeow@users.noreply.github.com>
Date: Sun, 8 Dec 2024 22:44:04 -0800
Subject: [PATCH] remove unnecessary patches
+ Trampoline patch removed as it's part of 0.6.6
+ Removed old unlock patches
---
AcceleratorThings/AcceleratorThings.csproj | 12 +--
AcceleratorThings/TrampolineErrorPatch.cs | 23 -----
.../UnlockAcceleratorsOnAcceleratorUnlock.cs | 24 -----
AcceleratorThings/UnlockPatches.cs | 96 -------------------
4 files changed, 1 insertion(+), 154 deletions(-)
delete mode 100644 AcceleratorThings/TrampolineErrorPatch.cs
delete mode 100644 AcceleratorThings/UnlockAcceleratorsOnAcceleratorUnlock.cs
delete mode 100644 AcceleratorThings/UnlockPatches.cs
diff --git a/AcceleratorThings/AcceleratorThings.csproj b/AcceleratorThings/AcceleratorThings.csproj
index b1de8bc..9522c46 100644
--- a/AcceleratorThings/AcceleratorThings.csproj
+++ b/AcceleratorThings/AcceleratorThings.csproj
@@ -3,14 +3,9 @@
net6.0
enable
- enable
+ disable
-
-
-
-
-
@@ -19,11 +14,6 @@
-
-
-
-
-
E:\Steam\steamapps\common\Slime Rancher 2\MelonLoader\net6\0Harmony.dll
diff --git a/AcceleratorThings/TrampolineErrorPatch.cs b/AcceleratorThings/TrampolineErrorPatch.cs
deleted file mode 100644
index f22919a..0000000
--- a/AcceleratorThings/TrampolineErrorPatch.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using HarmonyLib;
-using MelonLoader;
-using System.Linq;
-using System.Reflection;
-
-namespace MelonSRML.Patches
-{
- [HarmonyPatch]
- public static class Il2cppDetourMethodPatcherReportExceptionPatch
- {
- public static MethodInfo TargetMethod()
- {
- Assembly assembly = AccessTools.AllAssemblies().FirstOrDefault(x => x.GetName().Name.Equals("Il2CppInterop.HarmonySupport"));
- var Il2CppDetourMethodPatcher = assembly.GetTypes().FirstOrDefault(x => x.Name == "Il2CppDetourMethodPatcher");
- return AccessTools.Method(Il2CppDetourMethodPatcher, "ReportException");
- }
- public static bool Prefix(System.Exception ex)
- {
- MelonLogger.Error("During invoking native->managed trampoline", ex);
- return false;
- }
- }
-}
diff --git a/AcceleratorThings/UnlockAcceleratorsOnAcceleratorUnlock.cs b/AcceleratorThings/UnlockAcceleratorsOnAcceleratorUnlock.cs
deleted file mode 100644
index aad7e33..0000000
--- a/AcceleratorThings/UnlockAcceleratorsOnAcceleratorUnlock.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using HarmonyLib;
-using Il2Cpp;
-
-namespace AcceleratorThings
-{
- //[HarmonyPatch(typeof(GadgetDirector), "AddBlueprint")]
- internal static class UnlockAcceleratorsOnAcceleratorUnlock
- {
- public static void Postfix(GadgetDirector __instance, GadgetDefinition blueprint)
- {
- if (blueprint == SRLookup.Get("Accelerator"))
- {
- if (!__instance.HasBlueprint(EntryPoint.vacceleratorDef))
- __instance.AddBlueprint(EntryPoint.vacceleratorDef);
- if (!__instance.HasBlueprint(EntryPoint.triacceleratorDef))
- __instance.AddBlueprint(EntryPoint.triacceleratorDef);
- if (!__instance.HasBlueprint(EntryPoint.upcceleratorDef))
- __instance.AddBlueprint(EntryPoint.upcceleratorDef);
- if (!__instance.HasBlueprint(EntryPoint.accelefilterDef))
- __instance.AddBlueprint(EntryPoint.accelefilterDef);
- }
- }
- }
-}
diff --git a/AcceleratorThings/UnlockPatches.cs b/AcceleratorThings/UnlockPatches.cs
deleted file mode 100644
index 3fd1282..0000000
--- a/AcceleratorThings/UnlockPatches.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-using Il2Cpp;
-using Il2CppMonomiPark.SlimeRancher.DataModel;
-using Il2CppMonomiPark.SlimeRancher.Pedia;
-using Il2CppMonomiPark.SlimeRancher.UI.Loading;
-using Il2CppMonomiPark.SlimeRancher;
-using MelonLoader;
-using HarmonyLib;
-using UnityEngine;
-
-namespace AcceleratorThings
-{
- //[HarmonyPatch(typeof(SavedGame), "Push", new[] { typeof(GameModel) })]
- internal static class PediaSetModelPotentialUnlockPatch
- {
- public static bool shouldShowPopupVac = false;
- public static bool shouldShowPopupTri = false;
- public static bool shouldShowPopupFilter = false;
- public static bool shouldShowPopupUp = false;
-
- public static void Postfix()
- {
- SceneContext __instance = SceneContext.Instance;
- PediaModel model = __instance.PediaDirector._pediaModel;
-
- if (model == null || model.unlocked == null)
- return;
-
- if (__instance.GadgetDirector == null)
- return;
-
- if (model.unlocked.Contains(SRLookup.Get("Accelerator").PediaEntry))
- {
- GadgetDirector dir = __instance.GadgetDirector;
- if (!model.unlocked.Contains(EntryPoint.triacceleratorDef.PediaEntry))
- shouldShowPopupTri = true;
- if (!model.unlocked.Contains(EntryPoint.upcceleratorDef.PediaEntry))
- shouldShowPopupUp = true;
- if (!model.unlocked.Contains(EntryPoint.vacceleratorDef.PediaEntry))
- shouldShowPopupVac = true;
- if (!model.unlocked.Contains(EntryPoint.accelefilterDef.PediaEntry))
- shouldShowPopupFilter = true;
- }
- }
- }
-
- //[HarmonyPatch(typeof(LoadingScreenView), "Awake")]
- internal static class PopupDirectorPatch
- {
- public static void Postfix(LoadingScreenView __instance)
- {
- __instance.gameObject.AddComponent();
- }
- }
-
- [RegisterTypeInIl2Cpp]
- internal class EnqueuePopupOnLoading : SRBehaviour
- {
- public void OnDestroy()
- {
-
- if (SystemContext.Instance.SceneLoader.IsCurrentSceneGroupMainMenu())
- return;
- if (SceneContext.Instance == null)
- return;
-
- if (PediaSetModelPotentialUnlockPatch.shouldShowPopupVac)
- {
- SceneContext.Instance.PediaDirector.Unlock(EntryPoint.triacceleratorDef._pediaLink, false);
- if (SceneContext.Instance.GadgetDirector._model.blueprints.AddIfNotPresent(EntryPoint.triacceleratorDef))
- SceneContext.Instance.PediaDirector.ShowPopupIfUnlocked(EntryPoint.vacceleratorDef._pediaLink);
- PediaSetModelPotentialUnlockPatch.shouldShowPopupVac = false;
- }
- if (PediaSetModelPotentialUnlockPatch.shouldShowPopupTri)
- {
- SceneContext.Instance.PediaDirector.Unlock(EntryPoint.upcceleratorDef._pediaLink, false);
- if (SceneContext.Instance.GadgetDirector._model.blueprints.AddIfNotPresent(EntryPoint.upcceleratorDef))
- SceneContext.Instance.PediaDirector.ShowPopupIfUnlocked(EntryPoint.triacceleratorDef._pediaLink);
- PediaSetModelPotentialUnlockPatch.shouldShowPopupTri = false;
- }
- if (PediaSetModelPotentialUnlockPatch.shouldShowPopupUp)
- {
- SceneContext.Instance.PediaDirector.Unlock(EntryPoint.vacceleratorDef._pediaLink, false);
- if (SceneContext.Instance.GadgetDirector._model.blueprints.AddIfNotPresent(EntryPoint.vacceleratorDef))
- SceneContext.Instance.PediaDirector.ShowPopupIfUnlocked(EntryPoint.upcceleratorDef._pediaLink);
- PediaSetModelPotentialUnlockPatch.shouldShowPopupUp = false;
- }
- if (PediaSetModelPotentialUnlockPatch.shouldShowPopupFilter)
- {
- SceneContext.Instance.PediaDirector.Unlock(EntryPoint.accelefilterDef._pediaLink, false);
- if (SceneContext.Instance.GadgetDirector._model.blueprints.AddIfNotPresent(EntryPoint.accelefilterDef))
- SceneContext.Instance.PediaDirector.ShowPopupIfUnlocked(EntryPoint.accelefilterDef._pediaLink);
- PediaSetModelPotentialUnlockPatch.shouldShowPopupFilter = false;
- }
- }
- }
-}