mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
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:
1 parent
64a23e9772
commit
e35fba88ae
60 files changed
+1094
-994
No files matched your search
@@ -10,15 +10,6 @@ namespace UXAssist.Patches.Factory;
|
||||
|
||||
internal static class ArchitectModePatch
|
||||
{
|
||||
public static void Enable(bool enable)
|
||||
{
|
||||
UnlimitInteractive.Enable(enable);
|
||||
RemoveSomeConditionBuild.Enable(enable);
|
||||
RemoveBuildRangeLimit.Enable(enable);
|
||||
LargerAreaForUpgradeAndDismantle.Enable(enable);
|
||||
LargerAreaForTerraform.Enable(enable);
|
||||
}
|
||||
|
||||
internal class UnlimitInteractive : PatchImpl<UnlimitInteractive>
|
||||
{
|
||||
// Harmony transpiler: PlayerAction_Inspect_GetObjectSelectDistance_Transpiler
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using UXAssist.Common;
|
||||
@@ -14,11 +13,6 @@ namespace UXAssist.Patches.Factory;
|
||||
[ModFeature("BeltSignalsForBuyOut")]
|
||||
internal static class BeltSignalPatch
|
||||
{
|
||||
public static void Enable(bool enable)
|
||||
{
|
||||
BeltSignalsForBuyOut.Enable(enable);
|
||||
}
|
||||
|
||||
public static void InitPersist()
|
||||
{
|
||||
BeltSignalsForBuyOut.InitPersist();
|
||||
@@ -125,23 +119,6 @@ internal static class BeltSignalPatch
|
||||
_loaded = true;
|
||||
}
|
||||
|
||||
private static void RemoveBeltSignalProtos()
|
||||
{
|
||||
if (!_initialized || !_loaded) return;
|
||||
var signals = LDB._signals;
|
||||
if (signals.dataIndices.TryGetValue(301, out var index))
|
||||
{
|
||||
signals.dataArray = [.. signals.dataArray.Take(index), .. signals.dataArray.Skip(index + 6)];
|
||||
for (var id = 301; id <= 306; id++)
|
||||
signals.dataIndices.Remove(id);
|
||||
var len = signals.dataArray.Length;
|
||||
for (; index < len; index++)
|
||||
signals.dataIndices[signals.dataArray[index].ID] = index;
|
||||
}
|
||||
|
||||
_loaded = false;
|
||||
}
|
||||
|
||||
private static void InitSignalBelts()
|
||||
{
|
||||
if (!GameMain.isRunning) return;
|
||||
|
||||
@@ -79,8 +79,6 @@ internal static class BuildToolPatch
|
||||
|
||||
internal class OffGridBuilding : PatchImpl<OffGridBuilding>
|
||||
{
|
||||
// private const float SteppedRotationDegrees = 15f;
|
||||
|
||||
private static bool _initialized;
|
||||
|
||||
private static void SetupRichTextSupport()
|
||||
@@ -292,62 +290,6 @@ internal static class BuildToolPatch
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
|
||||
/*
|
||||
public static IEnumerable<CodeInstruction> PatchToPerformSteppedRotate(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
|
||||
{
|
||||
var matcher = new CodeMatcher(instructions, generator);
|
||||
|
||||
MatchIgnoreGridAndCheckIfRotatable(matcher, out var ifBlockEntryLabel, out var elseBlockEntryLabel);
|
||||
|
||||
if (matcher.IsInvalid)
|
||||
return instructions;
|
||||
|
||||
while (!matcher.Labels.Contains(elseBlockEntryLabel.Value))
|
||||
matcher.Advance(1);
|
||||
|
||||
Label? ifBlockExitLabel = null;
|
||||
|
||||
matcher.MatchBack(false, new CodeMatch(ci => ci.Branches(out ifBlockExitLabel)));
|
||||
|
||||
if (matcher.IsInvalid)
|
||||
return instructions;
|
||||
|
||||
while (!matcher.Labels.Contains(ifBlockEntryLabel.Value))
|
||||
matcher.Advance(-1);
|
||||
|
||||
var instructionToClone = matcher.Instruction.Clone();
|
||||
var overwriteWith = CodeInstruction.LoadField(typeof(VFInput), nameof(VFInput.control));
|
||||
|
||||
matcher.SetAndAdvance(overwriteWith.opcode, overwriteWith.operand);
|
||||
matcher.Insert(instructionToClone);
|
||||
matcher.CreateLabel(out var existingEntryLabel);
|
||||
matcher.InsertAndAdvance(
|
||||
new CodeInstruction(OpCodes.Brfalse, existingEntryLabel),
|
||||
new CodeInstruction(OpCodes.Ldarg_0),
|
||||
CodeInstruction.Call(typeof(OffGridBuilding), nameof(RotateStepped)),
|
||||
new CodeInstruction(OpCodes.Br, ifBlockExitLabel)
|
||||
);
|
||||
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
|
||||
public static void RotateStepped(BuildTool_Click instance)
|
||||
{
|
||||
if (VFInput._rotate.onDown)
|
||||
{
|
||||
instance.yaw += SteppedRotationDegrees;
|
||||
instance.yaw = Mathf.Repeat(instance.yaw, 360f);
|
||||
instance.yaw = Mathf.Round(instance.yaw / SteppedRotationDegrees) * SteppedRotationDegrees;
|
||||
}
|
||||
|
||||
if (VFInput._counterRotate.onDown)
|
||||
{
|
||||
instance.yaw -= SteppedRotationDegrees;
|
||||
instance.yaw = Mathf.Repeat(instance.yaw, 360f);
|
||||
instance.yaw = Mathf.Round(instance.yaw / SteppedRotationDegrees) * SteppedRotationDegrees;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
internal class TreatStackingAsSingle : PatchImpl<TreatStackingAsSingle>
|
||||
|
||||
@@ -8,11 +8,6 @@ namespace UXAssist.Patches.Factory;
|
||||
|
||||
internal static class BuildingBufferPatch
|
||||
{
|
||||
public static void Enable(bool enable)
|
||||
{
|
||||
TweakBuildingBuffer.Enable(enable);
|
||||
}
|
||||
|
||||
internal class TweakBuildingBuffer : PatchImpl<TweakBuildingBuffer>
|
||||
{
|
||||
public static void RefreshAssemblerBufferMultipliers()
|
||||
|
||||
@@ -10,11 +10,6 @@ namespace UXAssist.Patches.Factory;
|
||||
[ModFeature("VeinProtection")]
|
||||
internal static partial class VeinProtectionPatch
|
||||
{
|
||||
public static void Enable(bool enable)
|
||||
{
|
||||
ProtectVeinsFromExhaustion.Enable(enable);
|
||||
}
|
||||
|
||||
public static void InitConfig()
|
||||
{
|
||||
ProtectVeinsFromExhaustion.InitConfig();
|
||||
|
||||
Reference in new issue
Block a user