refactor: remove single-owner helpers and redundant plumbing

Return feature-only helpers to their owners, remove inactive scaffolding and duplicate state, and reuse existing calculation and UI work without changing public contracts or gameplay.

Record repository-wide coverage, justified retentions, independent reviews and validation, including baseline dashboard fixture failures.

Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
soarqin committed 2026-11-04 23:06:50 +08:00
1 parent 64a23e9772
commit e35fba88ae
60 files changed
+1094 -994

No files matched your search

-25
View File
@@ -1,25 +0,0 @@
using HarmonyLib;
namespace MechaDronesTweaks;
class FastDronesRemover
{
public const string FastDronesGuid = "com.dkoppstein.plugin.DSP.FastDrones";
private const string FastDronesVersion = "0.0.5";
public static bool Run(Harmony harmony)
{
if (!BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(FastDronesGuid, out var pluginInfo) ||
pluginInfo.Metadata.Version.ToString() != FastDronesVersion) return false;
var assembly = pluginInfo.Instance.GetType().Assembly;
var classType = assembly.GetType("com.dkoppstein.plugin.DSP.FastDrones.FastDronesPlugin");
harmony.Patch(AccessTools.Method(classType, "Start"),
new HarmonyMethod(typeof(FastDronesRemover).GetMethod("PatchFastDronesStart")));
return true;
}
public static bool PatchFastDronesStart()
{
return false;
}
}
+11 -6
View File
@@ -9,9 +9,11 @@ using UnityEngine;
namespace MechaDronesTweaks;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency(FastDronesRemover.FastDronesGuid, BepInDependency.DependencyFlags.SoftDependency)]
[BepInDependency(FastDronesGuid, BepInDependency.DependencyFlags.SoftDependency)]
public class MechaDronesTweaksPlugin : BaseUnityPlugin
{
private const string FastDronesGuid = "com.dkoppstein.plugin.DSP.FastDrones";
public new static readonly BepInEx.Logging.ManualLogSource Logger =
BepInEx.Logging.Logger.CreateLogSource(PluginInfo.PLUGIN_NAME);
@@ -22,8 +24,13 @@ public class MechaDronesTweaksPlugin : BaseUnityPlugin
/* Remove FastDrones MOD if loaded */
try
{
if (FastDronesRemover.Run(_harmony))
if (BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(FastDronesGuid, out var pluginInfo) &&
pluginInfo.Metadata.Version.ToString() == "0.0.5")
{
var assembly = pluginInfo.Instance.GetType().Assembly;
var classType = assembly.GetType("com.dkoppstein.plugin.DSP.FastDrones.FastDronesPlugin");
_harmony.Patch(AccessTools.Method(classType, "Start"),
new HarmonyMethod(AccessTools.Method(typeof(MechaDronesTweaksPlugin), nameof(PatchFastDronesStart))));
Logger.LogInfo("Unpatch FastDrones - OK");
}
}
@@ -33,6 +40,8 @@ public class MechaDronesTweaksPlugin : BaseUnityPlugin
}
}
private static bool PatchFastDronesStart() => false;
public void Awake()
{
MechaDronesTweaks.UseFixedSpeed = Config.Bind("MechaDrones", "UseFixedSpeed", MechaDronesTweaks.UseFixedSpeed,
@@ -54,10 +63,6 @@ public class MechaDronesTweaksPlugin : BaseUnityPlugin
MechaDronesTweaks.EnergyMultiplier,
new ConfigDescription("Energy consumption multiplier for mecha drones",
new AcceptableValueRange<float>(0f, 1f))).Value;
MechaDronesTweaks.EnergyMultiplier = Config.Bind("MechaDrones", "EnergyMultiplier",
MechaDronesTweaks.EnergyMultiplier,
new ConfigDescription("Energy consumption multiplier for mecha drones",
new AcceptableValueRange<float>(0f, 1f))).Value;
_harmony.PatchAll(typeof(MechaDronesTweaks));
}