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
@@ -4,6 +4,7 @@ using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Utils;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
@@ -19,8 +20,6 @@ public static class FrameRemovalFunctions
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillRemoveAllFramesOn0AreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
{
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
foreach (var dysonSphereLayer in dysonSphere.layersIdBased)
{
if (dysonSphereLayer == null) continue;
@@ -49,7 +48,7 @@ public static class FrameRemovalFunctions
dysonSphereLayer.frameCursor = 1;
dysonSphereLayer.frameRecycleCursor = 0;
dysonSphereLayer.SetFrameCapacity(DysonSphereConstants.DefaultLayerPoolCapacity);
totalFrameSpInfo?.SetValue(dysonSphereLayer, 0);
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, 0);
}
dysonSphere.CheckAutoNodes();
dysonSphere.PickAutoNode();
@@ -4,6 +4,7 @@ using HarmonyLib;
using UnityEngine;
using UXAssist.Common;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Utils;
using CheatEnabler;
namespace CheatEnabler.Functions.DysonSphere;
@@ -19,10 +20,6 @@ public static class ShellCompletionFunctions
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillCompleteAllDysonSphereShellsOn0InstantlyAreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
{
var totalNodeSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalNodeSP");
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
var totalCpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalCP");
var rocketCount = 0L;
var solarSailCount = 0L;
foreach (var dysonSphereLayer in dysonSphere.layersIdBased)
@@ -75,16 +72,16 @@ public static class ShellCompletionFunctions
shell.nodecps[nodeIndex] = cpMax;
shell.nodecps[shell.nodecps.Length - 1] += diff;
solarSailCount += diff;
if (totalCpInfo != null)
if (DysonSphereReflection.HasTotalCP)
{
shell.SetMaterialDynamicVars();
}
}
}
totalNodeSpInfo?.SetValue(dysonSphereLayer, totalNodeSp);
totalFrameSpInfo?.SetValue(dysonSphereLayer, totalFrameSp);
totalCpInfo?.SetValue(dysonSphereLayer, totalCp);
DysonSphereReflection.SetTotalNodeSP(dysonSphereLayer, totalNodeSp);
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, totalFrameSp);
DysonSphereReflection.SetTotalCP(dysonSphereLayer, totalCp);
}
dysonSphere.CheckAutoNodes();
+9 -1
View File
@@ -34,6 +34,9 @@ public static class CombatPatch
private class MechaInvincible : PatchImpl<MechaInvincible>
{
// Harmony transpiler: Player_get_invincible_Transpiler
// Target: Player.invincible (getter)
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(Player), nameof(Player.invincible), MethodType.Getter)]
private static IEnumerable<CodeInstruction> Player_get_invincible_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -45,7 +48,9 @@ public static class CombatPatch
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: SkillSystem_DamageObject_Transpiler
// Target: SkillSystem.DamageGroundObjectByLocalCaster, SkillSystem.DamageGroundObjectByRemoteCaster, SkillSystem.DamageObject
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByRemoteCaster))]
@@ -69,6 +74,9 @@ public static class CombatPatch
private class BuildingsInvincible : PatchImpl<BuildingsInvincible>
{
// Harmony transpiler: SkillSystem_DamageObject_Transpiler
// Target: SkillSystem.DamageGroundObjectByLocalCaster, SkillSystem.DamageGroundObjectByRemoteCaster
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByRemoteCaster))]
+33 -8
View File
@@ -67,7 +67,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
// {
// CheatEnabler.Logger.LogDebug($"[DysonShell.ImportFromBlueprint] vertCount={__instance.vertexCount}, cpPerVertex={__instance.cpPerVertex}, cpMax={__instance.cellPointMax}");
// }
// Harmony transpiler: DysonNode_OrderConstructCp_Transpiler
// Target: DysonNode.OrderConstructCp
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonNode), nameof(DysonNode.OrderConstructCp))]
private static IEnumerable<CodeInstruction> DysonNode_OrderConstructCp_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -82,7 +84,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: DysonSwarm_AbsorbSail_Transpiler
// Target: DysonSwarm.AbsorbSail
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonSwarm), nameof(DysonSwarm.AbsorbSail))]
private static IEnumerable<CodeInstruction> DysonSwarm_AbsorbSail_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -189,7 +193,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
UpdateSailLifeTime();
}
}
// 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)
@@ -374,7 +380,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{
_instantAbsorb = QuickAbsorbEnabled.Value && QuickAbsorbPatch.GetHarmony() != null;
}
// Harmony transpiler: DysonSwarm_AbsorbSail_Transpiler2
// Target: DysonSwarm.AbsorbSail
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonSwarm), nameof(DysonSwarm.AbsorbSail))]
private static IEnumerable<CodeInstruction> DysonSwarm_AbsorbSail_Transpiler2(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -416,7 +424,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{
_instantAbsorb = SkipAbsorbEnabled.Value && SkipAbsorbPatch.GetHarmony() != null;
}
// Harmony transpiler: DysonSphereLayer_GameTick_Transpiler
// Target: DysonSphereLayer.GameTick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonSphereLayer), nameof(DysonSphereLayer.GameTick))]
private static IEnumerable<CodeInstruction> DysonSphereLayer_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -458,6 +468,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
private class EjectAnywayPatch : PatchImpl<EjectAnywayPatch>
{
// 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)
@@ -488,6 +501,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
private class OverclockEjector : PatchImpl<OverclockEjector>
{
// Harmony transpiler: EjectComponent_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> EjectComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -510,7 +526,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
matcher.Start().Advance(pos).RemoveInstructions(end - pos);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIEjectAndSiloWindow__OnUpdate_Transpiler
// Target: UIEjectorWindow._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIEjectorWindow), nameof(UIEjectorWindow._OnUpdate))]
private static IEnumerable<CodeInstruction> UIEjectAndSiloWindow__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -541,6 +559,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
private class OverclockSilo : PatchImpl<OverclockSilo>
{
// 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)
@@ -563,7 +584,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
matcher.Start().Advance(pos).RemoveInstructions(end - pos);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIEjectAndSiloWindow__OnUpdate_Transpiler
// Target: UISiloWindow._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UISiloWindow), nameof(UISiloWindow._OnUpdate))]
private static IEnumerable<CodeInstruction> UIEjectAndSiloWindow__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -612,7 +635,9 @@ public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
if (dysonEditor == null || !dysonEditor.gameObject.activeSelf) return;
dysonEditor.selection?.onViewStarChange?.Invoke();
}
// Harmony transpiler: MaxOrbitRadiusPatch_Transpiler
// Target: DysonSphere.CheckLayerRadius, DysonSphere.CheckSwarmRadius, DysonSphere.QueryLayerRadius, DysonSphere.QuerySwarmRadius, UIDEAddLayerDialogue.OnViewStarChange, UIDEAddSwarmDialogue.OnViewStarChange, UIDysonEditor.OnViewStarChange, UIDESwarmOrbitInfo._OnInit, UIDysonOrbitPreview.UpdateAscNodeGizmos
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(DysonSphere), nameof(DysonSphere.CheckLayerRadius))]
[HarmonyPatch(typeof(DysonSphere), nameof(DysonSphere.CheckSwarmRadius))]
+6 -2
View File
@@ -202,7 +202,9 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
}
GameMain.data?.warningSystem?.UpdateCriticalWarningText();
}
// Harmony transpiler: WarningSystem_hasCriticalWarning_Transpiler
// Target: WarningSystem.hasCriticalWarning (getter)
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(WarningSystem), nameof(WarningSystem.hasCriticalWarning), MethodType.Getter)]
private static IEnumerable<CodeInstruction> WarningSystem_hasCriticalWarning_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -228,7 +230,9 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: WarningSystem_UpdateCriticalWarningText_Transpiler
// Target: WarningSystem.UpdateCriticalWarningText
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(WarningSystem), nameof(WarningSystem.UpdateCriticalWarningText))]
private static IEnumerable<CodeInstruction> WarningSystem_UpdateCriticalWarningText_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -124,7 +124,9 @@ internal class ImmediateBuild : PatchImpl<ImmediateBuild>
FactoryPatch.ArrivePlanet(factory);
}
}
// Harmony transpiler: Transpiler
// Target: BuildTool_Addon.CreatePrebuilds, BuildTool_BlueprintPaste.CreatePrebuilds, BuildTool_Click.CreatePrebuilds, BuildTool_Inserter.CreatePrebuilds, BuildTool_Path.CreatePrebuilds
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Addon), nameof(BuildTool_Addon.CreatePrebuilds))]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CreatePrebuilds))]
@@ -7,6 +7,9 @@ namespace CheatEnabler.Patches.Factory;
internal class ControlPanelRemoteLogistics : PatchImpl<ControlPanelRemoteLogistics>
{
// Harmony transpiler: UIControlPanelDispenserInspector_OnItemIconMouseDown_Transpiler
// Target: UIControlPanelDispenserInspector.OnItemIconMouseDown, UIControlPanelDispenserInspector.OnHoldupItemClick, UIControlPanelDispenserInspector.OnCourierIconClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelDispenserInspector), nameof(UIControlPanelDispenserInspector.OnItemIconMouseDown))]
[HarmonyPatch(typeof(UIControlPanelDispenserInspector), nameof(UIControlPanelDispenserInspector.OnHoldupItemClick))]
@@ -35,7 +38,9 @@ internal class ControlPanelRemoteLogistics : PatchImpl<ControlPanelRemoteLogisti
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIControlPanelStationInspector_OnShipIconClick_Transpiler
// Target: UIControlPanelStationInspector.OnShipIconClick, UIControlPanelStationInspector.OnWarperIconClick, UIControlPanelStationInspector.OnDroneIconClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationInspector), nameof(UIControlPanelStationInspector.OnShipIconClick))]
[HarmonyPatch(typeof(UIControlPanelStationInspector), nameof(UIControlPanelStationInspector.OnWarperIconClick))]
@@ -64,7 +69,9 @@ internal class ControlPanelRemoteLogistics : PatchImpl<ControlPanelRemoteLogisti
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIControlPanelStationStorage_OnItemIconMouseDown_Transpiler
// Target: UIControlPanelStationStorage.OnItemIconMouseDown
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemIconMouseDown))]
private static IEnumerable<CodeInstruction> UIControlPanelStationStorage_OnItemIconMouseDown_Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -91,7 +98,9 @@ internal class ControlPanelRemoteLogistics : PatchImpl<ControlPanelRemoteLogisti
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIControlPanelStationStorage_OnTakeBackButtonClick_Transpiler
// Target: UIControlPanelStationStorage.OnTakeBackButtonClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnTakeBackButtonClick))]
private static IEnumerable<CodeInstruction> UIControlPanelStationStorage_OnTakeBackButtonClick_Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -110,7 +119,9 @@ internal class ControlPanelRemoteLogistics : PatchImpl<ControlPanelRemoteLogisti
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIControlPanelVeinCollectorPanel_OnProductIconClick_Transpiler
// Target: UIControlPanelVeinCollectorPanel.OnProductIconClick
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelVeinCollectorPanel), nameof(UIControlPanelVeinCollectorPanel.OnProductIconClick))]
private static IEnumerable<CodeInstruction> UIControlPanelVeinCollectorPanel_OnProductIconClick_Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -16,7 +16,9 @@ internal class NoConditionBuild : PatchImpl<NoConditionBuild>
{
GameMain.data?.warningSystem?.UpdateCriticalWarningText();
}
// Harmony transpiler: BuildTool_CheckBuildConditions_Transpiler
// Target: BuildTool_Addon.CheckBuildConditions, BuildTool_Inserter.CheckBuildConditions
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler, HarmonyPriority(Priority.Last)]
[HarmonyPatch(typeof(BuildTool_Addon), nameof(BuildTool_Addon.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Inserter), nameof(BuildTool_Inserter.CheckBuildConditions))]
@@ -25,7 +27,9 @@ internal class NoConditionBuild : PatchImpl<NoConditionBuild>
yield return new CodeInstruction(OpCodes.Ldc_I4_1);
yield return new CodeInstruction(OpCodes.Ret);
}
// 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)
@@ -60,7 +64,9 @@ internal class NoConditionBuild : PatchImpl<NoConditionBuild>
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Click_CheckBuildConditions_Transpiler
// Target: BuildTool_BlueprintPaste.CheckBuildConditions, BuildTool_Click.CheckBuildConditions
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler, HarmonyPriority(Priority.Last)]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
@@ -9,6 +9,9 @@ namespace CheatEnabler.Patches.Factory;
internal class RemovePowerSpaceLimit : PatchImpl<RemovePowerSpaceLimit>
{
// Harmony transpiler: BuildTool_CheckBuildConditions_Transpiler
// Target: BuildTool_Click.CheckBuildConditions, BuildTool_BlueprintPaste.CheckBuildConditions
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
@@ -39,6 +42,9 @@ internal class RemovePowerSpaceLimit : PatchImpl<RemovePowerSpaceLimit>
internal class BoostWindPower : PatchImpl<BoostWindPower>
{
// Harmony transpiler: PowerGeneratorComponent_EnergyCap_Wind_Transpiler
// Target: PowerGeneratorComponent.EnergyCap_Wind
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.EnergyCap_Wind))]
private static IEnumerable<CodeInstruction> PowerGeneratorComponent_EnergyCap_Wind_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -64,6 +70,9 @@ internal class BoostWindPower : PatchImpl<BoostWindPower>
internal class BoostSolarPower : PatchImpl<BoostSolarPower>
{
// Harmony transpiler: PowerGeneratorComponent_EnergyCap_PV_Transpiler
// Target: PowerGeneratorComponent.EnergyCap_PV
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.EnergyCap_PV))]
private static IEnumerable<CodeInstruction> PowerGeneratorComponent_EnergyCap_PV_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -88,6 +97,9 @@ internal class BoostSolarPower : PatchImpl<BoostSolarPower>
internal class BoostFuelPower : PatchImpl<BoostFuelPower>
{
// Harmony transpiler: PowerGeneratorComponent_EnergyCap_Fuel_Transpiler
// Target: PowerGeneratorComponent.EnergyCap_Fuel
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.EnergyCap_Fuel))]
private static IEnumerable<CodeInstruction> PowerGeneratorComponent_EnergyCap_Fuel_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -129,6 +141,9 @@ internal class BoostFuelPower : PatchImpl<BoostFuelPower>
internal class BoostGeothermalPower : PatchImpl<BoostGeothermalPower>
{
// Harmony transpiler: PowerGeneratorComponent_EnergyCap_GTH_Transpiler
// Target: PowerGeneratorComponent.EnergyCap_GTH
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.EnergyCap_GTH))]
private static IEnumerable<CodeInstruction> PowerGeneratorComponent_EnergyCap_GTH_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+9 -3
View File
@@ -149,7 +149,9 @@ public static class GamePatch
{
__instance.Update();
}
// Harmony transpiler: PlayerAction_Test_Update_Transpiler
// Target: PlayerAction_Test.Update
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerAction_Test), nameof(PlayerAction_Test.Update))]
private static IEnumerable<CodeInstruction> PlayerAction_Test_Update_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -182,7 +184,9 @@ public static class GamePatch
matcher.Labels = labels;
return matcher.InstructionEnumeration();
}
// Harmony transpiler: GameCamera_Logic_Transpiler
// Target: GameCamera.FrameLogic
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(GameCamera), nameof(GameCamera.FrameLogic))]
private static IEnumerable<CodeInstruction> GameCamera_Logic_Transpiler(IEnumerable<CodeInstruction> instructions)
@@ -310,7 +314,9 @@ public static class GamePatch
history.currentTech = history.techQueue[0];
}
}
// Harmony transpiler: UITechNode_OnPointerDown_Transpiler
// Target: UITechNode.OnPointerDown
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UITechNode), nameof(UITechNode.OnPointerDown))]
private static IEnumerable<CodeInstruction> UITechNode_OnPointerDown_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+15 -3
View File
@@ -34,6 +34,9 @@ public static class PlanetPatch
private class WaterPumperPatch : PatchImpl<WaterPumperPatch>
{
// Harmony transpiler: BuildTool_CheckBuildConditions_Transpiler
// Target: BuildTool_BlueprintPaste.CheckBuildConditions, BuildTool_Click.CheckBuildConditions
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
[HarmonyPatch(typeof(BuildTool_Click), nameof(BuildTool_Click.CheckBuildConditions))]
@@ -56,6 +59,9 @@ public static class PlanetPatch
private class TerraformAnyway : PatchImpl<TerraformAnyway>
{
// Harmony transpiler: BuildTool_BlueprintPaste_DetermineReforms_Patch
// Target: BuildTool_BlueprintPaste.DetermineReforms
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.DetermineReforms))]
private static IEnumerable<CodeInstruction> BuildTool_BlueprintPaste_DetermineReforms_Patch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -79,7 +85,9 @@ public static class PlanetPatch
matcher.Opcode = OpCodes.Br;
return matcher.InstructionEnumeration();
}
// Harmony transpiler: BuildTool_Reform_RemoveBasePit_Patch
// Target: BuildTool_Reform.RemoveBasePit
// Fallback: Checks CodeMatcher.IsInvalid/IsValid and returns original instructions on mismatch.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.RemoveBasePit))]
private static IEnumerable<CodeInstruction> BuildTool_Reform_RemoveBasePit_Patch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
@@ -104,7 +112,9 @@ public static class PlanetPatch
);
return matcher.InstructionEnumeration();
}
// Harmony transpiler: UIRemoveBasePitButton_OnRemoveButtonClick_Patch
// Target: UIRemoveBasePitButton.OnRemoveButtonClick, UIRemoveBasePitButton._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIRemoveBasePitButton), nameof(UIRemoveBasePitButton.OnRemoveButtonClick))]
[HarmonyPatch(typeof(UIRemoveBasePitButton), nameof(UIRemoveBasePitButton._OnUpdate))]
@@ -141,7 +151,9 @@ 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.
[HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))]
private static IEnumerable<CodeInstruction> BuildTool_Reform_ReformAction_Patch(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
+3
View File
@@ -47,6 +47,9 @@ public static class PlayerPatch
private class InstantTeleport : PatchImpl<InstantTeleport>
{
// Harmony transpiler: UIGlobemap__OnUpdate_Transpiler
// Target: UIGlobemap._OnUpdate, UIStarmap.DoRightClickFastTravel, UIStarmap.OnFastTravelButtonClick, UIStarmap.OnScreenClick, UIStarmap.SandboxRightClickFastTravelLogic, UIStarmap.StartFastTravelToPlanet, UIStarmap.StartFastTravelToUPosition, UIStarmap.UpdateCursorView, UIStarmap._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIGlobemap), nameof(UIGlobemap._OnUpdate))]
[HarmonyPatch(typeof(UIStarmap), nameof(UIStarmap.DoRightClickFastTravel))]
+6 -1
View File
@@ -34,6 +34,9 @@ public static class ResourcePatch
private class InfiniteResource : PatchImpl<InfiniteResource>
{
static private readonly float InfiniteResourceRate = 0f;
// Harmony transpiler: Transpiler
// Target: FactorySystem.GameTick, GameLogic._miner_parallel, PlanetTransport.GameTick, UIChartAstroResource.CalculateMaxAmount, UIChartVeinGroup.CalculateMaxAmount, UIControlPanelAdvancedMinerEntry._OnUpdate, UIControlPanelVeinCollectorPanel._OnUpdate, UIMinerWindow._OnUpdate, UIMiningUpgradeLabel.Update, UIVeinCollectorPanel._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTick), typeof(long), typeof(bool))]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic._miner_parallel))]
@@ -75,7 +78,9 @@ public static class ResourcePatch
private class FastMining : PatchImpl<FastMining>
{
static private readonly float FastMiningSpeed = 2400f;
// Harmony transpiler: Transpiler
// Target: AstroResourceStatPlan.AddPlanetResources, BuildingGizmo.Update, FactorySystem.GameTick, GameLogic._miner_parallel, ItemProto.GetPropValue, PlanetTransport.GameTick, ProductionExtraInfoCalculator.CalculateFactory, UIChartAstroResource.CalculateMaxAmount, UIChartVeinGroup.CalculateMaxAmount, UIControlPanelStationStorage.RefreshValues, UIControlPanelVeinCollectorPanel._OnUpdate, UIMinerWindow._OnUpdate, UIMiningUpgradeLabel.Update, UIPlanetDetail.OnPlanetDataSet, UIPlanetDetail.RefreshDynamicProperties, UIReferenceSpeedTip.AddEntryDataWithFactory, UIStarDetail.OnStarDataSet, UIStarDetail.RefreshDynamicProperties, UIStationStorage.RefreshValues, UIVeinCollectorPanel._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(AstroResourceStatPlan), nameof(AstroResourceStatPlan.AddPlanetResources))]
[HarmonyPatch(typeof(BuildingGizmo), nameof(BuildingGizmo.Update))]