From 6a292e08164c2e32eb6e268deab5a5fcc38c8554 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sat, 10 Oct 2026 23:39:17 +0800 Subject: [PATCH] fix(uxassist): honor saved building options at startup --- AGENTS.md | 1 + UXAssist/CHANGELOG.md | 4 ++++ UXAssist/Patches/Factory/BuildToolPatch.cs | 7 +------ UXAssist/Patches/Factory/FactoryPatch.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 97c05c4..5630597 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,6 +29,7 @@ - UXAssist Dark Fog buy-out belt signals keep each item ID, per-Metaverse rate, localization key, and embedded icon path in one definition. Name embedded icon files after the current English item names and synchronize resource includes and loader paths when renaming them. Preserve the legacy signal and saved-stock order. Rates represent equivalent single-material value: a native bundle of 10 Silicon-based Neurons, 10 Negentropy Singularities, and 10 Matter Recombinators per Metaverse corresponds to 30 of any one selected material per Metaverse. - `ModFeatureRegistry` discovers dependent-mod features during `Awake`; feature initialization is eager, while UXAssist alone drives the deferred start, input, update, and uninitialization lifecycle. Keep dispatchers internal and idempotent. +- Apply config-controlled patches from their owning feature's `Start` and `SettingChanged` handlers. Shared lifecycle helpers must only manage always-on patches and must not override saved option states. - Proto-dependent features must tolerate calls before preload completes and retry via `UXAssist.Common.GameLogic.OnDataLoaded`. Mark changes applied only after capturing valid originals and successfully mutating the proto. - Architect-mode virtual stock applies only to player inventory and construction previews, including logistics bots, drones, and vessels. Keep cached package statistics consistent for inlined getters, preserve physical capacity and native ref/out contracts, and restore native statistics on disable. - Dispatch UXAssist shortcuts from the postfix of `VFInput.OnUpdate`, after DSP refreshes modifier and UI state. Keep typing/menu guards and per-frame registry guards; do not poll from an independent `Update()` or logic-tick callback. diff --git a/UXAssist/CHANGELOG.md b/UXAssist/CHANGELOG.md index 1f996d0..795127f 100644 --- a/UXAssist/CHANGELOG.md +++ b/UXAssist/CHANGELOG.md @@ -4,6 +4,8 @@ ## Changlog * 1.6.2 - Unrelease + * `Treat stack items as single in monitor components`: Fix the option taking effect at game startup when disabled, until toggled on and off. + * `Building options`: Honor saved toggle states at startup for off-grid construction, power-pole dragging, fast tank transfers, and Ctrl+Shift belt pickup. * `Belt signals for buy out dark fog items automatically`: Use the current in-game material names and retain the original exchange ratios. * `Initialize This Planet`: Fix an occasional array index error after initializing a planet with Holo Beacons. * `Planet vein utilization`: Restore the original vertical alignment of vein-group counts and keep resource names in their original positions. @@ -427,6 +429,8 @@ ## 更新日志 * 1.6.2 - Unreleased + * `在流速计中将堆叠物品视为单个物品`:修复未勾选时仍在启动游戏后生效、必须切换一次才能关闭的问题。 + * `建造选项`:修复不对齐网格建造、拖建电线杆、储液罐快速存取和 Ctrl+Shift 拾取整段传送带物品在启动时忽略已保存开关的问题。 * `用于自动购买黑雾物品的传送带信号`:统一使用当前游戏中的材料名称,保留原有兑换比例。 * `初始化本行星`:修复行星上存在全息信标时,初始化后可能出现数组越界报错的问题。 * `宇宙视图行星/星系矿脉数量显示`:修复矿脉数量文字偏下和矿物名称向右偏移的问题。 diff --git a/UXAssist/Patches/Factory/BuildToolPatch.cs b/UXAssist/Patches/Factory/BuildToolPatch.cs index b98818b..3ffd4f6 100644 --- a/UXAssist/Patches/Factory/BuildToolPatch.cs +++ b/UXAssist/Patches/Factory/BuildToolPatch.cs @@ -12,14 +12,9 @@ namespace UXAssist.Patches.Factory; internal static class BuildToolPatch { - public static void Enable(bool enable) + public static void EnableAlwaysOnPatches(bool enable) { BuildGizmoPatch.Enable(enable); - OffGridBuilding.Enable(enable); - TreatStackingAsSingle.Enable(enable); - DragBuildPowerPoles.Enable(enable); - TankFastFillInAndTakeOut.Enable(enable); - PressShiftToTakeWholeBeltItems.Enable(enable); } private class BuildGizmoPatch : PatchImpl diff --git a/UXAssist/Patches/Factory/FactoryPatch.cs b/UXAssist/Patches/Factory/FactoryPatch.cs index 9c68d05..ed53df9 100644 --- a/UXAssist/Patches/Factory/FactoryPatch.cs +++ b/UXAssist/Patches/Factory/FactoryPatch.cs @@ -163,13 +163,13 @@ public static class FactoryPatch BuildingBufferPatch.TweakBuildingBuffer.Enable(TweakBuildingBufferEnabled.Value); BuildToolPatch.PressShiftToTakeWholeBeltItems.Enable(PressShiftToTakeWholeBeltItemsEnabled.Value); - BuildToolPatch.Enable(true); + BuildToolPatch.EnableAlwaysOnPatches(true); UpdateTankFastFillInAndTakeOutMultiplierRealValue(); } public static void Uninit() { - BuildToolPatch.Enable(false); + BuildToolPatch.EnableAlwaysOnPatches(false); BuildToolPatch.PressShiftToTakeWholeBeltItems.Enable(false); BuildingBufferPatch.TweakBuildingBuffer.Enable(false);