refactor: phase 5 transpiler docs, mod-compat helpers, and build quality gates

This commit is contained in:
2026-06-23 23:03:13 +08:00
parent cca8b8594d
commit c2016909ff
43 changed files with 2327 additions and 135 deletions
@@ -0,0 +1,82 @@
using System;
using System.Reflection;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
namespace UXAssist.Common.ModCompat;
public static class ModCompatHelper
{
public static bool TryGetLoadedPluginInfo(string guid, out BepInEx.PluginInfo pluginInfo)
{
return Chainloader.PluginInfos.TryGetValue(guid, out pluginInfo) && pluginInfo != null;
}
public static bool TryGetPluginType(BepInEx.PluginInfo pluginInfo, string typeName, out Type type)
{
type = null;
if (pluginInfo?.Instance == null) return false;
try
{
type = pluginInfo.Instance.GetType().Assembly.GetType(typeName, throwOnError: false);
}
catch
{
// ignored
}
return type != null;
}
public static bool TryGetPluginType(string guid, string typeName, out Type type)
{
type = null;
return TryGetLoadedPluginInfo(guid, out var pluginInfo) && TryGetPluginType(pluginInfo, typeName, out type);
}
public static bool TryGetField(Type type, string fieldName, out FieldInfo field)
{
field = null;
if (type == null) return false;
field = AccessTools.Field(type, fieldName);
return field != null;
}
public static bool TryGetFieldValue<T>(Type type, string fieldName, object instance, out T value)
{
value = default;
if (!TryGetField(type, fieldName, out var field)) return false;
try
{
var result = field.GetValue(instance);
if (result is T t)
{
value = t;
return true;
}
}
catch
{
// ignored
}
return false;
}
public static bool TryGetMethod(Type type, string methodName, out MethodInfo method)
{
method = null;
if (type == null) return false;
method = AccessTools.Method(type, methodName);
return method != null;
}
public static bool TryGetPropertySetter(Type type, string propertyName, out MethodInfo setter)
{
setter = null;
if (type == null) return false;
var property = AccessTools.Property(type, propertyName);
if (property == null) return false;
setter = property.GetSetMethod(nonPublic: true);
return setter != null;
}
}
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using System.Reflection.Emit;
using BepInEx.Logging;
using HarmonyLib;
namespace UXAssist.Common.Patching;
/// <summary>
/// Helper for Harmony transpilers. Provides a standardized way to bail out and return the original
/// instructions when a <see cref="CodeMatcher"/> fails to match, which makes version-fragile patches
/// easier to diagnose at runtime.
/// </summary>
public static class TranspilerGuard
{
public static IEnumerable<CodeInstruction> Finish(
this CodeMatcher matcher,
IEnumerable<CodeInstruction> originalInstructions,
ManualLogSource logger,
string transpilerName)
{
if (matcher.IsInvalid)
{
logger?.LogWarning($"Transpiler '{transpilerName}' failed to match; returning original instructions.");
return originalInstructions;
}
return matcher.InstructionEnumeration();
}
}
@@ -0,0 +1,37 @@
using System.Reflection;
using HarmonyLib;
namespace UXAssist.Common.Utils;
public static class DysonSphereReflection
{
private static readonly FieldInfo TotalNodeSpField = AccessTools.Field(typeof(DysonSphereLayer), "totalNodeSP");
private static readonly FieldInfo TotalFrameSpField = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
private static readonly FieldInfo TotalCpField = AccessTools.Field(typeof(DysonSphereLayer), "totalCP");
public static bool IsAvailable => TotalNodeSpField != null && TotalFrameSpField != null && TotalCpField != null;
public static bool HasTotalNodeSP => TotalNodeSpField != null;
public static bool HasTotalFrameSP => TotalFrameSpField != null;
public static bool HasTotalCP => TotalCpField != null;
public static long? GetTotalNodeSP(DysonSphereLayer layer)
=> layer != null && TotalNodeSpField != null ? (long?)TotalNodeSpField.GetValue(layer) : null;
public static long? GetTotalFrameSP(DysonSphereLayer layer)
=> layer != null && TotalFrameSpField != null ? (long?)TotalFrameSpField.GetValue(layer) : null;
public static long? GetTotalCP(DysonSphereLayer layer)
=> layer != null && TotalCpField != null ? (long?)TotalCpField.GetValue(layer) : null;
public static void SetTotalNodeSP(DysonSphereLayer layer, long value)
=> TotalNodeSpField?.SetValue(layer, value);
public static void SetTotalFrameSP(DysonSphereLayer layer, long value)
=> TotalFrameSpField?.SetValue(layer, value);
public static void SetTotalCP(DysonSphereLayer layer, long value)
=> TotalCpField?.SetValue(layer, value);
}
+14 -13
View File
@@ -1,7 +1,7 @@
using System;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using HarmonyLib;
using UXAssist.Common.ModCompat;
using UXAssist.Patches;
namespace UXAssist.ModsCompat;
@@ -13,27 +13,28 @@ public static class AuxilaryfunctionWrapper
public static void Start(Harmony harmony)
{
if (!Chainloader.PluginInfos.TryGetValue(AuxilaryfunctionGuid, out var pluginInfo)) return;
var assembly = pluginInfo.Instance.GetType().Assembly;
try
if (!ModCompatHelper.TryGetLoadedPluginInfo(AuxilaryfunctionGuid, out var pluginInfo)) return;
if (!ModCompatHelper.TryGetPluginType(pluginInfo, "Auxilaryfunction.Auxilaryfunction", out var classType))
{
var classType = assembly.GetType("Auxilaryfunction.Auxilaryfunction");
ShowStationInfo = (ConfigEntry<bool>)AccessTools.Field(classType, "ShowStationInfo").GetValue(pluginInfo.Instance);
UXAssist.Logger.LogWarning("Failed to locate Auxilaryfunction main type");
return;
}
catch
if (!ModCompatHelper.TryGetFieldValue<ConfigEntry<bool>>(classType, "ShowStationInfo", pluginInfo.Instance, out ShowStationInfo))
{
UXAssist.Logger.LogWarning("Failed to get ShowStationInfo from Auxilaryfunction");
}
try
if (!ModCompatHelper.TryGetPluginType(pluginInfo, "Auxilaryfunction.Patch.SpeedUpPatch", out var speedUpPatchType))
{
var classType = assembly.GetType("Auxilaryfunction.Patch.SpeedUpPatch");
harmony.Patch(AccessTools.PropertySetter(classType, "Enable"),
new HarmonyMethod(AccessTools.Method(typeof(AuxilaryfunctionWrapper), nameof(PatchSpeedUpPatchEnable))));
UXAssist.Logger.LogWarning("Failed to locate Auxilaryfunction SpeedUpPatch");
return;
}
catch
if (!ModCompatHelper.TryGetPropertySetter(speedUpPatchType, "Enable", out var setter))
{
UXAssist.Logger.LogWarning("Failed to patch SpeedUpPatch.set_Enable() from Auxilaryfunction");
UXAssist.Logger.LogWarning("Failed to resolve SpeedUpPatch.set_Enable() from Auxilaryfunction");
return;
}
harmony.Patch(setter,
new HarmonyMethod(AccessTools.Method(typeof(AuxilaryfunctionWrapper), nameof(PatchSpeedUpPatchEnable))));
}
public static void PatchSpeedUpPatchEnable(bool value)
+7 -7
View File
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using UnityEngine;
using UXAssist.Common.ModCompat;
using UXAssist.Functions;
namespace UXAssist.ModsCompat;
@@ -17,13 +18,12 @@ class BlueprintTweaks
public static bool Run(Harmony harmony)
{
if (!BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(BlueprintTweaksGuid, out var pluginInfo)) return false;
var assembly = pluginInfo.Instance.GetType().Assembly;
var classTypeDragRemoveBuildTool = assembly.GetType("BlueprintTweaks.DragRemoveBuildTool");
if (classTypeDragRemoveBuildTool == null) return false;
if (AccessTools.Method(classTypeDragRemoveBuildTool, "DetermineMorePreviews") != null) return true;
classTypeBlueprintTweaksPlugin = assembly.GetType("BlueprintTweaks.BlueprintTweaksPlugin");
classTypeUIBuildingGridPatch2 = assembly.GetType("BlueprintTweaks.UIBuildingGridPatch2");
if (!ModCompatHelper.TryGetLoadedPluginInfo(BlueprintTweaksGuid, out var pluginInfo)) return false;
if (!ModCompatHelper.TryGetPluginType(pluginInfo, "BlueprintTweaks.DragRemoveBuildTool", out var classTypeDragRemoveBuildTool)) return false;
if (ModCompatHelper.TryGetMethod(classTypeDragRemoveBuildTool, "DetermineMorePreviews", out _)) return true;
ModCompatHelper.TryGetPluginType(pluginInfo, "BlueprintTweaks.BlueprintTweaksPlugin", out classTypeBlueprintTweaksPlugin);
ModCompatHelper.TryGetPluginType(pluginInfo, "BlueprintTweaks.UIBuildingGridPatch2", out classTypeUIBuildingGridPatch2);
if (classTypeBlueprintTweaksPlugin == null || classTypeUIBuildingGridPatch2 == null) return false;
var UIBuildingGrid_Update = AccessTools.Method(typeof(UIBuildingGrid), nameof(UIBuildingGrid.Update));
harmony.Patch(AccessTools.Method(classTypeUIBuildingGridPatch2, "UpdateGrid"), null, null, new HarmonyMethod(AccessTools.Method(typeof(BlueprintTweaks), nameof(PatchUpdateGrid))));
selectObjIdsField = AccessTools.Field(classTypeDragRemoveBuildTool, "selectObjIds");
+3 -3
View File
@@ -1,5 +1,5 @@
using BepInEx.Bootstrap;
using HarmonyLib;
using HarmonyLib;
using UXAssist.Common.ModCompat;
namespace UXAssist.ModsCompat;
@@ -10,6 +10,6 @@ public static class BulletTimeWrapper
public static void Start(Harmony _)
{
HasBulletTime = Chainloader.PluginInfos.TryGetValue(BulletTimeGuid, out var _);
HasBulletTime = ModCompatHelper.TryGetLoadedPluginInfo(BulletTimeGuid, out var _);
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
using BepInEx.Bootstrap;
using CommonAPI;
using HarmonyLib;
using UXAssist.Common.ModCompat;
namespace UXAssist.ModsCompat;
@@ -8,7 +8,7 @@ public static class CommonAPIWrapper
{
public static void Run(Harmony harmony)
{
if (!Chainloader.PluginInfos.TryGetValue(CommonAPIPlugin.GUID, out var commonAPIPlugin) ||
if (!ModCompatHelper.TryGetLoadedPluginInfo(CommonAPIPlugin.GUID, out var commonAPIPlugin) ||
commonAPIPlugin.Metadata.Version > new System.Version(1, 6, 7, 0)) return;
harmony.Patch(AccessTools.Method(typeof(GameOption), nameof(GameOption.InitKeys)), new HarmonyMethod(AccessTools.Method(typeof(CommonAPIWrapper), nameof(PatchInitKeys)), Priority.First));
}
+3 -3
View File
@@ -1,4 +1,5 @@
using HarmonyLib;
using UXAssist.Common.ModCompat;
namespace UXAssist.ModsCompat;
@@ -8,9 +9,8 @@ class PlanetVeinUtilization
public static bool Run(Harmony harmony)
{
if (!BepInEx.Bootstrap.Chainloader.PluginInfos.TryGetValue(PlanetVeinUtilizationGuid, out var pluginInfo)) return false;
var assembly = pluginInfo.Instance.GetType().Assembly;
var classType = assembly.GetType("PlanetVeinUtilization.PlanetVeinUtilization");
if (!ModCompatHelper.TryGetLoadedPluginInfo(PlanetVeinUtilizationGuid, out var pluginInfo)) return false;
if (!ModCompatHelper.TryGetPluginType(pluginInfo, "PlanetVeinUtilization.PlanetVeinUtilization", out var classType)) return false;
harmony.Patch(AccessTools.Method(classType, "Awake"),
new HarmonyMethod(typeof(PlanetVeinUtilization).GetMethod("PatchPlanetVeinUtilizationAwake")));
return true;
+31 -20
View File
@@ -1,10 +1,10 @@
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine.UI;
using UXAssist.Common;
using UXAssist.Common.Utils;
using GameLogicProc = UXAssist.Common.GameLogic;
namespace UXAssist.Patches;
@@ -15,16 +15,11 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
public static ConfigEntry<bool> OnlyConstructNodesEnabled;
public static ConfigEntry<int> AutoConstructMultiplier;
private static FieldInfo _totalNodeSpInfo, _totalFrameSpInfo, _totalCpInfo;
public static void Init()
{
Enable(true);
StopEjectOnNodeCompleteEnabled.SettingChanged += (_, _) => StopEjectOnNodeComplete.Enable(StopEjectOnNodeCompleteEnabled.Value);
OnlyConstructNodesEnabled.SettingChanged += (_, _) => OnlyConstructNodes.Enable(OnlyConstructNodesEnabled.Value);
_totalNodeSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalNodeSP");
_totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
_totalCpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalCP");
GameLogicProc.OnGameEnd += StopEjectOnNodeComplete.ResetState;
}
@@ -93,8 +88,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
}
// Make compatible with DSPOptimizations
if (_totalNodeSpInfo != null)
_totalNodeSpInfo.SetValue(dysonSphereLayer, (long)_totalNodeSpInfo.GetValue(dysonSphereLayer) + diff - 1);
var currentNodeSp = DysonSphereReflection.GetTotalNodeSP(dysonSphereLayer);
if (currentNodeSp.HasValue)
DysonSphereReflection.SetTotalNodeSP(dysonSphereLayer, currentNodeSp.Value + diff - 1);
__instance.UpdateProgress(dysonNode);
}
@@ -127,8 +123,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
}
// Make compatible with DSPOptimizations
if (_totalFrameSpInfo != null)
_totalFrameSpInfo.SetValue(dysonSphereLayer, (long)_totalFrameSpInfo.GetValue(dysonSphereLayer) + diff - 1);
var currentFrameSp = DysonSphereReflection.GetTotalFrameSP(dysonSphereLayer);
if (currentFrameSp.HasValue)
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, currentFrameSp.Value + diff - 1);
__instance.UpdateProgress(dysonFrame);
}
@@ -153,8 +150,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
}
// Make compatible with DSPOptimizations
if (_totalFrameSpInfo != null)
_totalFrameSpInfo.SetValue(dysonSphereLayer, (long)_totalFrameSpInfo.GetValue(dysonSphereLayer) + diff - 1);
var currentFrameSp2 = DysonSphereReflection.GetTotalFrameSP(dysonSphereLayer);
if (currentFrameSp2.HasValue)
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, currentFrameSp2.Value + diff - 1);
__instance.UpdateProgress(dysonFrame);
}
@@ -199,9 +197,10 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
dysonShell.nodecps[nodeIndex] += diff;
dysonShell.nodecps[dysonShell.nodecps.Length - 1] += diff;
// Make compatible with DSPOptimizations
if (_totalCpInfo != null)
var currentCp = DysonSphereReflection.GetTotalCP(dysonSphereLayer);
if (currentCp.HasValue)
{
_totalCpInfo.SetValue(dysonSphereLayer, (long)_totalCpInfo.GetValue(dysonSphereLayer) + diff);
DysonSphereReflection.SetTotalCP(dysonSphereLayer, currentCp.Value + diff);
dysonShell.SetMaterialDynamicVars();
}
shellIndex = (shellIndex + 1) % shellCount;
@@ -233,7 +232,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
return false;
}
// Harmony transpiler: DysonSpherePatch_DysonNode_ConstructCp_Transpiler
// Target: DysonNode.ConstructCp
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPriority(Priority.First)]
[HarmonyPatch(typeof(DysonNode), nameof(DysonNode.ConstructCp))]
@@ -390,7 +391,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
_nodeForAbsorb[starIndex].Clear();
_nodeForAbsorb[starIndex] = null;
}
// Harmony transpiler: EjectorComponent_InternalUpdate_Transpiler
// Target: EjectorComponent.InternalUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(EjectorComponent), nameof(EjectorComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> EjectorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -429,7 +432,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: DysonNode_ConstructSp_Transpiler
// Target: DysonNode.ConstructSp
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonNode), nameof(DysonNode.ConstructSp))]
private static IEnumerable<CodeInstruction> DysonNode_ConstructSp_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -446,7 +451,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: DysonNode_ConstructCp_Transpiler
// Target: DysonNode.ConstructCp
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonNode), nameof(DysonNode.ConstructCp))]
private static IEnumerable<CodeInstruction> DysonNode_ConstructCp_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -467,7 +474,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIEjectorWindow__OnUpdate_Transpiler
// Target: UIEjectorWindow._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIEjectorWindow), nameof(UIEjectorWindow._OnUpdate))]
static IEnumerable<CodeInstruction> UIEjectorWindow__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -527,7 +536,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
sphere.PickAutoNode();
}
}
// Harmony transpiler: DysonNode_spReqOrder_Getter_Transpiler
// Target: DysonNode.spReqOrder (getter)
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonNode), nameof(DysonNode.spReqOrder), MethodType.Getter)]
private static IEnumerable<CodeInstruction> DysonNode_spReqOrder_Getter_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+21 -3
View File
@@ -20,6 +20,9 @@ internal static class ArchitectModePatch
internal class UnlimitInteractive : PatchImpl<UnlimitInteractive>
{
// Harmony transpiler: PlayerAction_Inspect_GetObjectSelectDistance_Transpiler
// Target: PlayerAction_Inspect.GetObjectSelectDistance
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerAction_Inspect), nameof(PlayerAction_Inspect.GetObjectSelectDistance))]
private static IEnumerable<CodeInstruction> PlayerAction_Inspect_GetObjectSelectDistance_Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -31,6 +34,9 @@ internal static class ArchitectModePatch
internal class RemoveSomeConditionBuild : PatchImpl<RemoveSomeConditionBuild>
{
// Harmony transpiler: BuildTool_Click_CheckBuildConditions_Transpiler
// Target: BuildTool_BlueprintPaste.CheckBuildConditions, BuildTool_Click.CheckBuildConditions
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler, HarmonyPriority(Priority.First)]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
@@ -65,7 +71,9 @@ internal static class ArchitectModePatch
matcher.Opcode = OpCodes.Brfalse;
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Path_CheckBuildConditions_Transpiler
// Target: BuildTool_Path.CheckBuildConditions
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler, HarmonyPriority(Priority.First)]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.CheckBuildConditions))]
private static IEnumerable<CodeInstruction> BuildTool_Path_CheckBuildConditions_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -140,7 +148,9 @@ internal static class ArchitectModePatch
if (controller == null) return;
controller.actionBuild?.clickTool?._OnInit();
}
// Harmony transpiler: BuildTool_Click__OnInit_Transpiler
// Target: BuildTool_Click._OnInit
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click._OnInit))]
private static IEnumerable<CodeInstruction> BuildTool_Click__OnInit_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -152,7 +162,9 @@ internal static class ArchitectModePatch
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 512));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildAreaLimitRemoval_Transpiler
// Target: BuildTool_Addon.CheckBuildConditions, BuildTool_Click.CheckBuildConditions, BuildTool_Dismantle.DetermineMoreChainTargets, BuildTool_Dismantle.DeterminePreviews, BuildTool_Inserter.CheckBuildConditions, BuildTool_Path.CheckBuildConditions, BuildTool_Reform.ReformAction, BuildTool_Upgrade.DetermineMoreChainTargets, BuildTool_Upgrade.DeterminePreviews
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Addon), nameof(BuildTool_Addon.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
@@ -185,6 +197,9 @@ internal static class ArchitectModePatch
internal class LargerAreaForUpgradeAndDismantle : PatchImpl<LargerAreaForUpgradeAndDismantle>
{
// Harmony transpiler: BuildTools_CursorSizePatch_Transpiler
// Target: BuildTool_Dismantle.DeterminePreviews, BuildTool_Upgrade.DeterminePreviews
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Dismantle), nameof(BuildTool_Dismantle.DeterminePreviews))]
[HarmonyPatch(typeof(BuildTool_Upgrade), nameof(BuildTool_Upgrade.DeterminePreviews))]
@@ -201,6 +216,9 @@ internal static class ArchitectModePatch
internal class LargerAreaForTerraform : PatchImpl<LargerAreaForTerraform>
{
// Harmony transpiler: BuildTool_Reform_ReformAction_Transpiler
// Target: BuildTool_Reform.ReformAction
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))]
private static IEnumerable<CodeInstruction> BuildTool_Reform_ReformAction_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
+45 -13
View File
@@ -24,6 +24,9 @@ internal static class BuildToolPatch
private class BuildGizmoPatch : PatchImpl<BuildGizmoPatch>
{
// Harmony transpiler: ConnGizmoGraph_Constructor_Transpiler
// Target: ConnGizmoGraph..ctor
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(ConnGizmoGraph), MethodType.Constructor)]
private static IEnumerable<CodeInstruction> ConnGizmoGraph_Constructor_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -35,7 +38,9 @@ internal static class BuildToolPatch
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 2048));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: ConnGizmoGraph_SetPointCount_Transpiler
// Target: ConnGizmoGraph.SetPointCount
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(ConnGizmoGraph), nameof(ConnGizmoGraph.SetPointCount))]
private static IEnumerable<CodeInstruction> ConnGizmoGraph_SetPointCount_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -47,7 +52,9 @@ internal static class BuildToolPatch
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 2048));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Path__OnInit_Transpiler
// Target: BuildTool_Path._OnInit
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path._OnInit))]
private static IEnumerable<CodeInstruction> BuildTool_Path__OnInit_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -59,7 +66,9 @@ internal static class BuildToolPatch
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 2048));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Reform_Constructor_Transpiler
// Target: BuildTool_Reform..ctor
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Reform), MethodType.Constructor)]
private static IEnumerable<CodeInstruction> BuildTool_Reform_Constructor_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
@@ -133,7 +142,9 @@ internal static class BuildToolPatch
__instance.actionBuild.model.cursorText = $"({_lastOffsetText})\n" + __instance.actionBuild.model.cursorText;
}
// Harmony transpiler: UIEntityBriefInfo__OnUpdate_Transpiler
// Target: UIEntityBriefInfo._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIEntityBriefInfo), nameof(UIEntityBriefInfo._OnUpdate))]
private static IEnumerable<CodeInstruction> UIEntityBriefInfo__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -188,7 +199,9 @@ internal static class BuildToolPatch
ifBlockEntryLabel = thisIfBlockEntryLabel;
elseBlockEntryLabel = thisElseBlockEntryLabel;
}
// Harmony transpiler: AllowOffGridConstruction
// Target: BuildTool_Click.UpdateRaycast, BuildTool_Click.DeterminePreviews
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.UpdateRaycast))]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.DeterminePreviews))]
@@ -206,7 +219,9 @@ internal static class BuildToolPatch
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PreventDraggingWhenOffGrid
// Target: BuildTool_Click.DeterminePreviews
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.DeterminePreviews))]
public static IEnumerable<CodeInstruction> PreventDraggingWhenOffGrid(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -233,7 +248,9 @@ internal static class BuildToolPatch
return matcher.InstructionEnumeration();
}
// Harmony transpiler: AllowOffGridConstructionForPath
// Target: BuildTool_Path.UpdateRaycast
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Path), nameof(BuildTool_Path.UpdateRaycast))]
public static IEnumerable<CodeInstruction> AllowOffGridConstructionForPath(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -339,6 +356,9 @@ internal static class BuildToolPatch
internal class TreatStackingAsSingle : PatchImpl<TreatStackingAsSingle>
{
// Harmony transpiler: MonitorComponent_InternalUpdate_Transpiler
// Target: MonitorComponent.InternalUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(MonitorComponent), nameof(MonitorComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> MonitorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -491,7 +511,9 @@ internal static class BuildToolPatch
return num;
}
// Harmony transpiler: BuildTool_Click_DeterminePreviews_Transpiler
// Target: BuildTool_Click.DeterminePreviews
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.DeterminePreviews))]
private static IEnumerable<CodeInstruction> BuildTool_Click_DeterminePreviews_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -580,7 +602,9 @@ internal static class BuildToolPatch
new(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Min), [typeof(int), typeof(int)]))
];
private static readonly CodeInstruction GetRealCount = new(OpCodes.Ldsfld, AccessTools.Field(typeof(FactoryPatch), nameof(FactoryPatch._tankFastFillInAndTakeOutMultiplierRealValue)));
// Harmony transpiler: PlanetFactory_EntityFastFillIn_Transpiler
// Target: PlanetFactory.EntityFastFillIn
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.EntityFastFillIn))]
private static IEnumerable<CodeInstruction> PlanetFactory_EntityFastFillIn_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -600,7 +624,9 @@ internal static class BuildToolPatch
).RemoveInstructions(5).Insert(MultiplierWithCountCheck);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PlanetFactory_EntityFastTakeOut_Transpiler
// Target: PlanetFactory.EntityFastTakeOut
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.EntityFastTakeOut))]
private static IEnumerable<CodeInstruction> PlanetFactory_EntityFastTakeOut_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -621,7 +647,9 @@ internal static class BuildToolPatch
).RemoveInstructions(5).Insert(MultiplierWithCountCheck);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UITankWindow__OnUpdate_Transpiler
// Target: UITankWindow._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UITankWindow), nameof(UITankWindow._OnUpdate))]
private static IEnumerable<CodeInstruction> UITankWindow__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -694,7 +722,9 @@ internal static class BuildToolPatch
{
nextTimei = 0;
}
// Harmony transpiler: VFInput_fastTransferWithEntityDown_Transpiler
// Target: VFInput._fastTransferWithEntityDown (getter), VFInput._fastTransferWithEntityPress (getter)
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(VFInput), nameof(VFInput._fastTransferWithEntityDown), MethodType.Getter)]
[HarmonyPatch(typeof(VFInput), nameof(VFInput._fastTransferWithEntityPress), MethodType.Getter)]
@@ -710,7 +740,9 @@ internal static class BuildToolPatch
matcher.Labels.AddRange(lables);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PlayerAction_Inspect_GameTick_Transpiler
// Target: PlayerAction_Inspect.GameTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerAction_Inspect), nameof(PlayerAction_Inspect.GameTick))]
private static IEnumerable<CodeInstruction> PlayerAction_Inspect_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -67,7 +67,9 @@ internal static class BuildingBufferPatch
patch.Unpatch(AccessTools.Method(typeof(SiloComponent), nameof(SiloComponent.InternalUpdate)), AccessTools.Method(typeof(TweakBuildingBuffer), nameof(SiloComponent_InternalUpdate_Transpiler)));
patch.Patch(AccessTools.Method(typeof(SiloComponent), nameof(SiloComponent.InternalUpdate)), null, null, new HarmonyMethod(typeof(TweakBuildingBuffer), nameof(SiloComponent_InternalUpdate_Transpiler)));
}
// Harmony transpiler: PowerGeneratorComponent_GameTick_Gamma_Transpiler
// Target: PowerGeneratorComponent.GameTick_Gamma
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.GameTick_Gamma))]
private static IEnumerable<CodeInstruction> PowerGeneratorComponent_GameTick_Gamma_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -89,7 +91,9 @@ internal static class BuildingBufferPatch
matcher.Advance(2).RemoveInstructions(2).Insert(new CodeInstruction(OpCodes.Ldc_I4, FactoryPatch.ReceiverBufferCount.Value * 3600));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: AssemblerComponent_UpdateNeeds_Transpiler
// Target: AssemblerComponent.UpdateNeeds
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(AssemblerComponent), nameof(AssemblerComponent.UpdateNeeds))]
private static IEnumerable<CodeInstruction> AssemblerComponent_UpdateNeeds_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -125,7 +129,9 @@ internal static class BuildingBufferPatch
matcher.Advance(2).Operand = FactoryPatch.AssemblerBufferMininumMultiplier.Value;
return matcher.InstructionEnumeration();
}
// Harmony transpiler: LabComponent_UpdateNeedsAssemble_Transpiler
// Target: LabComponent.UpdateNeedsAssemble
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(LabComponent), nameof(LabComponent.UpdateNeedsAssemble))]
private static IEnumerable<CodeInstruction> LabComponent_UpdateNeedsAssemble_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -163,7 +169,9 @@ internal static class BuildingBufferPatch
matcher.Advance(2).SetAndAdvance(OpCodes.Ldc_I4, maxCount);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: LabComponent_UpdateNeedsResearch_Transpiler
// Target: LabComponent.UpdateNeedsResearch
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(LabComponent), nameof(LabComponent.UpdateNeedsResearch))]
private static IEnumerable<CodeInstruction> LabComponent_UpdateNeedsResearch_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -183,7 +191,9 @@ internal static class BuildingBufferPatch
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, FactoryPatch.LabBufferMaxCountForResearch.Value * 3600));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: EjectorComponent_InternalUpdate_Transpiler
// Target: EjectorComponent.InternalUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(EjectorComponent), nameof(EjectorComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> EjectorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -197,7 +207,9 @@ internal static class BuildingBufferPatch
matcher.Advance(2).Set(OpCodes.Ldc_I4, FactoryPatch.EjectorBufferCount.Value);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: SiloComponent_InternalUpdate_Transpiler
// Target: SiloComponent.InternalUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(SiloComponent), nameof(SiloComponent.InternalUpdate))]
private static IEnumerable<CodeInstruction> SiloComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -212,7 +212,9 @@ internal static class ImmediateBuildPatch
currLevel++;
}
}
// Harmony transpiler: BuildTool_Dismantle_DeterminePreviews_Transpiler
// Target: BuildTool_Dismantle.DeterminePreviews
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Dismantle), nameof(BuildTool_Dismantle.DeterminePreviews))]
private static IEnumerable<CodeInstruction> BuildTool_Dismantle_DeterminePreviews_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -233,7 +235,9 @@ internal static class ImmediateBuildPatch
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Click__OnTick_Transpiler
// Target: BuildTool_Click._OnTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click._OnTick))]
private static IEnumerable<CodeInstruction> BuildTool_Click__OnTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+9 -3
View File
@@ -40,7 +40,9 @@ internal static class RenderingPatch
{
__instance.renderEntity = true;
}
// Harmony transpiler: RaycastLogic_GameTick_Transpiler
// Target: RaycastLogic.GameTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(RaycastLogic), nameof(RaycastLogic.GameTick))]
private static IEnumerable<CodeInstruction> RaycastLogic_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -156,7 +158,9 @@ internal static class RenderingPatch
_sunlight = GameMain.universeSimulator?.LocalStarSimulator()?.sunLight;
}
}
// Harmony transpiler: StarSimulator_LateUpdate_Transpiler
// Target: StarSimulator.LateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(StarSimulator), nameof(StarSimulator.LateUpdate))]
private static IEnumerable<CodeInstruction> StarSimulator_LateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -182,7 +186,9 @@ internal static class RenderingPatch
).Advance(1).Labels.Add(label2);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PlanetSimulator_LateRefresh_Transpiler
// Target: PlanetSimulator.LateRefresh
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlanetSimulator), nameof(PlanetSimulator.LateRefresh))]
private static IEnumerable<CodeInstruction> PlanetSimulator_LateRefresh_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+9 -3
View File
@@ -413,7 +413,9 @@ public class GamePatch : PatchImpl<GamePatch>
entry.indexText.text = (i + 1).ToString();
}
}
// Harmony transpiler: UILoadGameWindow_ReplaceSaveName_Transpiler
// Target: UILoadGameWindow.DoLoadSelectedGame, UILoadGameWindow.OnSelectedChange
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UILoadGameWindow), nameof(UILoadGameWindow.DoLoadSelectedGame))]
[HarmonyPatch(typeof(UILoadGameWindow), nameof(UILoadGameWindow.OnSelectedChange))]
@@ -426,7 +428,9 @@ public class GamePatch : PatchImpl<GamePatch>
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldfld, AccessTools.Field(typeof(UIGameSaveEntry), nameof(UIGameSaveEntry._saveName))));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: GameSave_RemoveValidateOnLoad_Transpiler
// Target: GameSave.LoadCurrentGame, GameSave.LoadGameDesc, GameSave.ReadHeader, GameSave.ReadHeaderAndDescAndProperty, GameSave.SaveExist, GameSave.SavePath
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(GameSave), nameof(GameSave.LoadCurrentGame))]
[HarmonyPatch(typeof(GameSave), nameof(GameSave.LoadGameDesc))]
@@ -469,7 +473,9 @@ public class GamePatch : PatchImpl<GamePatch>
__instance.combatSettings = UIRoot.instance.galaxySelect.uiCombat.combatSettings;
}
}
// Harmony transpiler: GameData_Import_Transpiler
// Target: GameData.Import
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(GameData), nameof(GameData.Import))]
private static IEnumerable<CodeInstruction> GameData_Import_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -28,6 +28,9 @@ internal class AutoConfigLogistics : PatchImpl<AutoConfigLogistics>
private class LimitAutoReplenishCount : PatchImpl<LimitAutoReplenishCount>
{
// Harmony transpiler: PlanetFactory_StationAutoReplenishIfNeeded_Transpiler
// Target: PlanetFactory.EntityAutoReplenishIfNeeded, PlanetFactory.StationAutoReplenishIfNeeded
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.EntityAutoReplenishIfNeeded))]
[HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.StationAutoReplenishIfNeeded))]
@@ -116,6 +119,9 @@ internal class AutoConfigLogistics : PatchImpl<AutoConfigLogistics>
internal class AutoConfigLogisticsSetDefaultRemoteLogicToStorage : PatchImpl<AutoConfigLogisticsSetDefaultRemoteLogicToStorage>
{
// Harmony transpiler: UIStationStorage_OnItemPickerReturn_Transpiler
// Target: UIControlPanelStationStorage.OnItemPickerReturn, UIStationStorage.OnItemPickerReturn
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemPickerReturn))]
[HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnItemPickerReturn))]
+9 -3
View File
@@ -286,7 +286,9 @@ internal class GreaterPowerUsageInLogistics : PatchImpl<GreaterPowerUsageInLogis
window._Close();
window.maxMiningSpeedSlider.maxValue = LogisticsConstants.MiningSpeedSliderMaxDefault;
}
// Harmony transpiler: UIStationWindow_OnStationIdChange_Transpiler
// Target: UIStationWindow.OnStationIdChange
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStationWindow), nameof(UIStationWindow.OnStationIdChange))]
private static IEnumerable<CodeInstruction> UIStationWindow_OnStationIdChange_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -356,7 +358,9 @@ internal class GreaterPowerUsageInLogistics : PatchImpl<GreaterPowerUsageInLogis
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIStationWindow_OnMaxMiningSpeedChange_Transpiler
// Target: UIStationWindow.OnMaxMiningSpeedChange
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStationWindow), nameof(UIStationWindow.OnMaxMiningSpeedChange))]
private static IEnumerable<CodeInstruction> UIStationWindow_OnMaxMiningSpeedChange_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -386,7 +390,9 @@ internal class GreaterPowerUsageInLogistics : PatchImpl<GreaterPowerUsageInLogis
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIStationWindow_OnMaxChargePowerSliderValueChange_Transpiler
// Target: UIStationWindow.OnMaxChargePowerSliderValueChange
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStationWindow), nameof(UIStationWindow.OnMaxChargePowerSliderValueChange))]
private static IEnumerable<CodeInstruction> UIStationWindow_OnMaxChargePowerSliderValueChange_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -11,6 +11,9 @@ internal class AllowOverflowInLogistics : PatchImpl<AllowOverflowInLogistics>
private static bool _blueprintPasting;
// Do not check for overflow when try to send hand items into storages
// Harmony transpiler: UIStationStorage_OnItemIconMouseDown_Transpiler
// Target: UIControlPanelStationStorage.OnItemIconMouseDown, UIStationStorage.OnItemIconMouseDown
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemIconMouseDown))]
[HarmonyPatch(typeof(UIStationStorage), nameof(UIStationStorage.OnItemIconMouseDown))]
@@ -39,6 +42,9 @@ internal class AllowOverflowInLogistics : PatchImpl<AllowOverflowInLogistics>
}
// Remove storage limit check
// Harmony transpiler: PlanetTransport_SetStationStorage_Transpiler
// Target: PlanetTransport.SetStationStorage
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlanetTransport), nameof(PlanetTransport.SetStationStorage))]
private static IEnumerable<CodeInstruction> PlanetTransport_SetStationStorage_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -87,7 +87,9 @@ internal class LogisticsConstrolPanelImprovement : PatchImpl<LogisticsConstrolPa
filterPanel.SetNewFilter(filter);
return true;
}
// Harmony transpiler: UIGame_On_I_Switch_Transpiler
// Target: UIGame.On_I_Switch
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIGame), nameof(UIGame.On_I_Switch))]
private static IEnumerable<CodeInstruction> UIGame_On_I_Switch_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+33 -2
View File
@@ -21,6 +21,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Check for noModifier while pressing hotkeys on build bar
// Harmony transpiler: UIBuildMenu__OnUpdate_Transpiler
// Target: UIBuildMenu._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIBuildMenu), nameof(UIBuildMenu._OnUpdate))]
private static IEnumerable<CodeInstruction> UIBuildMenu__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -41,6 +44,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Bring popup tip window to top layer
// Harmony transpiler: UIButton_LateUpdate_Transpiler
// Target: UIButton.LateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIButton), nameof(UIButton.LateUpdate))]
private static IEnumerable<CodeInstruction> UIButton_LateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -65,6 +71,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Sort blueprint data when pasting
// Harmony transpiler: BuildTool_BlueprintCopy_UseToPasteNow_Transpiler
// Target: BuildTool_BlueprintCopy.UseToPasteNow
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_BlueprintCopy), nameof(BuildTool_BlueprintCopy.UseToPasteNow))]
private static IEnumerable<CodeInstruction> BuildTool_BlueprintCopy_UseToPasteNow_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -91,6 +100,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Increase maximum value of property realizing, 2000 -> 20000
// Harmony transpiler: UIProductEntry_UpdateUIElements_Transpiler
// Target: UIPropertyEntry.UpdateUIElements, UIPropertyEntry.OnRealizeButtonClick, UIPropertyEntry.OnInputValueEnd
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.UpdateUIElements))]
[HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.OnRealizeButtonClick))]
@@ -104,7 +116,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
matcher.Repeat(m => { m.SetAndAdvance(OpCodes.Ldc_I4, 20000); });
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIProductEntry_OnInputValueEnd_Transpiler
// Target: UIPropertyEntry.OnInputValueEnd
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.OnInputValueEnd))]
private static IEnumerable<CodeInstruction> UIProductEntry_OnInputValueEnd_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -118,6 +132,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Increase capacity of player order queue, 16 -> 128
// Harmony transpiler: PlayerOrder_Constructor_Transpiler
// Target: PlayerOrder..ctor
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerOrder), MethodType.Constructor, typeof(Player))]
private static IEnumerable<CodeInstruction> PlayerOrder_Constructor_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -131,6 +148,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Increase Player Command Queue from 16 to 128
// Harmony transpiler: PlayerOrder_ExtendCount_Transpiler
// Target: PlayerOrder._trimEnd, PlayerOrder.Enqueue
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerOrder), nameof(PlayerOrder._trimEnd))]
[HarmonyPatch(typeof(PlayerOrder), nameof(PlayerOrder.Enqueue))]
@@ -145,6 +165,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Allow F11 in star map
// Harmony transpiler: UIGame__OnLateUpdate_Transpiler
// Target: UIGame._OnLateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIGame), nameof(UIGame._OnLateUpdate))]
private static IEnumerable<CodeInstruction> UIGame__OnLateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -173,6 +196,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Fix crash in NeutronStarHandler.OnEnable()
// Harmony transpiler: NeutronStarHandler_OnEnable_Transpiler
// Target: NeutronStarHandler.OnEnable
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(NeutronStarHandler), nameof(NeutronStarHandler.OnEnable))]
private static IEnumerable<CodeInstruction> NeutronStarHandler_OnEnable_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -193,6 +219,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
}
// Disable rendering when Player is hidden (Press F11 twice)
// Harmony transpiler: GameLogic_LateUpdate_Transpiler
// Target: GameLogic.LateUpdate, GameLogic.Draw, GameLogic.DrawPost
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.LateUpdate))]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.Draw))]
@@ -273,7 +302,9 @@ public class PersistPatch : PatchImpl<PersistPatch>
rcode = -1;
Functions.UIFunctions.AddClusterUploadResult(rcode, __instance.uploadRequest == null ? 0f : (float)__instance.uploadRequest.reqTime);
}
// Harmony transpiler: MilkyWayCache_LoadTopTenPlayerData_Transpiler
// Target: MilkyWayCache.LoadTopTenPlayerData
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(MilkyWayCache), nameof(MilkyWayCache.LoadTopTenPlayerData))]
private static IEnumerable<CodeInstruction> MilkyWayCache_LoadTopTenPlayerData_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+9 -2
View File
@@ -27,6 +27,9 @@ public static class PlanetPatch
public class PlayerActionsInGlobeView : PatchImpl<PlayerActionsInGlobeView>
{
// Harmony transpiler: VFInput_UpdateGameStates_Transpiler
// Target: VFInput.UpdateGameStates
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(VFInput), nameof(VFInput.UpdateGameStates))]
private static IEnumerable<CodeInstruction> VFInput_UpdateGameStates_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -49,7 +52,9 @@ public static class PlanetPatch
});
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PlayerController_GetInput_Transpiler
// Target: PlayerController.GetInput
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerController), nameof(PlayerController.GetInput))]
private static IEnumerable<CodeInstruction> PlayerController_GetInput_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -62,7 +67,9 @@ public static class PlanetPatch
).Advance(1).Opcode = OpCodes.Ldc_I4_4;
return matcher.InstructionEnumeration();
}
// Harmony transpiler: PlayerAction_Rts_GameTick_Transpiler
// Target: PlayerAction_Rts.GameTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerAction_Rts), nameof(PlayerAction_Rts.GameTick))]
private static IEnumerable<CodeInstruction> PlayerAction_Rts_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+24 -6
View File
@@ -80,8 +80,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
ShortcutKeysForStarsName.Enable(false);
AutoNavigation.Enable(false);
}
// Harmony transpiler: UIStarmapStar__OnLateUpdate_Transpiler
// Target: UIStarmapStar._OnLateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStarmapStar), nameof(UIStarmapStar._OnLateUpdate))]
private static IEnumerable<CodeInstruction> UIStarmapStar__OnLateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -126,6 +127,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
private class EnhancedMechaForgeCountControl : PatchImpl<EnhancedMechaForgeCountControl>
{
// Harmony transpiler: UIReplicatorWindow_OnOkButtonClick_Transpiler
// Target: UIReplicatorWindow.OnOkButtonClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIReplicatorWindow), nameof(UIReplicatorWindow.OnOkButtonClick))]
private static IEnumerable<CodeInstruction> UIReplicatorWindow_OnOkButtonClick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -137,7 +141,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
matcher.Repeat(m => m.SetAndAdvance(OpCodes.Ldc_I4, 1000));
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIReplicatorWindow_OnPlusButtonClick_Transpiler
// Target: UIReplicatorWindow.OnPlusButtonClick, UIReplicatorWindow.OnMinusButtonClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIReplicatorWindow), nameof(UIReplicatorWindow.OnPlusButtonClick))]
[HarmonyPatch(typeof(UIReplicatorWindow), nameof(UIReplicatorWindow.OnMinusButtonClick))]
@@ -177,6 +183,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
private class HideTipsForSandsChanges : PatchImpl<HideTipsForSandsChanges>
{
// Harmony transpiler: Player_SetSandCount_Transpiler
// Target: Player.SetSandCount
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(Player), nameof(Player.SetSandCount))]
private static IEnumerable<CodeInstruction> Player_SetSandCount_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -223,6 +232,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
ShowAllStarsNameStatus = 0;
}
/*
// Harmony transpiler: UIStarmapPlanet__OnLateUpdate_Transpiler
// Target: UIStarmapPlanet._OnLateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStarmapPlanet), nameof(UIStarmapPlanet._OnLateUpdate))]
private static IEnumerable<CodeInstruction> UIStarmapPlanet__OnLateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -270,7 +282,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIStarmapDFHive__OnLateUpdate_Transpiler
// Target: UIStarmapDFHive._OnLateUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIStarmapDFHive), nameof(UIStarmapDFHive._OnLateUpdate))]
private static IEnumerable<CodeInstruction> UIStarmapDFHive__OnLateUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -360,7 +374,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
}
return movementStateChanged;
}
// Harmony transpiler: PlayerController_GameTick_Transpiler
// Target: PlayerController.GameTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerController), nameof(PlayerController.GameTick))]
private static IEnumerable<CodeInstruction> PlayerController_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -559,7 +575,9 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: VFInput_sailSpeedUp_Transpiler
// Target: VFInput._sailSpeedUp (getter)
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(VFInput), nameof(VFInput._sailSpeedUp), MethodType.Getter)]
private static IEnumerable<CodeInstruction> VFInput_sailSpeedUp_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+3
View File
@@ -263,6 +263,9 @@ public static class TechPatch
private class BatchBuyoutTech : PatchImpl<BatchBuyoutTech>
{
// Harmony transpiler: UITechNode_UpdateInfoDynamic_Transpiler
// Target: UITechNode.UpdateInfoDynamic
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UITechNode), nameof(UITechNode.UpdateInfoDynamic))]
private static IEnumerable<CodeInstruction> UITechNode_UpdateInfoDynamic_Transpiler(IEnumerable<CodeInstruction> instructions)