1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 02:53:29 +08:00

CheatEnabler 2.3.21

This commit is contained in:
2024-08-23 16:20:25 +08:00
parent 65a8a9374f
commit fc8488ce61
18 changed files with 69 additions and 20 deletions

View File

@@ -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

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.cheatenabler</BepInExPluginGuid>
<Description>DSP MOD - CheatEnabler</Description>
<Version>2.3.20</Version>
<Version>2.3.21</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>CheatEnabler</PackageId>
@@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="0.10.30.23292-r.0" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="0.10.30.23350-r.0" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup>

View File

@@ -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<CodeInstruction> GameCamera_Logic_Transpiler(IEnumerable<CodeInstruction> 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();
}
}

View File

@@ -1551,7 +1551,6 @@ public static class FactoryPatch
[HarmonyTranspiler]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnItemIconMouseDown))]
[HarmonyPatch(typeof(UIControlPanelStationStorage), nameof(UIControlPanelStationStorage.OnTakeBackButtonClick))]
private static IEnumerable<CodeInstruction> UIControlPanelStationStorage_OnItemIconMouseDown_Transpiler(IEnumerable<CodeInstruction> 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<CodeInstruction> UIControlPanelStationStorage_OnTakeBackButtonClick_Transpiler(IEnumerable<CodeInstruction> 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<CodeInstruction> UIControlPanelVeinCollectorPanel_OnProductIconClick_Transpiler(IEnumerable<CodeInstruction> 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 =>

View File

@@ -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": [