diff --git a/UXAssist/CHANGELOG.md b/UXAssist/CHANGELOG.md index 83305bc..c196fe3 100644 --- a/UXAssist/CHANGELOG.md +++ b/UXAssist/CHANGELOG.md @@ -1,7 +1,9 @@ ## Changlog -* 1.2.11 +* 1.2.12 + `Construct only structure points but frames`: Fix a bug that frames are still not constructed when this function is disabled. + + `Drag building power poles in maximum connection range`: Fix a bug that single power pole cannot be placed at some positions. +* 1.2.11 + Fix an issue caused by game update: tips are not shown when mouse hovering on tips button. * 1.2.10 + `Set enabled CPU threads`: Fix hybrid-architect check for CPUs without hyper-threading @@ -227,8 +229,10 @@ ## 更新日志 -* 1.2.11 +* 1.2.12 + `只建造节点不建造框架`:修复了关闭此功能时框架不进行建造的问题 + + `拖动建造电线杆时自动使用最大连接距离间隔`:修复了某些位置无法放置单个电线杆的问题 +* 1.2.11 + 修复了游戏更新导致的提示按钮鼠标悬停时不显示提示文字的问题 * 1.2.10 + `设置使用的CPU线程`:修复了对没有超线程的CPU的大小核检查 diff --git a/UXAssist/Patches/FactoryPatch.cs b/UXAssist/Patches/FactoryPatch.cs index d23eb0f..93162b9 100644 --- a/UXAssist/Patches/FactoryPatch.cs +++ b/UXAssist/Patches/FactoryPatch.cs @@ -1384,14 +1384,22 @@ public class FactoryPatch : PatchImpl { begin = begin.normalized; end = end.normalized; - var intervalAll = interval.x; - var radTotal = Mathf.Acos(Vector3.Dot(begin, end)); - var distTotal = radTotal * planetRadius; + var finalCount = 1; var ignoreGrid = VFInput._ignoreGrid; + if (ignoreGrid) + snaps[0] = begin; + else + snaps[0] = planetGrid.SnapTo(begin); + var dot = Vector3.Dot(begin, end); + if (dot is > 0.999999f or < -0.999999f) + return 1; + var distTotal = Mathf.Acos(dot) * planetRadius; - var maxCount = snaps.Length; - var finalCount = 0; + var intervalAll = interval.x; var maxT = 1f - intervalAll * 0.5f / distTotal; + if (maxT < 0f) + return 1; + var maxCount = snaps.Length; while (finalCount < maxCount) { var t = finalCount * intervalAll / distTotal; diff --git a/UXAssist/UXAssist.csproj b/UXAssist/UXAssist.csproj index 0dd564e..71983a2 100644 --- a/UXAssist/UXAssist.csproj +++ b/UXAssist/UXAssist.csproj @@ -4,7 +4,7 @@ net472 org.soardev.uxassist DSP MOD - UXAssist - 1.2.11 + 1.2.12 true latest UXAssist diff --git a/UXAssist/package/manifest.json b/UXAssist/package/manifest.json index e7b085a..45ffd42 100644 --- a/UXAssist/package/manifest.json +++ b/UXAssist/package/manifest.json @@ -1,6 +1,6 @@ { "name": "UXAssist", - "version_number": "1.2.11", + "version_number": "1.2.12", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "dependencies": [