From d6b00b1b786e2de004229224719ca4332b896965 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sat, 7 Mar 2026 20:46:30 +0800 Subject: [PATCH] UXAssist 1.5.5 --- UXAssist/CHANGELOG.md | 36 +++++++++++---- UXAssist/Functions/PlanetFunctions.cs | 63 +++++++++++++++++++++------ UXAssist/README.md | 4 +- UXAssist/UXAssist.csproj | 2 +- UXAssist/package/manifest.json | 2 +- 5 files changed, 81 insertions(+), 26 deletions(-) diff --git a/UXAssist/CHANGELOG.md b/UXAssist/CHANGELOG.md index 3d04297..7a9d16d 100644 --- a/UXAssist/CHANGELOG.md +++ b/UXAssist/CHANGELOG.md @@ -3,6 +3,15 @@ ## Changlog +* 1.5.5 + * `Initialize This Planet`: + * Fix crash issue. + * Add 3 options to return certain items. + * Enable `Hide UI` function(`F11` by default) while on Star Map view: Hide all other elements in universe. + * Fix warning from abnormal check for following features: + * `Unlock all techs with metadata` + * `Disable battle-related techs in Peace mode` + * ``Restore upgrades of `Sorter Cargo Stacking` on panel`` * 1.5.4 * `Auto-contruct`: * Add a UI option to hide it completely. @@ -12,7 +21,7 @@ * New feature: `Auto-contruct` * Fly to buildings to be contructed automatically. * `Auto-cruise`: Do not try to fly away planet when `Drive Engine 2` is not researched. - * `Re-intialize planet`: Fix logistic station ships rendering issue. + * `Initialize This Planet`: Fix logistic station ships rendering issue. * Copying Wireless Power Tower works as expected when `Drag building power poles in maximum connection range` and `Build Tesla Tower and Wireless Power Tower alternately` are enabled. * `Belt signals for buy out dark fog items automatically`: Grid position on panel is moved to avoid conflict with newly added signals. * Fix implementation of ``Restore upgrades of `Sorter Cargo Stacking` on panel`` to make it working again. @@ -28,7 +37,7 @@ * `Night Sunlight`: Fix bugs that sunlight angle is not updated after loading a save. * `Enhanced control for logistic storage capacities`: Working for Logistics Control Panel now. * `Protect veins from exhaustion`: Fix a minor bug. - * `Re-intialize planet`: Improve stability and fix some bugs. + * `Initialize This Planet`: Improve stability and fix some bugs. * 1.4.5 * New feature: `Ctrl+Shift+Click to pick items from whole belts`, with 2 suboptions: `Include branches of belts` and `Include connected inserters` * Patch [BlueprintTweaks](https://thunderstore.io/c/dyson-sphere-program/p/kremnev8/BlueprintTweaks/) temporarily to fix `Drag Remove` functions (And wait for limoka to merge the [Pull Request](https://github.com/limoka/DSP-Mods/pull/133)): @@ -62,7 +71,7 @@ * Fix background image issue for tab buttons on config window. * Now build in C# `Debug` Configuration, to avoid some issues caused by optimizations in `Release` Configuration. * 1.3.7 - * `Re-initialize planet`: Fix a possible crash. + * `Initialize This Planet`: Fix a possible crash. * `Auto-config logistic stations`: Add `Set default remote logic to storage` * 1.3.6 * `Dismantle blueprint selected buildings`: @@ -79,7 +88,7 @@ * 1.3.3 * `Starmap filter`: Hide top overlaping windows while the filter UI is shown. * `Auto-config logistic stations`: Can set Max. Charging Power for Battlefield Analysis Base now. - * `Re-initialize planet`: Fix a crash. + * `Initialize This Planet`: Fix a crash. * `Auto navigation on sailings`: * Add a button to enable/disable `Auto-cruise` quickly. * Do not auto-use Warper if required Tech is not researched. @@ -94,7 +103,7 @@ * New button: `Unlock all techs with metadata` * Add a checkbox to make union of results in starmap filter. * Fix some starmap vein/planet filter conditions. - * Fix a crash caused by `Re-initialize planet` in peace mode. + * Fix a crash caused by `Initialize This Planet` in peace mode. * Fix compatibility with `NebulaMultiplayerMod`. * 1.3.1 * Fix an issue that some UI elements are hidden while hitting the newly added combobox on Starmap. @@ -294,7 +303,7 @@ * Fix some issues in `Auto nativation` and `Auto-cruise`, now only boosts when core energy at least 10% and warps when core energy at least 50% * 1.0.20 * Fix an infinite-loop issue when `Quick build and dismantle stacking labs` and `No condition build` are both enabled - * Fix a crash caused by `Re-initialize planet` in combat mode + * Fix a crash caused by `Initialize This Planet` in combat mode * 1.0.19 * New functions: * `Quick build and dismantle stacking labs` @@ -324,7 +333,7 @@ * Enable `Hide UI` function(`F11` by default) while on Star Map view * New function: `Treat stack items as single in monitor components` * 1.0.14 - * Fix crash in `Re-initialize planet` again + * Fix crash in `Initialize This Planet` again * `Off-grid building and stepped rotation`: Add Z coordinate to display, and adjust the precision to 4 decimal after point * 1.0.13 * `Off-grid building and stepped rotation`: show building coordinates(relative to grids) on building preview and building info panel now @@ -332,7 +341,7 @@ * 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 + * `Initialize This 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 @@ -359,7 +368,7 @@ * Fix an issue that window position not restored and can not be resized when function is enabled but game is started with different mod profiles. * 1.0.3 * Add new function: `Quick build Orbital Collectors`. - * Add confirmation popup for `Re-intialize planet`, `Quick dismantle all buildings`, `Re-initialize Dyson Spheres` and `Quick dismantle Dyson Shells`. + * Add confirmation popup for `Initialize This Planet`, `Quick dismantle all buildings`, `Re-initialize Dyson Spheres` and `Quick dismantle Dyson Shells`. * Fix error on `Remove build count and range limit` when building a large amount of belts. * Fix an issue that window position not saved correctly when quit game without using in-game menu. * 1.0.2 @@ -382,6 +391,15 @@ ## 更新日志 +* 1.5.5 + * `初始化本行星`: + * 修复崩溃问题。 + * 增加了3个可返还特定物品的选项。 + * 在星图视图中启用`隐藏UI`功能(默认按键为`F11`): 隐藏所有其他宇宙元素。 + * 修复以下功能的异常检查警告: + * `使用元数据解锁所有科技` + * `在和平模式下隐藏战斗相关科技` + * ``在升级面板上恢复`分拣器货物堆叠`的升级`` * 1.5.4 * `自动建造`: * 增加了一个 UI 选项,可完全隐藏该功能。 diff --git a/UXAssist/Functions/PlanetFunctions.cs b/UXAssist/Functions/PlanetFunctions.cs index 4bcc18a..caf6b74 100644 --- a/UXAssist/Functions/PlanetFunctions.cs +++ b/UXAssist/Functions/PlanetFunctions.cs @@ -77,7 +77,7 @@ public static class PlanetFunctions player.controller.actionBuild.Close(); var groundCombatModule = player.mecha.groundCombatModule; - for (var i = 0; i < groundCombatModule.moduleFleets.Length; i++) + for (var i = groundCombatModule.moduleFleets.Length - 1; i >= 0; i--) { var entry = groundCombatModule.moduleFleets[i]; if (entry.fleetId <= 0 || !entry.fleetEnabled) continue; @@ -86,7 +86,7 @@ public static class PlanetFunctions } var constructionSystem = factory.constructionSystem; var constructionModule = player.mecha.constructionModule; - for (var i = 0; i < constructionSystem.drones.cursor; i++) + for (var i = constructionSystem.drones.cursor - 1; i > 0; i--) { ref var drone = ref constructionSystem.drones.buffer[i]; if (drone.id <= 0) continue; @@ -104,11 +104,14 @@ public static class PlanetFunctions constructionSystem.constructionModules[owner].droneIdleCount++; } } - for (var i = 0; i < constructionSystem.constructStats.cursor; i++) + if (constructionSystem.constructStats?.buffer != null) { - ref var constructStat = ref constructionSystem.constructStats.buffer[i]; - if (constructStat.id <= 0) continue; - constructionSystem.RemoveConstructStat(constructStat.id); + for (var i = constructionSystem.constructStats.cursor - 1; i > 0; i++) + { + ref var constructStat = ref constructionSystem.constructStats.buffer[i]; + if (constructStat.id <= 0) continue; + constructionSystem.RemoveConstructStat(constructStat.id); + } } constructionModule.autoReconstructTargetTotalCount = 0; constructionModule.buildTargetTotalCount = 0; @@ -286,10 +289,10 @@ public static class PlanetFunctions } if (lab.researchMode && lab.matrixServed != null) { - for (var k = lab.matrixServed.Length - 1; k >= 0; k--) + for (var j = lab.matrixServed.Length - 1; j >= 0; j--) { - var served = lab.matrixServed[k] / 3600; - if (served > 0) AddReturnedItem(LabComponent.matrixIds[k], served, lab.matrixIncServed[k] / 3600, returnedItems); + var served = lab.matrixServed[j] / 3600; + if (served > 0) AddReturnedItem(LabComponent.matrixIds[j], served, lab.matrixIncServed[j] / 3600, returnedItems); } } } @@ -389,6 +392,38 @@ public static class PlanetFunctions } #endregion } + if (returnBeltAFactoryItems) + { + #region Belt Items + for (var i = cargoTraffic.pathCursor - 1; i > 0; i--) + { + var cargoPath = cargoTraffic.pathPool[i]; + if (cargoPath == null) continue; + var end = cargoPath.bufferLength - 5; + var buffer = cargoPath.buffer; + for (var j = 0; j <= end;) + { + if (buffer[j] >= 246) + { + j += 250 - buffer[j]; + var bufferIndex = buffer[j + 1] - 1 + (buffer[j + 2] - 1) * 100 + (buffer[j + 3] - 1) * 10000 + (buffer[j + 4] - 1) * 1000000; + ref var cargo = ref cargoPath.cargoContainer.cargoPool[bufferIndex]; + var stack = cargo.stack; + if (stack > 0) AddReturnedItem(cargo.item, stack, cargo.inc, returnedItems); + j += 10; + } + else + { + j += 5; + if (j > end && j < end + 5) + { + j = end; + } + } + } + } + #endregion + } } var stationPool = factory.transport?.stationPool; @@ -401,7 +436,7 @@ public static class PlanetFunctions if (sc is null || sc.id != i) continue; if (returnLogisticStorageItems) { - for (var j = 0; j < sc.storage.Length; j++) + for (var j = sc.storage.Length - 1; j >= 0; j--) { var count = sc.storage[j].count; if (count > 0) AddReturnedItem(sc.storage[j].itemId, count, sc.storage[j].inc, returnedItems); @@ -580,7 +615,7 @@ public static class PlanetFunctions factory.constructionSystem = new ConstructionSystem(planet); if (factory.veinPool != null) { - for (var i = 0; i < factory.veinPool.Length; i++) + for (var i = factory.veinPool.Length - 1; i >= 0; i--) { ref var vein = ref factory.veinPool[i]; if (vein.id != i) continue; @@ -642,7 +677,7 @@ public static class PlanetFunctions var entityPool = factory.entityPool; var pos = new Vector3(0f, 0f, planet.realRadius * 1.025f + 0.2f); var found = false; - for (var i = 1; i < stationCursor; i++) + for (var i = stationCursor - 1; i > 0; i--) { if (stationPool[i] == null || stationPool[i].id != i) continue; ref var entity = ref entityPool[stationPool[i].entityId]; @@ -654,7 +689,7 @@ public static class PlanetFunctions var prebuildPool = factory.prebuildPool; if (!found) { - for (var i = 1; i < prebuildCursor; i++) + for (var i = prebuildCursor - 1; i > 0; i--) { if (prebuildPool[i].id != i) continue; pos = prebuildPool[i].pos; @@ -677,7 +712,7 @@ public static class PlanetFunctions { /* Check for collision */ var collide = false; - for (var j = 1; j < stationCursor; j++) + for (var j = stationCursor - 1; j > 0; j--) { if (stationPool[j] == null || stationPool[j].id != j) continue; if ((entityPool[stationPool[j].entityId].pos - pos).sqrMagnitude >= 14297f) continue; diff --git a/UXAssist/README.md b/UXAssist/README.md index 563d67e..160f1a3 100644 --- a/UXAssist/README.md +++ b/UXAssist/README.md @@ -65,7 +65,8 @@ * Dismantle blueprint selected buildings * Press shortcut key in blueprint copy mode to dismantle selected buildings. * The default shortcut key is Ctrl+X, you can set it in system options panel. - * Re-intialize planet (without reseting veins) + * Initialize This Planet (without reseting veins) + * 3 Options to return certain items * Quick dismantle all buildings (without drops) * Quick build Orbital Collectors * Belt signals for buy out dark fog items automatically @@ -228,6 +229,7 @@ * 在蓝图复制模式下按快捷键拆除选中的建筑 * 默认快捷键是Ctrl+X,可以在系统选项面板中设置 * 初始化本行星(不重置矿脉) + * 有3个可返还特定物品的选项 * 快速拆除所有建筑(不掉落) * 快速建造轨道采集器 * 用于自动购买黑雾物品的传送带信号 diff --git a/UXAssist/UXAssist.csproj b/UXAssist/UXAssist.csproj index 2ee36a5..587582d 100644 --- a/UXAssist/UXAssist.csproj +++ b/UXAssist/UXAssist.csproj @@ -4,7 +4,7 @@ net472 org.soardev.uxassist DSP MOD - UXAssist - 1.5.4 + 1.5.5 true latest UXAssist diff --git a/UXAssist/package/manifest.json b/UXAssist/package/manifest.json index db1eab0..4c6604a 100644 --- a/UXAssist/package/manifest.json +++ b/UXAssist/package/manifest.json @@ -1,6 +1,6 @@ { "name": "UXAssist", - "version_number": "1.5.4", + "version_number": "1.5.5", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "dependencies": [