From fc8488ce6183a6b354dcdbf302e11d19227dc23a Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Fri, 23 Aug 2024 16:20:25 +0800 Subject: [PATCH] CheatEnabler 2.3.21 --- CheatEnabler/CHANGELOG.md | 6 ++++ CheatEnabler/CheatEnabler.csproj | 4 +-- CheatEnabler/DevShortcuts.cs | 29 +++++++++++++++++-- CheatEnabler/FactoryPatch.cs | 22 ++++++++++++-- CheatEnabler/package/manifest.json | 2 +- Dustbin/Dustbin.csproj | 2 +- DustbinPreloader/DustbinPreloader.csproj | 2 +- HideTips/HideTips.csproj | 2 +- LabOpt/LabOpt.csproj | 2 +- LabOptPreloader/LabOptPreloader.csproj | 2 +- LogisticMiner/LogisticMiner.csproj | 2 +- MechaDronesTweaks/MechaDronesTweaks.csproj | 2 +- OCBatchBuild/OCBatchBuild.csproj | 2 +- .../OverclockEverything.csproj | 2 +- PoolOpt/PoolOpt.csproj | 2 +- UXAssist/UXAssist.csproj | 2 +- UniverseGenTweaks/UniverseGenTweaks.csproj | 2 +- UserCloak/UserCloak.csproj | 2 +- 18 files changed, 69 insertions(+), 20 deletions(-) diff --git a/CheatEnabler/CHANGELOG.md b/CheatEnabler/CHANGELOG.md index dc8581b..13a96d6 100644 --- a/CheatEnabler/CHANGELOG.md +++ b/CheatEnabler/CHANGELOG.md @@ -1,4 +1,7 @@ ## Changlog +* 2.3.21 + + `Retrieve/Place items from/to remote planets on logistics control panel`: Items are put back to player's inventory when a slot is removed from the logistics station on remote planet. + + `Dev Shortcuts`: Camera Pose related shortcurts are working now. * 2.3.20 + New feature: `Retrieve/Place items from/to remote planets on logistics control panel` * 2.3.19 @@ -116,6 +119,9 @@ ## 更新日志 +* 2.3.21 + + `在物流总控面板上可以从非本地行星取放物品`:当从非本地星球的物流站移除槽位时,物品会放回玩家的背包 + + `开发模式快捷键`:摄像机位(Pose)相关的快捷键现在生效了 * 2.3.20 + 新功能:`在物流总控面板上可以从非本地行星取放物品` * 2.3.19 diff --git a/CheatEnabler/CheatEnabler.csproj b/CheatEnabler/CheatEnabler.csproj index 422e67e..cabc398 100644 --- a/CheatEnabler/CheatEnabler.csproj +++ b/CheatEnabler/CheatEnabler.csproj @@ -5,7 +5,7 @@ net472 org.soardev.cheatenabler DSP MOD - CheatEnabler - 2.3.20 + 2.3.21 true latest CheatEnabler @@ -16,7 +16,7 @@ - + diff --git a/CheatEnabler/DevShortcuts.cs b/CheatEnabler/DevShortcuts.cs index 2f7ff0d..01b3824 100644 --- a/CheatEnabler/DevShortcuts.cs +++ b/CheatEnabler/DevShortcuts.cs @@ -26,7 +26,7 @@ public static class DevShortcuts } [HarmonyPostfix] - [HarmonyPatch(typeof(PlayerController), "Init")] + [HarmonyPatch(typeof(PlayerController), nameof(PlayerController.Init))] private static void PlayerController_Init_Postfix(PlayerController __instance) { var cnt = __instance.actions.Length; @@ -44,7 +44,7 @@ public static class DevShortcuts } [HarmonyPostfix] - [HarmonyPatch(typeof(PlayerAction_Test), "GameTick")] + [HarmonyPatch(typeof(PlayerAction_Test), nameof(PlayerAction_Test.GameTick))] private static void PlayerAction_Test_GameTick_Postfix(PlayerAction_Test __instance) { __instance.Update(); @@ -82,4 +82,29 @@ public static class DevShortcuts matcher.Labels = labels; return matcher.InstructionEnumeration(); } + + [HarmonyTranspiler] + [HarmonyPatch(typeof(GameCamera), nameof(GameCamera.FrameLogic))] + private static IEnumerable GameCamera_Logic_Transpiler(IEnumerable instructions) + { + var matcher = new CodeMatcher(instructions); + matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(GameCamera), nameof(GameCamera.finalPoser))), + new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(CameraPoser), nameof(CameraPoser.cameraPose))) + ); + var labels = matcher.Labels; + matcher.Labels = null; + matcher.Insert( + new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels), + Transpilers.EmitDelegate((GameCamera camera) => + { + if (PlayerAction_Test.lockCam) + { + camera.finalPoser.cameraPose = PlayerAction_Test.camPose; + } + }) + ); + return matcher.InstructionEnumeration(); + } } diff --git a/CheatEnabler/FactoryPatch.cs b/CheatEnabler/FactoryPatch.cs index 701188c..c09eec4 100644 --- a/CheatEnabler/FactoryPatch.cs +++ b/CheatEnabler/FactoryPatch.cs @@ -1551,7 +1551,6 @@ public static class FactoryPatch [HarmonyTranspiler] [HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemIconMouseDown))] - [HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnTakeBackButtonClick))] private static IEnumerable UIControlPanelStationStorage_OnItemIconMouseDown_Transpiler(IEnumerable instructions) { var matcher = new CodeMatcher(instructions); @@ -1577,6 +1576,25 @@ public static class FactoryPatch return matcher.InstructionEnumeration(); } + [HarmonyTranspiler] + [HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnTakeBackButtonClick))] + private static IEnumerable UIControlPanelStationStorage_OnTakeBackButtonClick_Transpiler(IEnumerable instructions) + { + var matcher = new CodeMatcher(instructions); + matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.isLocal))), + new CodeMatch(ci => ci.Branches(out _)) + ).Repeat( + m => + { + var labels = m.Labels; + m.RemoveInstructions(3).Labels.AddRange(labels); + } + ); + return matcher.InstructionEnumeration(); + } + [HarmonyTranspiler] [HarmonyPatch(typeof(UIControlPanelVeinCollectorPanel), nameof(UIControlPanelVeinCollectorPanel.OnProductIconClick))] private static IEnumerable UIControlPanelVeinCollectorPanel_OnProductIconClick_Transpiler(IEnumerable instructions) @@ -1585,7 +1603,7 @@ public static class FactoryPatch Label? branch = null; matcher.MatchForward(false, new CodeMatch(OpCodes.Ldarg_0), - new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(UIControlPanelVeinCollectorPanel), "isLocal")), + new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(UIControlPanelVeinCollectorPanel), nameof(UIControlPanelVeinCollectorPanel.isLocal))), new CodeMatch(ci => ci.Branches(out branch)) ).Repeat( m => diff --git a/CheatEnabler/package/manifest.json b/CheatEnabler/package/manifest.json index df17b71..ff2bcef 100644 --- a/CheatEnabler/package/manifest.json +++ b/CheatEnabler/package/manifest.json @@ -1,6 +1,6 @@ { "name": "CheatEnabler", - "version_number": "2.3.20", + "version_number": "2.3.21", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler", "description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测", "dependencies": [ diff --git a/Dustbin/Dustbin.csproj b/Dustbin/Dustbin.csproj index 5e2bcb3..4240ef2 100644 --- a/Dustbin/Dustbin.csproj +++ b/Dustbin/Dustbin.csproj @@ -16,7 +16,7 @@ - + diff --git a/DustbinPreloader/DustbinPreloader.csproj b/DustbinPreloader/DustbinPreloader.csproj index 5ce7af8..b0adf62 100644 --- a/DustbinPreloader/DustbinPreloader.csproj +++ b/DustbinPreloader/DustbinPreloader.csproj @@ -14,7 +14,7 @@ - + diff --git a/HideTips/HideTips.csproj b/HideTips/HideTips.csproj index 073b7ce..978f533 100644 --- a/HideTips/HideTips.csproj +++ b/HideTips/HideTips.csproj @@ -15,7 +15,7 @@ - + diff --git a/LabOpt/LabOpt.csproj b/LabOpt/LabOpt.csproj index 3e272c0..4f0e4ce 100644 --- a/LabOpt/LabOpt.csproj +++ b/LabOpt/LabOpt.csproj @@ -15,7 +15,7 @@ - + diff --git a/LabOptPreloader/LabOptPreloader.csproj b/LabOptPreloader/LabOptPreloader.csproj index b987d87..5620de9 100644 --- a/LabOptPreloader/LabOptPreloader.csproj +++ b/LabOptPreloader/LabOptPreloader.csproj @@ -14,7 +14,7 @@ - + diff --git a/LogisticMiner/LogisticMiner.csproj b/LogisticMiner/LogisticMiner.csproj index 079d330..8098cab 100644 --- a/LogisticMiner/LogisticMiner.csproj +++ b/LogisticMiner/LogisticMiner.csproj @@ -15,7 +15,7 @@ - + diff --git a/MechaDronesTweaks/MechaDronesTweaks.csproj b/MechaDronesTweaks/MechaDronesTweaks.csproj index 8ff472d..bb71c20 100644 --- a/MechaDronesTweaks/MechaDronesTweaks.csproj +++ b/MechaDronesTweaks/MechaDronesTweaks.csproj @@ -15,7 +15,7 @@ - + diff --git a/OCBatchBuild/OCBatchBuild.csproj b/OCBatchBuild/OCBatchBuild.csproj index 111c72a..c697bdc 100644 --- a/OCBatchBuild/OCBatchBuild.csproj +++ b/OCBatchBuild/OCBatchBuild.csproj @@ -15,7 +15,7 @@ - + diff --git a/OverclockEverything/OverclockEverything.csproj b/OverclockEverything/OverclockEverything.csproj index 4503ccf..adc65bb 100644 --- a/OverclockEverything/OverclockEverything.csproj +++ b/OverclockEverything/OverclockEverything.csproj @@ -16,7 +16,7 @@ - + diff --git a/PoolOpt/PoolOpt.csproj b/PoolOpt/PoolOpt.csproj index 815a30f..cf88bf4 100644 --- a/PoolOpt/PoolOpt.csproj +++ b/PoolOpt/PoolOpt.csproj @@ -15,7 +15,7 @@ - + diff --git a/UXAssist/UXAssist.csproj b/UXAssist/UXAssist.csproj index bcb7e5f..e35e6fa 100644 --- a/UXAssist/UXAssist.csproj +++ b/UXAssist/UXAssist.csproj @@ -16,7 +16,7 @@ - + diff --git a/UniverseGenTweaks/UniverseGenTweaks.csproj b/UniverseGenTweaks/UniverseGenTweaks.csproj index 4009c41..fe3e28a 100644 --- a/UniverseGenTweaks/UniverseGenTweaks.csproj +++ b/UniverseGenTweaks/UniverseGenTweaks.csproj @@ -16,7 +16,7 @@ - + diff --git a/UserCloak/UserCloak.csproj b/UserCloak/UserCloak.csproj index b0060ad..f4dbef1 100644 --- a/UserCloak/UserCloak.csproj +++ b/UserCloak/UserCloak.csproj @@ -15,7 +15,7 @@ - +