From e2d83ee3cba46207f73d983cb0fd76c6dd66618b Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sun, 18 Feb 2024 20:43:37 +0800 Subject: [PATCH] Release MechaDroneTweaks 1.1.4, CheatEnabler 2.3.10, UXAssist 1.0.13 --- CheatEnabler/CheatEnabler.csproj | 4 +- CheatEnabler/PlanetPatch.cs | 13 +++- CheatEnabler/README.md | 8 +++ CheatEnabler/package/manifest.json | 4 +- MechaDronesTweaks/MechaDronesTweaks.csproj | 2 +- MechaDronesTweaks/README.md | 6 ++ MechaDronesTweaks/package/manifest.json | 2 +- UXAssist/FactoryPatch.cs | 2 +- UXAssist/README.md | 18 ++++++ UXAssist/TODO.md | 3 - UXAssist/UXAssist.cs | 70 +++++++++++++++++----- UXAssist/UXAssist.csproj | 4 +- UXAssist/package/manifest.json | 2 +- 13 files changed, 107 insertions(+), 31 deletions(-) diff --git a/CheatEnabler/CheatEnabler.csproj b/CheatEnabler/CheatEnabler.csproj index 9c5bc01..fbc25c2 100644 --- a/CheatEnabler/CheatEnabler.csproj +++ b/CheatEnabler/CheatEnabler.csproj @@ -5,7 +5,7 @@ net472 org.soardev.cheatenabler DSP MOD - CheatEnabler - 2.3.9 + 2.3.10 true latest CheatEnabler @@ -16,7 +16,7 @@ - + diff --git a/CheatEnabler/PlanetPatch.cs b/CheatEnabler/PlanetPatch.cs index 1019fb3..f4f1b87 100644 --- a/CheatEnabler/PlanetPatch.cs +++ b/CheatEnabler/PlanetPatch.cs @@ -83,11 +83,20 @@ public static class PlanetPatch { var matcher = new CodeMatcher(instructions, generator); matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(BuildTool_Reform), nameof(BuildTool_Reform.cursorPointCount))), + new CodeMatch(ci => ci.opcode == OpCodes.Blt || ci.opcode == OpCodes.Blt_S) + ).RemoveInstructions(2).InsertAndAdvance( + new CodeInstruction(OpCodes.Ldc_I4_0) + ).MatchForward(false, new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(Player), "get_sandCount")) - ).Advance(4).InsertAndAdvance( + ).Advance(1).MatchForward(false, + new CodeMatch(OpCodes.Conv_I8), + new CodeMatch(OpCodes.Sub) + ).Advance(2).InsertAndAdvance( new CodeInstruction(OpCodes.Ldc_I8, 0L), new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), "Max", new[] { typeof(long), typeof(long) })) - ).Advance(1).RemoveInstructions(4); + ); return matcher.InstructionEnumeration(); } } diff --git a/CheatEnabler/README.md b/CheatEnabler/README.md index 6d68753..d0b0566 100644 --- a/CheatEnabler/README.md +++ b/CheatEnabler/README.md @@ -4,6 +4,10 @@ #### 添加一些作弊功能,同时屏蔽异常检测 ## Changlog +* 2.3.10 + + Fix following functions not working in new game updates: + - `Pump Anywhere` + - `Terraform without enough sands` * 2.3.9 + Support game version 0.10.28.21219 * 2.3.8 @@ -120,6 +124,10 @@ * [Multifunction_mod](https://github.com/blacksnipebiu/Multifunction_mod): Some cheat functions ## 更新日志 +* 2.3.10 + + 修复了以下功能在新游戏版本中不生效的问题: + - `平地抽水` + - `沙土不够时依然可以整改地形` * 2.3.9 + 支持游戏版本0.10.28.21219 * 2.3.8 diff --git a/CheatEnabler/package/manifest.json b/CheatEnabler/package/manifest.json index 9ceaf85..bd87296 100644 --- a/CheatEnabler/package/manifest.json +++ b/CheatEnabler/package/manifest.json @@ -1,10 +1,10 @@ { "name": "CheatEnabler", - "version_number": "2.3.9", + "version_number": "2.3.10", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler", "description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测", "dependencies": [ "xiaoye97-BepInEx-5.4.17", - "soarqin-UXAssist-1.0.2" + "soarqin-UXAssist-1.0.13" ] } diff --git a/MechaDronesTweaks/MechaDronesTweaks.csproj b/MechaDronesTweaks/MechaDronesTweaks.csproj index 0bf6f95..05a99c8 100644 --- a/MechaDronesTweaks/MechaDronesTweaks.csproj +++ b/MechaDronesTweaks/MechaDronesTweaks.csproj @@ -6,7 +6,7 @@ MechaDronesTweaks org.soardev.mechadronestweaks DSP MOD - MechaDronesTweaks - 1.1.3 + 1.1.4 true latest https://nuget.bepinex.dev/v3/index.json diff --git a/MechaDronesTweaks/README.md b/MechaDronesTweaks/README.md index 63406f3..05c19ee 100644 --- a/MechaDronesTweaks/README.md +++ b/MechaDronesTweaks/README.md @@ -4,6 +4,9 @@ #### 机甲建设机调整(FastDrones MOD的后继者) ## Updates +* 1.1.4 + + Fixed support for game version 0.10.29 + * 1.1.3 + Support for game version 0.10.28.20759+ + Fixed a minor bug that `RemoveSpeedLimitForStage1` not working while `UseFixedSpeed` set to false and `SpeedMultiplier` set to 1 @@ -35,6 +38,9 @@ * Note: This MOD will disable `FastDrones` if the MOD is installed, to avoid conflict in functions. ## 更新日志 +* 1.1.4 + + 修复了对游戏版本0.10.29的支持 + * 1.1.3 + 支持游戏版本0.10.28.20759+ + 修复了当`UseFixedSpeed`设置为false且`SpeedMultiplier`设置为1时`RemoveSpeedLimitForStage1`无效的问题 diff --git a/MechaDronesTweaks/package/manifest.json b/MechaDronesTweaks/package/manifest.json index 009fda8..649ceb8 100644 --- a/MechaDronesTweaks/package/manifest.json +++ b/MechaDronesTweaks/package/manifest.json @@ -1,6 +1,6 @@ { "name": "MechaDronesTweaks", - "version_number": "1.1.3", + "version_number": "1.1.4", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/MechaDronesTweaks", "description": "Some tweaks for mecha drones and build functions(Successor to FastDrones MOD) / 机甲建设机和建设功能调整(FastDrones MOD的后继者)", "dependencies": [ diff --git a/UXAssist/FactoryPatch.cs b/UXAssist/FactoryPatch.cs index 4458be9..f06b281 100644 --- a/UXAssist/FactoryPatch.cs +++ b/UXAssist/FactoryPatch.cs @@ -350,7 +350,7 @@ public static class FactoryPatch * brtrue.s 2054 (173A) ldc.i4.s 17 * ldc.i4.s EBuildCondition.JointCannotLift (19) * br.s 2055 (173C) stfld valuetype EBuildCondition BuildPreview::condition - * ldc.i4.s EBuildCondition.EBuildCondition.JointCannotLift (19) (18) + * ldc.i4.s EBuildCondition.TooBendToLift (18) * stfld valuetype EBuildCondition BuildPreview::condition */ matcher.MatchForward(false, diff --git a/UXAssist/README.md b/UXAssist/README.md index 7512c88..fcf5dd1 100644 --- a/UXAssist/README.md +++ b/UXAssist/README.md @@ -4,6 +4,13 @@ #### 一些提升用户体验的功能和补丁 ## Changlog +* 1.0.13 + + `Off-grid building and stepped rotation`: show building coorinates(relative to grids) on building preview and building info panel now + + Increase maximum count of Metadata Instantiations to 20000 (from 2000) + + Increase capacity of player order queue to 128 (from 16) + + Fix issue caused by game updates + - `Remove some build conditions`: fixed issue that some conditions are not eliminated + - `Re-initialize planet`: fixed crash issue * 1.0.12 + Fix a bug that ejectors aimed at even-numbered orbits stop working when `Stop ejectors when available nodes are all filled up` is enabled. * 1.0.11 @@ -54,6 +61,8 @@ + Strict hotkey dectection for build menu, thus building hotkeys(0~9, F1~F10, X, U) are not triggered while holding Ctrl/Alt/Shift. + Fix a bug that warning popup on `Veins Utilization` upgraded to level 8000+ + Sort blueprint structures before saving, to reduce generated blueprint data size a little + + Increase maximum count of Metadata Instantiations to 20000 (from 2000) + + Increase capacity of player order queue to 128 (from 16) * Features: + General - Enable game window resize @@ -92,6 +101,13 @@ * [OffGridConstruction](https://github.com/Velociraptor115-DSPModding/OffGridConstruction): Off-grid building & stepped rotation implementations ## 更新日志 +* 1.0.13 + + `脱离网格建造和小角度旋转`:现在在建造预览和建筑信息面板上显示建筑坐标(相对于网格) + + 将元数据提取的最大数量增加到20000(原来为2000) + + 将玩家指令队列的容量增加到128(原来为16) + + 修复了游戏更新导致的问题 + - `移除部分不影响游戏逻辑的建造条件`:修复了一些条件未被移除的问题 + - `初始化本行星`:修复了崩溃问题 * 1.0.12 + 修复了当`当可用节点全部造完时停止弹射`选项启用时,瞄准偶数轨道的弹射器停止工作的bug * 1.0.11 @@ -147,6 +163,8 @@ - 可调整游戏窗口大小(可最大化和拖动边框) - 记住上次退出时的窗口位置和大小 - 在加载和平模式存档时将其转换为战斗模式 + - 将元数据提取的最大数量增加到20000(原来为2000) + - 将玩家指令队列的容量增加到128(原来为16) + 行星/工厂 - 无限交互距离 - 夜间日光灯 diff --git a/UXAssist/TODO.md b/UXAssist/TODO.md index 8360cb9..4e8039f 100644 --- a/UXAssist/TODO.md +++ b/UXAssist/TODO.md @@ -1,4 +1 @@ #### TODO -* Show coordinates of buildings, on both preview-mode and panel -* Better handling of consuming metadata -* More queued commands diff --git a/UXAssist/UXAssist.cs b/UXAssist/UXAssist.cs index 5451e5f..a2d6eaf 100644 --- a/UXAssist/UXAssist.cs +++ b/UXAssist/UXAssist.cs @@ -284,30 +284,68 @@ public class UXAssist : BaseUnityPlugin } } - // Can set belt icon tag to float, and increase maximum belt icon tag length to 8 - [HarmonyPostfix] - [HarmonyPatch(typeof(UIBeltWindow), nameof(UIBeltWindow._OnCreate))] - private static void UIBeltWindow_OnCreate_Postfix(UIBeltWindow __instance) + // Increase maximum value of property realizing, 2000 -> 20000 + [HarmonyTranspiler] + [HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.UpdateUIElements))] + [HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.OnRealizeButtonClick))] + [HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.OnInputValueEnd))] + private static IEnumerable UIProductEntry_UpdateUIElements_Transpiler(IEnumerable instructions, ILGenerator generator) { - __instance.iconTagCountInput.contentType = InputField.ContentType.DecimalNumber; - __instance.iconTagCountInput.characterLimit = 8; + var matcher = new CodeMatcher(instructions, generator); + matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldc_I4, 2000) + ); + matcher.Repeat(m => + { + m.SetAndAdvance(OpCodes.Ldc_I4, 20000); + }); + return matcher.InstructionEnumeration(); } [HarmonyTranspiler] - [HarmonyPatch(typeof(UIBeltWindow), nameof(UIBeltWindow._OnUpdate))] - private static IEnumerable UIBeltWindow_OnUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) + [HarmonyPatch(typeof(UIPropertyEntry), nameof(UIPropertyEntry.OnInputValueEnd))] + private static IEnumerable UIProductEntry_OnInputValueEnd_Transpiler(IEnumerable instructions, ILGenerator generator) { var matcher = new CodeMatcher(instructions, generator); - matcher.End().MatchBack(false, - new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(UIBeltWindow), nameof(UIBeltWindow.iconTagCountInput))), - new CodeMatch(ci => ci.opcode == OpCodes.Ldloca || ci.opcode == OpCodes.Ldloca_S), - new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(float), nameof(float.ToString), [])) + matcher.MatchForward(false, + new CodeMatch(ci => ci.opcode == OpCodes.Ldc_R4 && ci.OperandIs(2000f)) ); - matcher.Advance(2).InsertAndAdvance( - new CodeInstruction(OpCodes.Ldstr, "G8") - ).Set( - OpCodes.Call, AccessTools.Method(typeof(float), nameof(float.ToString), [typeof(string)]) + matcher.Repeat(m => + { + m.SetAndAdvance(OpCodes.Ldc_R4, 20000f); + }); + return matcher.InstructionEnumeration(); + } + + // Increase capacity of player order queue, 16 -> 128 + [HarmonyTranspiler] + [HarmonyPatch(typeof(PlayerOrder), MethodType.Constructor, typeof(Player))] + private static IEnumerable PlayerOrder_Constructor_Transpiler(IEnumerable instructions, ILGenerator generator) + { + var matcher = new CodeMatcher(instructions, generator); + matcher.MatchForward(false, + new CodeMatch(ci => (ci.opcode == OpCodes.Ldc_I4_S || ci.opcode == OpCodes.Ldc_I4) && ci.OperandIs(16)) ); + matcher.Repeat(m => + { + m.SetAndAdvance(OpCodes.Ldc_I4, 128); + }); + return matcher.InstructionEnumeration(); + } + + [HarmonyTranspiler] + [HarmonyPatch(typeof(PlayerOrder), nameof(PlayerOrder._trimEnd))] + [HarmonyPatch(typeof(PlayerOrder), nameof(PlayerOrder.Enqueue))] + private static IEnumerable PlayerOrder_ExtendCount_Transpiler(IEnumerable instructions, ILGenerator generator) + { + var matcher = new CodeMatcher(instructions, generator); + matcher.MatchForward(false, + new CodeMatch(ci => (ci.opcode == OpCodes.Ldc_I4_S || ci.opcode == OpCodes.Ldc_I4) && ci.OperandIs(16)) + ); + matcher.Repeat(m => + { + m.SetAndAdvance(OpCodes.Ldc_I4, 128); + }); return matcher.InstructionEnumeration(); } } diff --git a/UXAssist/UXAssist.csproj b/UXAssist/UXAssist.csproj index 612d151..274eb26 100644 --- a/UXAssist/UXAssist.csproj +++ b/UXAssist/UXAssist.csproj @@ -4,7 +4,7 @@ net472 org.soardev.uxassist DSP MOD - UXAssist - 1.0.12 + 1.0.13 true latest UXAssist @@ -15,7 +15,7 @@ - + diff --git a/UXAssist/package/manifest.json b/UXAssist/package/manifest.json index 60f9542..1c59e4f 100644 --- a/UXAssist/package/manifest.json +++ b/UXAssist/package/manifest.json @@ -1,6 +1,6 @@ { "name": "UXAssist", - "version_number": "1.0.12", + "version_number": "1.0.13", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "dependencies": [