mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(dustbin): move storage checkbox away from native labels
Refs: #105 Assisted-by: Cindy (https://cindy.app)
This commit is contained in:
1 parent
64a23e9772
commit
ec00212669
2 files changed
+5
-10
No files matched your search
@@ -4,7 +4,7 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
* 1.5.0
|
* 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.
|
* `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.
|
* `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
|
* 1.5.0
|
||||||
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。
|
* `储物仓垃圾桶`:销毁四向分流器送入上方储物仓的物品,包括堆叠和喷涂增产剂的物品;启用垃圾桶时清除已满状态缓存。将复选框移至标题栏,避免与英文自动化输入说明重叠。
|
||||||
* `储液罐垃圾桶`:修复单层储液罐装入第一批液体后停止输入的问题,普通储存和垃圾桶模式均可正常工作。
|
* `储液罐垃圾桶`:修复单层储液罐装入第一批液体后停止输入的问题,普通储存和垃圾桶模式均可正常工作。
|
||||||
* `传送带信号垃圾桶`:适配当前游戏的模拟循环,修复 DSP 0.10.33/0.10.34 更新后的启动报错和物品无法销毁问题。
|
* `传送带信号垃圾桶`:适配当前游戏的模拟循环,修复 DSP 0.10.33/0.10.34 更新后的启动报错和物品无法销毁问题。
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.IO;
|
|||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using NebulaAPI;
|
using NebulaAPI;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace Dustbin;
|
namespace Dustbin;
|
||||||
|
|
||||||
@@ -106,7 +105,7 @@ public static class StoragePatch
|
|||||||
[HarmonyPatch(typeof(UIStorageWindow), nameof(UIStorageWindow._OnCreate))]
|
[HarmonyPatch(typeof(UIStorageWindow), nameof(UIStorageWindow._OnCreate))]
|
||||||
private static void UIStorageWindow__OnCreate_Postfix(UIStorageWindow __instance)
|
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;
|
var window = __instance;
|
||||||
_storageDustbinCheckBox.OnChecked += () =>
|
_storageDustbinCheckBox.OnChecked += () =>
|
||||||
{
|
{
|
||||||
@@ -134,10 +133,6 @@ public static class StoragePatch
|
|||||||
var storagePool = __instance.factoryStorage.storagePool;
|
var storagePool = __instance.factoryStorage.storagePool;
|
||||||
if (storagePool[storageId].id != storageId) return;
|
if (storagePool[storageId].id != storageId) return;
|
||||||
_storageDustbinCheckBox.Checked = storagePool[storageId].IsDustbin;
|
_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 */
|
/* Adopt fix from starfi5h's NebulaCompatiblilityAssist */
|
||||||
@@ -145,8 +140,8 @@ public static class StoragePatch
|
|||||||
[HarmonyPatch(typeof(UIStorageGrid), nameof(UIStorageGrid.OnStorageSizeChanged))]
|
[HarmonyPatch(typeof(UIStorageGrid), nameof(UIStorageGrid.OnStorageSizeChanged))]
|
||||||
private static void UIStorageGrid_OnStorageSizeChanged_Postfix()
|
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
|
// Storage data arrives asynchronously on multiplayer clients.
|
||||||
_lastStorageId = 0; // Refresh UI to reposition button on client side
|
_lastStorageId = 0; // Refresh checkbox state on the client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user