Commit Graph
21 Commits
Author SHA1 Message Date
WinterG26andsoarqin d37f500926 Update PlayerPatch.cs
修复同时开启新旧算法的情况。
2026-07-22 14:23:13 +08:00
JimGandsoarqin bf73ccd689 ### 提交目的:
为玩家添加新的自动导航选项并集成新版导航算法。

### 修改内容:
- **新增** 新的导航算法选项及相关功能:
  - 支持启用/禁用新版导航算法。
  - 自动导航选项支持到达目标或输入时自动暂停。
  - 添加曲速启用选项、最低能量限制及使用距离的设置。
  - 添加自动加速选项及其最低能量限制。
  - 黑雾巢穴和火种的跟踪距离参数支持自定义。
- **扩展** `DistanceMapper` 类,增加了对巢穴及火种跟踪距离映射的支持。
- **更新** 玩家界面,以支持导航算法相关的多项新配置:
  - 在 UI 中增加多个与新版导航算法相关的开关、滑块和提示文本。
- **调整** 自动导航逻辑,新增多项参数以提升日志提示和控制细粒度。

### 一般性修改:
- 优化代码逻辑,分类整理导航功能和方法。
- 增加部分注释以提高代码可读性。
- **重构** 部分导航流程代码,减少重复实现,提高可维护性。
2026-07-22 14:23:13 +08:00
soarqin f69a90d452 Fix potential bugs in UXAssist and CheatEnabler
UXAssist:
- PlanetFunctions: fix infinite loop in constructStats cleanup (i++ -> i--)
- PlanetFunctions: skip entityPool slot 0 (sentinel) in DismantleAll foreach
- PlanetFunctions: fix belt buffer walk infinite loop when buffer[j]==250,
  add cargoPool bounds check
- FactoryPatch: fix UnfixProto guard condition (< 3 -> < PowerPoleIds.Length)
- FactoryPatch: fix Array.Resize(index*2) -> (index+1)*2 to handle index==0
- LogisticsPatch: fix UpdateStorageMax early-exit to check both local and remote
- LogisticsPatch: fix storage max scan to use Math.Max instead of last-write
- LogisticsPatch: add divide-by-zero guard in station storage ratio calculation
- LogisticsPatch: fix station entry right-click delegates using per-instance
  dictionary instead of shared static array to prevent unsubscribe mismatch
- LogisticsPatch: add null checks for GameObject.Find results in InitGUI
- GamePatch: log exception in previously empty catch block
- GameLogic: invoke event handlers individually with try/catch so one failing
  subscriber does not abort subsequent ones
- DysonSpherePatch/LogisticsPatch/PersistPatch/PlayerPatch: replace
  matcher.Labels = null with matcher.Labels = [] (5 sites)
- UIConfigWindow: remove duplicate I18N.Add for 'Outgoing integration count'
- UIConfigWindow: remove two orphaned y += 36f spacing increments

CheatEnabler:
- GamePatch: add null check for GameMain.gameScenario in AbnormalDisabler.OnEnable
- FactoryPatch: add null check for GameMain.mainPlayer in TakeTailItemsPatch
  and GetItemCountPatch
- FactoryPatch: add null check for GameMain.mainPlayer in
  ConstructionSystem_GameTick_Prefix
- FactoryPatch: fix _portalFrom.Remove(beltId) -> Remove(v) (wrong key)
- FactoryPatch: add null guard for GameMain.data before iterating factories
  in WindTurbinesPowerGlobalCoverage
- DysonSphereFunctions: fix shell pool rebuild loop writing all shells to
  slot 1 (id=1); now uses j+1 per iteration
- DysonSphereFunctions: replace GameMain.gameScenario.NotifyOnPlanDysonShell()
  with null-conditional call (?.) at 4 sites
- DysonSpherePatch: fix SkipAbsorbPatch/QuickAbsorbPatch sharing _instantAbsorb:
  OnDisable now recalculates the flag instead of unconditionally clearing it
- PlayerFunctions: add null check for GameMain.galaxy in TeleportToOuterSpace
- UIConfigWindow: add null guard in UpdateButtons before accessing button fields
- PlanetFunctions: add colliderId bounds check in BuryAllVeins
2026-03-16 19:52:14 +08:00
soarqin 91184ccc3a UXAssist 1.5.4 2026-02-15 22:34:24 +08:00
soarqin d9d1e0108f UXAssist: fix auto cruise 2026-02-05 18:33:40 +08:00
soarqin ed8d7d61ff partial fix for new game release 2026-01-22 22:45:02 +08:00
soarqin c7465133f7 UXAssist v1.3.3 2025-05-10 00:50:11 +08:00
soarqin ac2cc258ee UXAssist: tweak autonav a bit 2025-05-04 16:11:06 +08:00
soarqin fb3a74c7e7 Auto navigation on sailings: Do not auto-use Warper if required Tech is not researched. 2025-05-02 20:18:43 +08:00
soarqin 2124719de0 UXAssist: v1.3.1 2025-04-26 23:51:58 +08:00
soarqin 150868fcea work in progress 2025-04-23 21:26:11 +08:00
soarqin 1ae4aa3ecb work in progress 2025-04-23 02:50:33 +08:00
soarqin 5c187fb32e bug fix 2025-04-22 19:17:40 +08:00
soarqin e765f0f42d work in progress 2025-04-22 01:58:07 +08:00
soarqin 78379165e8 work in progress 2025-04-21 00:42:55 +08:00
soarqin 1d01fdbd15 UXAssist v1.2.19 2025-04-16 15:49:14 +08:00
soarqin a3bb6ea609 try to fix connection bug in feature Cut Conveyor Belt 2025-04-15 23:58:32 +08:00
soarqin ac7f2ef63c UXAssist WIP: finished shortcuts for show stars' name 2025-04-15 21:04:22 +08:00
soarqin 5674d601ec WIP for UXAssist new features 2025-04-13 20:06:37 +08:00
soarqin f5b98c1c48 WIP 2024-09-18 19:36:31 +08:00
soarqin fb916b3813 refactoring UXAssist and CheatEnabler 2024-09-17 01:53:41 +08:00