mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 14:53:30 +08:00
More works
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using UXAssist.Common;
|
||||
|
||||
namespace CheatEnabler;
|
||||
|
||||
@@ -113,9 +114,11 @@ public static class DysonSpherePatch
|
||||
UpdateSailLifeTime();
|
||||
UpdateSailsCacheForThisGame();
|
||||
_patch ??= Harmony.CreateAndPatchAll(typeof(SkipBulletPatch));
|
||||
GameLogic.OnGameEnd += GameMain_Begin_Postfix;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameLogic.OnGameEnd -= GameMain_Begin_Postfix;
|
||||
_patch?.UnpatchSelf();
|
||||
_patch = null;
|
||||
}
|
||||
@@ -151,8 +154,6 @@ public static class DysonSpherePatch
|
||||
_sailsCacheCapacity[index] = capacity;
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GameMain), nameof(GameMain.Begin))]
|
||||
private static void GameMain_Begin_Postfix()
|
||||
{
|
||||
UpdateSailsCacheForThisGame();
|
||||
|
||||
@@ -85,10 +85,12 @@ public static class FactoryPatch
|
||||
GreaterPowerUsageInLogistics.Enable(GreaterPowerUsageInLogisticsEnabled.Value);
|
||||
ControlPanelRemoteLogistics.Enable(ControlPanelRemoteLogisticsEnabled.Value);
|
||||
_factoryPatch = Harmony.CreateAndPatchAll(typeof(FactoryPatch));
|
||||
GameLogic.OnGameBegin += GameMain_Begin_Postfix_For_ImmBuild;
|
||||
}
|
||||
|
||||
public static void Uninit()
|
||||
{
|
||||
GameLogic.OnGameBegin -= GameMain_Begin_Postfix_For_ImmBuild;
|
||||
_factoryPatch?.UnpatchSelf();
|
||||
_factoryPatch = null;
|
||||
ImmediateBuild.Enable(false);
|
||||
@@ -173,8 +175,6 @@ public static class FactoryPatch
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GameMain), nameof(GameMain.Begin))]
|
||||
private static void GameMain_Begin_Postfix_For_ImmBuild()
|
||||
{
|
||||
var factory = GameMain.mainPlayer?.factory;
|
||||
@@ -492,8 +492,10 @@ public static class FactoryPatch
|
||||
{
|
||||
InitSignalBelts();
|
||||
_beltSignalPatch ??= Harmony.CreateAndPatchAll(typeof(BeltSignalGenerator));
|
||||
GameLogic.OnGameBegin += GameMain_Begin_Postfix;
|
||||
return;
|
||||
}
|
||||
GameLogic.OnGameBegin -= GameMain_Begin_Postfix;
|
||||
_beltSignalPatch?.UnpatchSelf();
|
||||
_beltSignalPatch = null;
|
||||
_initialized = false;
|
||||
@@ -726,8 +728,6 @@ public static class FactoryPatch
|
||||
set.Remove(v);
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(GameMain), nameof(GameMain.Begin))]
|
||||
private static void GameMain_Begin_Postfix()
|
||||
{
|
||||
if (BeltSignalGeneratorEnabled.Value) InitSignalBelts();
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
"description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测",
|
||||
"dependencies": [
|
||||
"xiaoye97-BepInEx-5.4.17",
|
||||
"soarqin-UXAssist-1.0.24"
|
||||
"soarqin-UXAssist-1.1.5"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user