1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 00:13:36 +08:00
This commit is contained in:
2024-09-30 19:10:04 +08:00
parent f897c0d9ec
commit c2d55dd16e
4 changed files with 23 additions and 8 deletions

View File

@@ -1,5 +1,9 @@
## Changlog ## Changlog
* 1.2.8
+ `Real-time logistic stations info panel`: Fix a bug that item status bar appears unexpectedly.
* 1.2.7
+ Fix some minor issues
* 1.2.6 * 1.2.6
+ `Remember window position and size on last exit` + `Remember window position and size on last exit`
- Fix a bug that window position is restored even the option is disabled. - Fix a bug that window position is restored even the option is disabled.
@@ -206,6 +210,10 @@
## 更新日志 ## 更新日志
* 1.2.8
+ `物流运输站实时信息面板`:修复了一个物品状态条意外显示的问题
* 1.2.7
+ 修复了一些小问题
* 1.2.6 * 1.2.6
+ `记住上次退出时的窗口位置和大小` + `记住上次退出时的窗口位置和大小`
- 修复了即使选项被禁用也恢复窗口位置的问题 - 修复了即使选项被禁用也恢复窗口位置的问题

View File

@@ -1020,7 +1020,7 @@ public static class LogisticsPatch
return sprite; return sprite;
} }
public void SetItem(int i, StationStore storage) public void SetItem(int i, StationStore storage, bool barEnabled)
{ {
ref var storageState = ref _storageItems[i]; ref var storageState = ref _storageItems[i];
var countUIText = _countTextsText[i]; var countUIText = _countTextsText[i];
@@ -1047,7 +1047,7 @@ public static class LogisticsPatch
_iconLocalsImage[i].sprite = StateSprite[(int)storageState.LocalState]; _iconLocalsImage[i].sprite = StateSprite[(int)storageState.LocalState];
_iconRemotes[i].gameObject.SetActive(CarrierEnabled[(int)_layout][1]); _iconRemotes[i].gameObject.SetActive(CarrierEnabled[(int)_layout][1]);
_iconRemotesImage[i].sprite = StateSprite[(int)storageState.RemoteState]; _iconRemotesImage[i].sprite = StateSprite[(int)storageState.RemoteState];
_sliderBg[i].gameObject.SetActive(RealtimeLogisticsInfoPanelBarsEnabled.Value); _sliderBg[i].gameObject.SetActive(barEnabled);
switch (_layout) switch (_layout)
{ {
case EStationTipLayout.InterstellarLogistics: case EStationTipLayout.InterstellarLogistics:
@@ -1069,7 +1069,6 @@ public static class LogisticsPatch
} }
else if (itemId <= 0) return; else if (itemId <= 0) return;
var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value;
var itemCount = storage.count; var itemCount = storage.count;
var itemLimit = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStorageMaxTotal : _localStorageMaxTotal; var itemLimit = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStorageMaxTotal : _localStorageMaxTotal;
if (storageState.ItemCount != itemCount) if (storageState.ItemCount != itemCount)
@@ -1229,6 +1228,10 @@ public static class LogisticsPatch
break; break;
} }
} }
for (var i = _storageNum; i < StorageSlotCount; i++)
{
_sliderBg[i].gameObject.SetActive(false);
}
_storageNum = Math.Min(StorageNums[(int)layout], stationComponent.storage.Length); _storageNum = Math.Min(StorageNums[(int)layout], stationComponent.storage.Length);
rectTransform.sizeDelta = new Vector2(TipWindowWidths[(int)layout], TipWindowExtraHeights[(int)layout] + 35f * _storageNum); rectTransform.sizeDelta = new Vector2(TipWindowWidths[(int)layout], TipWindowExtraHeights[(int)layout] + 35f * _storageNum);
@@ -1250,10 +1253,11 @@ public static class LogisticsPatch
} }
var storageArray = stationComponent.storage; var storageArray = stationComponent.storage;
var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value;
for (var j = _storageNum - 1; j >= 0; j--) for (var j = _storageNum - 1; j >= 0; j--)
{ {
var storage = storageArray[j]; var storage = storageArray[j];
SetItem(j, storage); SetItem(j, storage, barEnabled);
} }
int currentCount, totalCount; int currentCount, totalCount;
@@ -1289,8 +1293,11 @@ public static class LogisticsPatch
{ {
for (var i = _storageNum - 1; i >= 0; i--) for (var i = _storageNum - 1; i >= 0; i--)
{ {
var bg = _sliderBg[i]; _sliderBg[i].gameObject.SetActive(on && _storageItems[i].ItemId > 0);
bg.gameObject.SetActive(on && _storageItems[i].ItemId > 0); }
for (var i = _storageNum; i < StorageSlotCount; i++)
{
_sliderBg[i].gameObject.SetActive(false);
} }
} }
} }

View File

@@ -4,7 +4,7 @@
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid> <BepInExPluginGuid>org.soardev.uxassist</BepInExPluginGuid>
<Description>DSP MOD - UXAssist</Description> <Description>DSP MOD - UXAssist</Description>
<Version>1.2.6</Version> <Version>1.2.7</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<PackageId>UXAssist</PackageId> <PackageId>UXAssist</PackageId>

View File

@@ -1,6 +1,6 @@
{ {
"name": "UXAssist", "name": "UXAssist",
"version_number": "1.2.6", "version_number": "1.2.7",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/UXAssist",
"description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁", "description": "Some functions and patches for better user experience / 一些提升用户体验的功能和补丁",
"dependencies": [ "dependencies": [