From 0a8fa9971ca103765584a5bc4dff33b90e1afdc2 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Fri, 24 Jan 2025 19:20:51 +0800 Subject: [PATCH] UXAssist 1.2.14 & CheatEnabler 2.3.27 --- CheatEnabler/CHANGELOG.md | 6 +++- CheatEnabler/CheatEnabler.csproj | 2 +- CheatEnabler/Patches/DysonSpherePatch.cs | 37 ++++++++++++------------ CheatEnabler/package/manifest.json | 2 +- UXAssist/CHANGELOG.md | 22 +++++++++----- UXAssist/Patches/DysonSpherePatch.cs | 24 ++++++++++++--- UXAssist/UI/MyWindow.cs | 4 +-- UXAssist/UXAssist.csproj | 2 +- UXAssist/package/manifest.json | 2 +- 9 files changed, 63 insertions(+), 38 deletions(-) diff --git a/CheatEnabler/CHANGELOG.md b/CheatEnabler/CHANGELOG.md index 7e8eb82..ea94328 100644 --- a/CheatEnabler/CHANGELOG.md +++ b/CheatEnabler/CHANGELOG.md @@ -1,5 +1,7 @@ ## Changlog +* 2.3.27 + + `Skip bullet period` & `Eject anyway`: Fix compatibility with `Dyson Sphere Program v0.10.32.25496`. * 2.3.26 + Refactor codes to adapt to UXAssist 1.2.0 - You should update UXAssist to 1.2.0 or later before using this version. @@ -141,6 +143,8 @@ ## 更新日志 +* 2.3.27 + + `跳过子弹阶段`和`全球弹射`:修复了与`戴森球计划 v0.10.32.25496`的兼容性 * 2.3.26 + 重构代码以适应UXAssist 1.2.0 - 在使用此版本之前,您应先更新UXAssist到1.2.0或更高版本。 @@ -153,7 +157,7 @@
更早的版本 -2.3.24 +* 2.3.24 + `立即完成戴森壳建造`:修复了在某些情况下可能导致发电为负的问题 * 2.3.23 + 新功能:`立即完成戴森壳建造` diff --git a/CheatEnabler/CheatEnabler.csproj b/CheatEnabler/CheatEnabler.csproj index 01a99af..9f08495 100644 --- a/CheatEnabler/CheatEnabler.csproj +++ b/CheatEnabler/CheatEnabler.csproj @@ -5,7 +5,7 @@ net472 org.soardev.cheatenabler DSP MOD - CheatEnabler - 2.3.26 + 2.3.27 true latest CheatEnabler diff --git a/CheatEnabler/Patches/DysonSpherePatch.cs b/CheatEnabler/Patches/DysonSpherePatch.cs index de07851..3151063 100644 --- a/CheatEnabler/Patches/DysonSpherePatch.cs +++ b/CheatEnabler/Patches/DysonSpherePatch.cs @@ -179,11 +179,11 @@ public class DysonSpherePatch: PatchImpl ).Advance(1); var end = matcher.Pos; matcher.Start().Advance(start).RemoveInstructions(end - start).Insert( - new CodeInstruction(OpCodes.Ldarg_2), + new CodeInstruction(OpCodes.Ldarg_3), new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.orbitId))), - new CodeInstruction(OpCodes.Ldloc_S, 8), - new CodeInstruction(OpCodes.Ldloc_S, 10), + new CodeInstruction(OpCodes.Ldloc_S, 9), + new CodeInstruction(OpCodes.Ldloc_S, 11), new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(SkipBulletPatch), nameof(SkipBulletPatch.AddDysonSail))) ); return matcher.InstructionEnumeration(); @@ -391,26 +391,25 @@ public class DysonSpherePatch: PatchImpl private static IEnumerable EjectorComponent_InternalUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) { var matcher = new CodeMatcher(instructions, generator); - matcher.MatchForward(false, + matcher.End().MatchBack(false, new CodeMatch(instr => instr.opcode == OpCodes.Ldc_R8 && Math.Abs((double)instr.operand - 0.08715574) < 0.00000001) ); var start = matcher.Pos - 3; matcher.MatchForward(false, - new CodeMatch(OpCodes.And) - ).Advance(1).MatchForward(false, - new CodeMatch(OpCodes.And) + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.bulletCount))) ); - var end = matcher.Pos - 2; - /* Remove angle checking codes, then add: - * V_13 = this.bulletCount > 0; - */ - matcher.Start().Advance(start).RemoveInstructions(end - start).Insert( - new CodeInstruction(OpCodes.Ldarg_0), - new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.bulletCount))), - new CodeInstruction(OpCodes.Ldc_I4_0), - new CodeInstruction(OpCodes.Cgt), - new CodeInstruction(OpCodes.Stloc_S, 13) + var end = matcher.Pos; + matcher.Start().Advance(start).RemoveInstructions(end - start).MatchForward(false, + new CodeMatch(ci => ci.IsStloc()) + ).Advance(1); + start = matcher.Pos; + matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.autoOrbit))) ); + end = matcher.Pos; + matcher.Start().Advance(start).RemoveInstructions(end - start); return matcher.InstructionEnumeration(); } } @@ -419,7 +418,7 @@ public class DysonSpherePatch: PatchImpl { [HarmonyTranspiler] [HarmonyPatch(typeof(EjectorComponent), nameof(EjectorComponent.InternalUpdate))] - private static IEnumerable EjectAndSiloComponent_InternalUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) + private static IEnumerable EjectComponent_InternalUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) { var matcher = new CodeMatcher(instructions, generator); /* Add a multiply to ejector speed */ @@ -472,7 +471,7 @@ public class DysonSpherePatch: PatchImpl { [HarmonyTranspiler] [HarmonyPatch(typeof(SiloComponent), nameof(SiloComponent.InternalUpdate))] - private static IEnumerable EjectAndSiloComponent_InternalUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) + private static IEnumerable SiloComponent_InternalUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) { var matcher = new CodeMatcher(instructions, generator); /* Add a multiply to ejector speed */ diff --git a/CheatEnabler/package/manifest.json b/CheatEnabler/package/manifest.json index 598aa0d..72e0f3d 100644 --- a/CheatEnabler/package/manifest.json +++ b/CheatEnabler/package/manifest.json @@ -1,6 +1,6 @@ { "name": "CheatEnabler", - "version_number": "2.3.26", + "version_number": "2.3.27", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler", "description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测", "dependencies": [ diff --git a/UXAssist/CHANGELOG.md b/UXAssist/CHANGELOG.md index 50c16f4..1625cef 100644 --- a/UXAssist/CHANGELOG.md +++ b/UXAssist/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changlog +* 1.2.14 + + Fix an issue that an unexpected menu icon is shown in the top-right corner of the config panel. + + `Stop ejectors when available nodes are all filled up`: Fix compatibility with `Dyson Sphere Program v0.10.32.25496`. * 1.2.13 + `Belt signals for buy out dark fog items automatically`: Fix possible crashes. + `Logistics Control Panel Improvement`: Auto apply filter with in-hand item now. @@ -12,6 +15,10 @@ * 1.2.10 + `Set enabled CPU threads`: Fix hybrid-architect check for CPUs without hyper-threading + `Re-initialize Dyson Spheres` and `Quick dismantle Dyson Shells`: Fix possible crashes and a display issue, while Dyson Sphere panel is actived. + +
+Older versions + * 1.2.9 + `Protect veins from exhaustion`: - Fix a bug that vein protection causes crashes (#50). @@ -35,10 +42,6 @@ + New feature: `Set process priority` + New feature: `Set enabled CPU threads` + `Drag building power poles in maximum connection range`: Add a new config option `Build Tesla Tower and Wireless Power Tower alternately` - -
-Older versions - * 1.2.4 + `Sunlight at night`: - Fix flickering issue while mecha is sailing. @@ -233,6 +236,9 @@ ## 更新日志 +* 1.2.14 + + 修正设置窗口右上角多出一个菜单图标的问题 + + `当可用节点全部造完时停止弹射`:修复了与`戴森球计划 v0.10.32.25496`的兼容性 * 1.2.13 + `用于自动购买黑雾物品的传送带信号`:修复了可能导致崩溃的问题 + `物流控制面板改进`:现在也自动将拿着的物品设为筛选条件 @@ -245,6 +251,10 @@ * 1.2.10 + `设置使用的CPU线程`:修复了对没有超线程的CPU的大小核检查 + `初始化戴森球`和`快速拆除戴森壳`:修复了在戴森球面板激活时可能导致崩溃的问题,以及显示错误的问题。 + +
+Older versions + * 1.2.9 + `保护矿脉不会耗尽`: - 修复了矿脉保护导致崩溃的问题(#50) @@ -268,10 +278,6 @@ + 新功能:`设置进程优先级` + 新功能:`设置使用的CPU线程` + `拖动建造电线杆时自动使用最大连接距离间隔`:添加一个新的设置项`交替建造电力感应塔和无线输电塔` - -
-更早的版本 - * 1.2.4 + `夜间日光灯`: - 修复了航行时闪烁的问题 diff --git a/UXAssist/Patches/DysonSpherePatch.cs b/UXAssist/Patches/DysonSpherePatch.cs index 6ffb98b..cea31a8 100644 --- a/UXAssist/Patches/DysonSpherePatch.cs +++ b/UXAssist/Patches/DysonSpherePatch.cs @@ -389,20 +389,36 @@ public class DysonSpherePatch: PatchImpl { var matcher = new CodeMatcher(instructions, generator); matcher.MatchForward(false, - // if (this.orbitId == 0 + // if (this.runtimeOrbitId == 0 new CodeMatch(OpCodes.Ldarg_0), - new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.orbitId))), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.runtimeOrbitId))), new CodeMatch(OpCodes.Brtrue) - ).Advance(2).Insert( + ).Advance(2).InsertAndAdvance( // || !StopEjectOnNodeComplete.AnyNodeForAbsorb(this.starData.index)) new CodeInstruction(OpCodes.Ldc_I4_0), new CodeInstruction(OpCodes.Cgt), - new CodeInstruction(OpCodes.Ldarg_2), + new CodeInstruction(OpCodes.Ldarg_3), new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(DysonSwarm), nameof(DysonSwarm.starData))), new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(StarData), nameof(StarData.index))), new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(StopEjectOnNodeComplete), nameof(AnyNodeForAbsorb))), new CodeInstruction(OpCodes.And) ); + + // Do not search for next orbit if runtimeOrbitId is not 0 (which means nodes are completed) + Label? jmpTarget = null; + matcher.MatchForward(false, + new CodeMatch(OpCodes.Ldarg_0), + new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.autoOrbit))), + new CodeMatch(ci => ci.Branches(out jmpTarget)) + ); + if (jmpTarget == null) return matcher.InstructionEnumeration(); + var labels = matcher.Labels; + matcher.Labels = null; + matcher.Insert( + new CodeInstruction(OpCodes.Ldarg_0).WithLabels(labels), + new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.runtimeOrbitId))), + new CodeInstruction(OpCodes.Brtrue, jmpTarget.Value) + ); return matcher.InstructionEnumeration(); } diff --git a/UXAssist/UI/MyWindow.cs b/UXAssist/UI/MyWindow.cs index 4da36c1..3b785db 100644 --- a/UXAssist/UI/MyWindow.cs +++ b/UXAssist/UI/MyWindow.cs @@ -27,14 +27,14 @@ public class MyWindow : ManualBehaviour public static void InitBaseObject() { if (_baseObject) return; - var go = Instantiate(UIRoot.instance.uiGame.tankWindow.gameObject); + var go = Instantiate(UIRoot.instance.uiGame.inserterWindow.gameObject); go.SetActive(false); go.name = "my-window"; Destroy(go.GetComponent()); for (var i = 0; i < go.transform.childCount; i++) { var child = go.transform.GetChild(i).gameObject; - if (child.name != "panel-bg" && child.name != "shadow" && child.name != "panel-bg") + if (child.name != "panel-bg" && child.name != "shadow") { Destroy(child); } diff --git a/UXAssist/UXAssist.csproj b/UXAssist/UXAssist.csproj index e0209fa..5010ec1 100644 --- a/UXAssist/UXAssist.csproj +++ b/UXAssist/UXAssist.csproj @@ -4,7 +4,7 @@ net472 org.soardev.uxassist DSP MOD - UXAssist - 1.2.13 + 1.2.14 true latest UXAssist diff --git a/UXAssist/package/manifest.json b/UXAssist/package/manifest.json index 67d4694..999f764 100644 --- a/UXAssist/package/manifest.json +++ b/UXAssist/package/manifest.json @@ -1,6 +1,6 @@ { "name": "UXAssist", - "version_number": "1.2.13", + "version_number": "1.2.14", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "dependencies": [