fix(dustbin): move storage checkbox away from native labels

Refs: #105

Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
soarqin committed 2026-11-05 09:04:49 +08:00
1 parent 64a23e9772
commit c4c5f6ba95
2 files changed
+5 -10

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@
## Changelog
* 1.5.0
* `Storage dustbin`: Destroy splitter input to a storage placed above it, including stacked and proliferated cargo. Enabling dustbin mode also clears cached full-storage state.
* `Storage dustbin`: Destroy splitter input to a storage placed above it, including stacked and proliferated cargo. Enabling dustbin mode also clears cached full-storage state. Move the checkbox to the title bar to prevent overlap with the English automation input label.
* `Tank dustbin`: Fix single tanks blocking liquid input after receiving their first stack, both with and without dustbin mode.
* `Belt signal dustbin`: Restore item disposal and startup compatibility with the current game simulation loop after DSP 0.10.33/0.10.34 updates.
@@ -49,7 +49,7 @@
## 更新日志
* 1.5.0
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。将复选框移至标题栏,避免与英文自动化输入说明重叠。
* `储液罐垃圾桶`:修复单层储液罐装入第一批液体后停止输入的问题,普通储存和垃圾桶模式均可正常工作。
* `传送带信号垃圾桶`:适配当前游戏的模拟循环,修复 DSP 0.10.33/0.10.34 更新后的启动报错和物品无法销毁问题。
+3 -8
View File
@@ -3,7 +3,6 @@ using System.IO;
using System.Reflection.Emit;
using HarmonyLib;
using NebulaAPI;
using UnityEngine;
namespace Dustbin;
@@ -106,7 +105,7 @@ public static class StoragePatch
[HarmonyPatch(typeof(UIStorageWindow), nameof(UIStorageWindow._OnCreate))]
private static void UIStorageWindow__OnCreate_Postfix(UIStorageWindow __instance)
{
_storageDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 50f, 50f, Localization.CurrentLanguageLCID == Localization.LCID_ZHCN ? "垃圾桶" : "Dustbin");
_storageDustbinCheckBox = UI.MyCheckBox.CreateCheckBox(false, __instance.transform, 220f, 26f, Localization.CurrentLanguageLCID == Localization.LCID_ZHCN ? "垃圾桶" : "Dustbin");
var window = __instance;
_storageDustbinCheckBox.OnChecked += () =>
{
@@ -134,10 +133,6 @@ public static class StoragePatch
var storagePool = __instance.factoryStorage.storagePool;
if (storagePool[storageId].id != storageId) return;
_storageDustbinCheckBox.Checked = storagePool[storageId].IsDustbin;
if (__instance.transform is RectTransform rectTrans)
{
_storageDustbinCheckBox.rectTrans.anchoredPosition3D = new Vector3(190, 57 - rectTrans.sizeDelta.y, 0);
}
}
/* Adopt fix from starfi5h's NebulaCompatiblilityAssist */
@@ -145,8 +140,8 @@ public static class StoragePatch
[HarmonyPatch(typeof(UIStorageGrid), nameof(UIStorageGrid.OnStorageSizeChanged))]
private static void UIStorageGrid_OnStorageSizeChanged_Postfix()
{
// Due to storage window is empty when open in client, the size will change after receiving data from host
_lastStorageId = 0; // Refresh UI to reposition button on client side
// Storage data arrives asynchronously on multiplayer clients.
_lastStorageId = 0; // Refresh checkbox state on the client
}