mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 23:33:33 +08:00
Dustbin v1.3.0
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using HarmonyLib;
|
||||
using NebulaAPI;
|
||||
@@ -11,6 +10,20 @@ public static class TankPatch
|
||||
{
|
||||
private static UI.MyCheckBox _tankDustbinCheckBox;
|
||||
private static int _lastTankId;
|
||||
private static Harmony _patch;
|
||||
|
||||
public static void Enable(bool on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
_patch ??= Harmony.CreateAndPatchAll(typeof(TankPatch));
|
||||
}
|
||||
else
|
||||
{
|
||||
_patch?.UnpatchSelf();
|
||||
_patch = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Reset()
|
||||
{
|
||||
@@ -86,6 +99,13 @@ public static class TankPatch
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(GameMain), "Start")]
|
||||
private static void GameMain_Start_Prefix()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(UITankWindow), "_OnCreate")]
|
||||
private static void UITankWindow__OnCreate_Postfix(UITankWindow __instance)
|
||||
|
||||
Reference in New Issue
Block a user