1
0
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:
2023-11-07 00:21:09 +08:00
parent 5d58a2a8fa
commit 269f98c995
8 changed files with 331 additions and 74 deletions

View File

@@ -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)