Update 1.1.0

The mod will now be disabled during the checkout tutorials, allowing them to be completed.
This commit is contained in:
pan.codes 2024-05-06 21:06:48 +02:00
parent a01828a080
commit f4a52f207a
2 changed files with 24 additions and 5 deletions

View file

@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>CardOnly</AssemblyName>
<Description>My first plugin</Description>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

View file

@ -1,18 +1,37 @@
using BepInEx;
using HarmonyLib;
using MyBox;
using System;
using UnityEngine;
namespace CardOnly
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInIncompatibility("CashOnly")]
public class Plugin : BaseUnityPlugin
{
bool patched = false;
Harmony harmony;
private void Awake()
{
// Plugin startup logic
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded! Applying patch...");
Harmony harmony = new Harmony("com.orpticon.CardOnly");
harmony.PatchAll();
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
harmony = new Harmony("com.orpticon.CardOnly");
}
private void Update()
{
if (Singleton<OnboardingManager>.Instance != null && Singleton<OnboardingManager>.Instance.Completed && !patched)
{
patched = true;
Logger.LogInfo("Patching...");
// Plugin startup logic
harmony.PatchAll();
}
if (Singleton<OnboardingManager>.Instance != null && !Singleton<OnboardingManager>.Instance.Completed && patched)
{
patched = false;
Logger.LogInfo("Unpatching...");
harmony.UnpatchSelf();
}
}
}
public static class PaymentFixerPatch