1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-02-05 02:22:21 +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,6 +1256,8 @@ public static class LogisticsPatch
_pixelPerItem = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStoragePixelPerItem : _localStoragePixelPerItem; _pixelPerItem = _layout == EStationTipLayout.InterstellarLogistics ? _remoteStoragePixelPerItem : _localStoragePixelPerItem;
} }
if (_storageNum > 0)
{
var storageArray = stationComponent.storage; var storageArray = stationComponent.storage;
var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value; var barEnabled = RealtimeLogisticsInfoPanelBarsEnabled.Value;
for (var j = _storageNum - 1; j >= 0; j--) for (var j = _storageNum - 1; j >= 0; j--)
@@ -1259,13 +1265,13 @@ public static class LogisticsPatch
var storage = storageArray[j]; var storage = storageArray[j];
SetItem(j, storage, barEnabled); 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;