1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 23:33:33 +08:00

Work in progress

This commit is contained in:
2023-10-04 14:11:50 +08:00
parent b3e216bc6a
commit befed5ae60
2 changed files with 5 additions and 11 deletions

View File

@@ -144,13 +144,8 @@ public class CheatEnabler : BaseUnityPlugin
private void Update()
{
if (VFInput.inputing)
{
return;
}
if (Hotkey.Value.IsDown())
ToggleConfigWindow();
if (VFInput.inputing) return;
if (Hotkey.Value.IsDown()) ToggleConfigWindow();
}
private void LateUpdate()

View File

@@ -37,7 +37,7 @@ public static class FactoryPatch
NoConditionEnabled.SettingChanged += (_, _) => NoConditionBuild.Enable(NoConditionEnabled.Value);
NoCollisionEnabled.SettingChanged += (_, _) => NoCollisionValueChanged();
BeltSignalGeneratorEnabled.SettingChanged += (_, _) => BeltSignalGenerator.Enable(BeltSignalGeneratorEnabled.Value);
BeltSignalNumberAltFormat.SettingChanged += (_, _) => { BeltSignalGenerator.OnAltFormatChanged(); };
BeltSignalNumberAltFormat.SettingChanged += (_, _) => BeltSignalGenerator.OnAltFormatChanged();
NightLightEnabled.SettingChanged += (_, _) => NightLight.Enable(NightLightEnabled.Value);
RemovePowerSpaceLimitEnabled.SettingChanged += (_, _) => RemovePowerSpaceLimit.Enable(RemovePowerSpaceLimitEnabled.Value);
BoostWindPowerEnabled.SettingChanged += (_, _) => BoostWindPower.Enable(BoostWindPowerEnabled.Value);
@@ -502,13 +502,12 @@ public static class FactoryPatch
}
/* search for:
* ldloc.s V_88 (88)
* ldc.i4.s 15-18
* ldc.i4.s 15-19
* stfld valuetype EBuildCondition BuildPreview::condition
*/
matcher.Start().MatchForward(false,
new CodeMatch(instr => instr.opcode == OpCodes.Ldloc_S || instr.opcode == OpCodes.Ldloc),
new CodeMatch(instr => (instr.opcode == OpCodes.Ldc_I4_S || instr.opcode == OpCodes.Ldc_I4) &&
(instr.OperandIs(15) || instr.OperandIs(16) || instr.OperandIs(17) || instr.OperandIs(18))),
new CodeMatch(instr => (instr.opcode == OpCodes.Ldc_I4_S || instr.opcode == OpCodes.Ldc_I4) && Convert.ToInt64(instr.operand) is >= 15 and <= 19),
new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(BuildPreview), nameof(BuildPreview.condition)))
);
if (matcher.IsValid)