1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 14:53:30 +08:00

CheatEnabler v2.3.28

This commit is contained in:
2025-03-25 21:10:08 +08:00
parent c30758cfab
commit 5dba87dc7f
7 changed files with 29 additions and 2 deletions

View File

@@ -8,27 +8,41 @@ namespace CheatEnabler.Patches;
public static class PlayerPatch
{
public static ConfigEntry<bool> InstantHandCraftEnabled;
public static ConfigEntry<bool> InstantTeleportEnabled;
public static ConfigEntry<bool> WarpWithoutSpaceWarpersEnabled;
public static void Init()
{
InstantHandCraftEnabled.SettingChanged += (_, _) => InstantHandCraft.Enable(InstantHandCraftEnabled.Value);
InstantTeleportEnabled.SettingChanged += (_, _) => InstantTeleport.Enable(InstantTeleportEnabled.Value);
WarpWithoutSpaceWarpersEnabled.SettingChanged += (_, _) => WarpWithoutSpaceWarpers.Enable(WarpWithoutSpaceWarpersEnabled.Value);
}
public static void Start()
{
InstantHandCraft.Enable(InstantHandCraftEnabled.Value);
InstantTeleport.Enable(InstantTeleportEnabled.Value);
WarpWithoutSpaceWarpers.Enable(WarpWithoutSpaceWarpersEnabled.Value);
}
public static void Uninit()
{
InstantHandCraft.Enable(false);
InstantTeleport.Enable(false);
WarpWithoutSpaceWarpers.Enable(false);
}
private class InstantHandCraft: PatchImpl<InstantHandCraft>
{
[HarmonyPostfix]
[HarmonyPatch(typeof(ForgeTask), MethodType.Constructor, typeof(int), typeof(int))]
private static void ForgeTask_Ctor_Postfix(ForgeTask __instance)
{
__instance.tickSpend = 0;
}
}
private class InstantTeleport: PatchImpl<InstantTeleport>
{
[HarmonyTranspiler]