1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 21:33:28 +08:00
This commit is contained in:
2024-09-18 01:41:08 +08:00
parent fb916b3813
commit bd512a6b78
17 changed files with 232 additions and 207 deletions

View File

@@ -7,19 +7,18 @@ using UXAssist.Common;
namespace UXAssist.Patches;
public static class DysonSpherePatch
public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
{
public static ConfigEntry<bool> StopEjectOnNodeCompleteEnabled;
public static ConfigEntry<bool> OnlyConstructNodesEnabled;
public static ConfigEntry<int> AutoConstructMultiplier;
private static Harmony _dysonSpherePatch;
private static FieldInfo _totalNodeSpInfo, _totalFrameSpInfo, _totalCpInfo;
public static void Init()
{
I18N.Add("[UXAssist] No node to fill", "[UXAssist] No node to fill", "[UXAssist] 无可建造节点");
_dysonSpherePatch ??= Harmony.CreateAndPatchAll(typeof(DysonSpherePatch));
Enable(true);
StopEjectOnNodeCompleteEnabled.SettingChanged += (_, _) => StopEjectOnNodeComplete.Enable(StopEjectOnNodeCompleteEnabled.Value);
OnlyConstructNodesEnabled.SettingChanged += (_, _) => OnlyConstructNodes.Enable(OnlyConstructNodesEnabled.Value);
StopEjectOnNodeComplete.Enable(StopEjectOnNodeCompleteEnabled.Value);
@@ -33,8 +32,7 @@ public static class DysonSpherePatch
{
StopEjectOnNodeComplete.Enable(false);
OnlyConstructNodes.Enable(false);
_dysonSpherePatch?.UnpatchSelf();
_dysonSpherePatch = null;
Enable(false);
}
public static void InitCurrentDysonSphere(int index)