fix(compat): support DSP 0.10.35.29057

Adapt UXAssist and CheatEnabler to the new terrain workflows, view modes, receiver inventory, and mineral-depletion API. Preserve crafting shortcuts, batch buyout visibility, soil progression, and saved brush safety.

Refresh game references and document compatibility changes. Release builds, static compatibility checks, behavior assertions, and diff checks pass; user testing is also confirmed.
This commit is contained in:
soarqin committed 2026-09-24 01:57:04 +08:00
1 parent 367a72b375
commit ac4210fe5d
15 files changed
+214 -131

No files matched your search

+3
View File
@@ -3,6 +3,9 @@
## Changlog
* Unreleased
* Support Dyson Sphere Program 0.10.35.29057. See [compatibility analysis](../docs/GameCompatibility-0.10.35.md).
* Update `Terraform anyway` for the separate foundation and Restore Terrain workflows. Preserve soil gains and prevent negative soil balances when resources are insufficient.
* 2.4.5
* New button `Generate illegal dyson shells for all layers without nodes and shells`, which is used to extend dyson layers.
* You must enable `IllegalDysonShellFunctionsEnabled` of `DysonSphere` section in config to see it.
+21 -16
View File
@@ -5,6 +5,7 @@ using BepInEx.Configuration;
using HarmonyLib;
using UXAssist.Common;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Patching;
namespace CheatEnabler.Patches;
@@ -151,30 +152,34 @@ public static class PlanetPatch
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Reform_ReformAction_Patch
// Target: BuildTool_Reform.ReformAction
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyPrefix]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.DoFlattenExecute))]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.DoRestoreExecute))]
private static void BuildTool_Reform_Execute_Prefix(BuildTool_Reform __instance, ref int needSandCount)
{
var sandCount = __instance.player.sandCount;
if (needSandCount > sandCount)
needSandCount = (int)sandCount;
}
// Harmony transpiler: BuildTool_Reform_DoFlattenExecute_Patch
// Target: BuildTool_Reform.DoFlattenExecute
// Fallback: TranspilerGuard returns original instructions when the foundation count check is not found.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))]
private static IEnumerable<CodeInstruction> BuildTool_Reform_ReformAction_Patch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.DoFlattenExecute))]
private static IEnumerable<CodeInstruction> BuildTool_Reform_DoFlattenExecute_Patch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
var matcher = new CodeMatcher(instructions, generator);
matcher.MatchForward(false,
new CodeMatch(OpCodes.Ldarg_0),
new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(BuildTool_Reform), nameof(BuildTool_Reform.cursorPointCount))),
new CodeMatch(ci => ci.opcode == OpCodes.Blt || ci.opcode == OpCodes.Blt_S)
).RemoveInstructions(2).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I4_0)
).MatchForward(false,
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Player), nameof(Player.sandCount)))
).Advance(1).MatchForward(false,
new CodeMatch(OpCodes.Conv_I8),
new CodeMatch(OpCodes.Sub)
).Advance(2).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I8, 0L),
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Max), [typeof(long), typeof(long)]))
);
if (matcher.IsInvalid)
return matcher.Finish(instructions, CheatEnabler.Logger, nameof(BuildTool_Reform_DoFlattenExecute_Patch));
var labels = matcher.Labels;
matcher.RemoveInstructions(2).Insert(new CodeInstruction(OpCodes.Ldc_I4_0).WithLabels(labels));
return matcher.InstructionEnumeration();
}
}
}
}