1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 15:33:31 +08:00

minor opt

This commit is contained in:
2024-09-30 20:50:43 +08:00
parent c2d55dd16e
commit 83b544c172

View File

@@ -1230,6 +1230,10 @@ public static class LogisticsPatch
} }
for (var i = _storageNum; i < StorageSlotCount; i++) for (var i = _storageNum; i < StorageSlotCount; i++)
{ {
_iconLocals[i].gameObject.SetActive(false);
_iconRemotes[i].gameObject.SetActive(false);
_icons[i].gameObject.SetActive(false);
_countTexts[i].gameObject.SetActive(false);
_sliderBg[i].gameObject.SetActive(false); _sliderBg[i].gameObject.SetActive(false);
} }
@@ -1252,20 +1256,22 @@ public static class LogisticsPatch
_pixelPerItem = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStoragePixelPerItem : _localStoragePixelPerItem; _pixelPerItem = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStoragePixelPerItem : _localStoragePixelPerItem;
} }
var storageArray = stationComponent.storage; if (_storageNum > 0)
var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value;
for (var j = _storageNum - 1; j >= 0; j--)
{ {
var storage = storageArray[j]; var storageArray = stationComponent.storage;
SetItem(j, storage, barEnabled); var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value;
for (var j = _storageNum - 1; j >= 0; j--)
{
var storage = storageArray[j];
SetItem(j, storage, barEnabled);
}
} }
int currentCount, totalCount;
switch (_layout) switch (_layout)
{ {
case EStationTipLayout.PlanetaryLogistics: case EStationTipLayout.PlanetaryLogistics:
totalCount = stationComponent.idleDroneCount + stationComponent.workDroneCount; var totalCount = stationComponent.idleDroneCount + stationComponent.workDroneCount;
currentCount = stationComponent.idleDroneCount; var currentCount = stationComponent.idleDroneCount;
_carrierIdleCountText[0].text = currentCount.ToString(); _carrierIdleCountText[0].text = currentCount.ToString();
_carrierTotalCountText[0].text = totalCount.ToString(); _carrierTotalCountText[0].text = totalCount.ToString();
break; break;