2023-06-09 20:44:28 -07:00
|
|
|
|
using HarmonyLib;
|
2023-06-09 23:54:55 -07:00
|
|
|
|
using UnityEngine;
|
2023-06-09 20:44:28 -07:00
|
|
|
|
|
2023-06-09 20:50:16 -07:00
|
|
|
|
namespace SteamRerouter.ModSide;
|
2023-06-09 20:44:28 -07:00
|
|
|
|
|
2023-06-09 22:47:31 -07:00
|
|
|
|
[HarmonyPatch]
|
2023-06-09 20:44:28 -07:00
|
|
|
|
public static class Patches
|
|
|
|
|
{
|
2023-06-09 22:47:31 -07:00
|
|
|
|
[HarmonyPrefix]
|
2023-06-09 23:54:55 -07:00
|
|
|
|
[HarmonyPatch(typeof(EntitlementsManager), nameof(EntitlementsManager.InitializeOnAwake))]
|
|
|
|
|
private static bool EntitlementsManager_InitializeOnAwake(EntitlementsManager __instance)
|
2023-06-09 20:44:28 -07:00
|
|
|
|
{
|
2023-06-09 23:54:55 -07:00
|
|
|
|
Object.Destroy(__instance);
|
2023-06-09 22:47:31 -07:00
|
|
|
|
return false;
|
2023-06-09 20:44:28 -07:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-09 23:54:55 -07:00
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(EntitlementsManager), nameof(EntitlementsManager.Start))]
|
|
|
|
|
private static bool EntitlementsManager_Start() => false;
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(EntitlementsManager), nameof(EntitlementsManager.OnDestroy))]
|
|
|
|
|
private static bool EntitlementsManager_OnDestroy() => false;
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(EntitlementsManager), nameof(EntitlementsManager.IsDlcOwned))]
|
|
|
|
|
private static bool EntitlementsManager_IsDlcOwned(out EntitlementsManager.AsyncOwnershipStatus __result)
|
|
|
|
|
{
|
|
|
|
|
__result = Interop.OwnershipStatus;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-06-09 22:47:31 -07:00
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(Achievements), nameof(Achievements.Earn))]
|
|
|
|
|
private static bool Achievements_Earn(Achievements.Type type)
|
2023-06-09 20:44:28 -07:00
|
|
|
|
{
|
2023-06-09 23:54:55 -07:00
|
|
|
|
Interop.EarnAchivement(type);
|
2023-06-09 22:47:31 -07:00
|
|
|
|
return false;
|
2023-06-09 20:44:28 -07:00
|
|
|
|
}
|
2023-06-09 22:47:31 -07:00
|
|
|
|
}
|