mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(compat): support DSP 0.10.35.29104
Refresh publicized game references by generated content and patch the new per-operation terraform brush clamps.
This commit is contained in:
1 parent
b08eaf13b7
commit
12467b9345
5 files changed
+76
-27
No files matched your search
@@ -4,6 +4,7 @@
|
||||
## Changlog
|
||||
|
||||
* 1.6.1
|
||||
* `Larger area for terraform`: Restore 11x11 through 30x30 foundation and Restore Terrain brushes after DSP 0.10.35.29104.
|
||||
* Fix the title-screen background turning black, even when the UXAssist window is closed.
|
||||
* `Planet vein utilization`: Move vein-group counts to the left of resource names to avoid overlapping the game's new buttons.
|
||||
* `Settings help`: Restore the game's native tips on question-mark buttons.
|
||||
@@ -422,6 +423,7 @@
|
||||
## 更新日志
|
||||
|
||||
* 1.6.1
|
||||
* `范围铺设地基的最大区域扩大`:适配 DSP 0.10.35.29104,恢复 11x11 至 30x30 的铺设地基与恢复地形范围。
|
||||
* 修复标题画面背景变黑的问题,包括关闭 UXAssist 窗口后背景仍不显示的情况。
|
||||
* `宇宙视图行星/星系矿脉数量显示`:将矿脉数量移至矿物名称左侧,避免与游戏新版按钮重叠。
|
||||
* `设置提示`:修复问号按钮的游戏内提示不显示的问题。
|
||||
|
||||
@@ -239,6 +239,27 @@ internal static class ArchitectModePatch
|
||||
Array.Resize(ref __instance.cursorIndices, MaxBrushSize * MaxBrushSize);
|
||||
}
|
||||
|
||||
// Harmony transpiler: BuildTool_Reform_PreparePoints_Transpiler
|
||||
// Target: BuildTool_Reform.PrepareFlattenPoints, BuildTool_Reform.PrepareRestorePoints
|
||||
// Fallback: TranspilerGuard returns original instructions when the operation-local brush limit is not found.
|
||||
[HarmonyTranspiler]
|
||||
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.PrepareFlattenPoints))]
|
||||
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.PrepareRestorePoints))]
|
||||
private static IEnumerable<CodeInstruction> BuildTool_Reform_PreparePoints_Transpiler(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.brushSize))),
|
||||
new CodeMatch(ci => ci.LoadsConstant(BuildTool_Reform.MAX_BRUSH_SIZE)),
|
||||
new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Min), [typeof(int), typeof(int)]))
|
||||
);
|
||||
if (matcher.IsInvalid)
|
||||
return matcher.Finish(instructions, UXAssist.Logger, nameof(BuildTool_Reform_PreparePoints_Transpiler));
|
||||
matcher.Advance(2).Set(OpCodes.Ldc_I4, MaxBrushSize);
|
||||
return matcher.InstructionEnumeration();
|
||||
}
|
||||
|
||||
// Harmony transpiler: BuildTool_Reform_ExecuteBrushAction_Transpiler
|
||||
// Target: BuildTool_Reform.ExecuteBrushAction
|
||||
// Fallback: TranspilerGuard returns original instructions when the brush limit is not found.
|
||||
|
||||
Reference in new issue
Block a user