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:36 +02:00
parent 2ae4c98738
commit 6ae292d705
2 changed files with 23 additions and 5 deletions

View file

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