From 69702d4f0926e022eaf1201ea3e69ab50c521585 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Mon, 31 Mar 2025 23:30:47 +0800 Subject: [PATCH] UXAssist & CheatEnabler update --- CheatEnabler/CHANGELOG.md | 4 +++ CheatEnabler/UIConfigWindow.cs | 2 +- CheatEnabler/package/manifest.json | 2 +- UXAssist/CHANGELOG.md | 6 ++++ UXAssist/Patches/FactoryPatch.cs | 52 ++++++++++++++++++------------ UXAssist/README.md | 4 +++ 6 files changed, 47 insertions(+), 23 deletions(-) diff --git a/CheatEnabler/CHANGELOG.md b/CheatEnabler/CHANGELOG.md index ada009d..87bcfbd 100644 --- a/CheatEnabler/CHANGELOG.md +++ b/CheatEnabler/CHANGELOG.md @@ -1,5 +1,7 @@ ## Changlog +* 2.3.29 + + Fix compatibility with game update 0.10.32.25779 * 2.3.28 + New feature: `Instant hand-craft`. + Fix some panels' display while `Infinite Natural Resources` is enabled. @@ -146,6 +148,8 @@ ## 更新日志 +* 2.3.29 + + 修复了与游戏更新0.10.32.25779的兼容性 * 2.3.28 + 新功能:`快速手动制造` + 修复了启用`自然资源采集不消耗`时部分面板的显示问题 diff --git a/CheatEnabler/UIConfigWindow.cs b/CheatEnabler/UIConfigWindow.cs index 8596241..d5e41ba 100644 --- a/CheatEnabler/UIConfigWindow.cs +++ b/CheatEnabler/UIConfigWindow.cs @@ -65,7 +65,7 @@ public static class UIConfigWindow I18N.Add("Overclock Silos", "Overclock Silos (10x)", "高速发射井(10倍射速)"); I18N.Add("Complete Dyson Sphere shells instantly", "Complete Dyson Sphere shells instantly", "立即完成戴森壳建造"); I18N.Add("Terraform without enough soil piles", "Terraform without enough soil piles", "沙土不够时依然可以整改地形"); - I18N.Add("Instant hand craft", "Instant hand-craft", "快速手动制造"); + I18N.Add("Instant hand-craft", "Instant hand-craft", "快速手动制造"); I18N.Add("Instant teleport (like that in Sandbox mode)", "Instant teleport (like that in Sandbox mode)", "快速传送(和沙盒模式一样)"); I18N.Add("Mecha and Drones/Fleets invicible", "Mecha and Drones/Fleets invicible", "机甲和战斗无人机无敌"); I18N.Add("Buildings invicible", "Buildings invincible", "建筑无敌"); diff --git a/CheatEnabler/package/manifest.json b/CheatEnabler/package/manifest.json index 5ea00de..7ebfc26 100644 --- a/CheatEnabler/package/manifest.json +++ b/CheatEnabler/package/manifest.json @@ -1,6 +1,6 @@ { "name": "CheatEnabler", - "version_number": "2.3.28", + "version_number": "2.3.29", "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 2c5ffc3..6c67b41 100644 --- a/UXAssist/CHANGELOG.md +++ b/UXAssist/CHANGELOG.md @@ -4,6 +4,9 @@ + New feature: `Cut conveyor belt` - Press shortcut key to cut conveyor belt under cursor. - The default shortcut key is Alt+X, you can set it in system options panel. + + New feature: `Profile based option` + - Option file is stored as `Options\.xml`. + + Fix compatibility with game update 0.10.32.25779 * 1.2.15 + `Off-grid building and stepped rotation`: Fix compatibility with DSP 0.10.32.25682. (#57) + `Enhanced control for logistic storage limits`: Try to fix possible crash. (#54) @@ -247,6 +250,9 @@ + 新功能:`切割传送带` - 按快捷键切割光标位置的传送带 - 默认快捷键是Alt+X,可以在系统选项面板中设置 + + 新功能:`基于mod管理器配置档案名` + - 选项文件存储在`Options\.xml`中 + + 修复了与游戏更新0.10.32.25779的兼容性 * 1.2.15 + `脱离网格建造和小角度旋转`:修复了与0.10.32.25682的兼容性 (#57) + `物流塔存储数量限制控制改进`:修复了可能导致崩溃的问题 (#54) diff --git a/UXAssist/Patches/FactoryPatch.cs b/UXAssist/Patches/FactoryPatch.cs index be8b16b..f52eac5 100644 --- a/UXAssist/Patches/FactoryPatch.cs +++ b/UXAssist/Patches/FactoryPatch.cs @@ -1041,36 +1041,35 @@ public class FactoryPatch : PatchImpl { var usedCount = 0; var maxAllowed = amount - KeepVeinAmount; - if (miningRate < 0.99999f) + var add = miningRate * (double)times; + __instance.costFrac += add; + var estimateUses = (int)__instance.costFrac; + if (estimateUses < maxAllowed) { - for (var i = 0; i < times; i++) - { - __instance.seed = (uint)((__instance.seed % 2147483646U + 1U) * 48271UL % 2147483647UL) - 1U; - usedCount += __instance.seed / 2147483646.0 < miningRate ? 1 : 0; - outputCount++; - if (usedCount == maxAllowed) - { - break; - } - } + outputCount = times; + usedCount = estimateUses; + __instance.costFrac -= estimateUses; } else { - outputCount = times > maxAllowed ? maxAllowed : times; - usedCount = outputCount; + usedCount = maxAllowed; + var oldFrac = __instance.costFrac - add; + var ratio = (usedCount - oldFrac) / add; + var realCost = times * ratio; + outputCount = (int)(Math.Ceiling(realCost) + 0.01); + __instance.costFrac = miningRate * (outputCount - realCost); } - if (usedCount > 0) { var groupIndex = (int)veinPool[veinId].groupIndex; - amount = veinPool[veinId].amount -= usedCount; + amount -= usedCount; if (amount < __instance.minimumVeinAmount) { __instance.minimumVeinAmount = amount; } var veinGroups = factory.veinGroups; - veinGroups[groupIndex].amount -= usedCount; + veinGroups[groupIndex].amount = amount; factory.veinAnimPool[veinId].time = amount >= 20000 ? 0f : 1f - 0.00005f; if (amount <= 0) { @@ -1149,13 +1148,24 @@ public class FactoryPatch : PatchImpl { var usedCount = 0; var maxAllowed = amount - _keepOilAmount; - for (var j = 0; j < times; j++) + var add = miningRate * (double)times; + __instance.costFrac += add; + var estimateUses = (int)__instance.costFrac; + if (estimateUses < maxAllowed) { - __instance.seed = (uint)((__instance.seed % 2147483646U + 1U) * 48271UL % 2147483647UL) - 1U; - usedCount += __instance.seed / 2147483646.0 < miningRate ? 1 : 0; - outputCount++; + outputCount = times; + usedCount = estimateUses; + __instance.costFrac -= estimateUses; + } + else + { + usedCount = maxAllowed; + var oldFrac = __instance.costFrac - add; + var ratio = (usedCount - oldFrac) / add; + var realCost = times * ratio; + outputCount = (int)(Math.Ceiling(realCost) + 0.01); + __instance.costFrac = miningRate * (outputCount - realCost); } - if (usedCount > 0) { if (usedCount > maxAllowed) diff --git a/UXAssist/README.md b/UXAssist/README.md index 241705c..a16eaa3 100644 --- a/UXAssist/README.md +++ b/UXAssist/README.md @@ -26,6 +26,8 @@ - Mod manager profile based save folder - Save files are stored in `Save\` folder. - Will use original save location if matching default profile name. + - Mod manager profile based option + - Option file is stored as `Options\.xml`. - Logical Frame Rate - This will change game running speed, down to 0.1x slower and up to 10x faster. - A pair of shortcut keys (`-` and `+`) to change the logical frame rate by -0.5x and +0.5x. @@ -147,6 +149,8 @@ - 基于mod管理器配置档案名的存档文件夹 - 存档文件会存储在`Save\`文件夹中 - 如果匹配默认配置档案名则使用原始存档位置 + - 基于mod管理器配置档案名的选项文件 + - 选项文件存储为`Options\.xml` - 逻辑帧倍率 - 这将改变游戏运行速度,最慢0.1倍,最快10倍 - 设置了一对快捷键(`-`和`+`),可以-/+0.5倍改变逻辑帧倍率