mirror of
https://github.com/Xevion/RimWorld-Hydroponics-Expanded.git
synced 2025-12-10 20:08:21 -06:00
Minor code reformatting, show basin capacity in inspector string
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using HydroponicsExpanded.Enums;
|
using HydroponicsExpanded.Enums;
|
||||||
using HydroponicsExpanded.ModExtension;
|
using HydroponicsExpanded.ModExtension;
|
||||||
|
using HydroponicsExpanded.Utility;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Verse;
|
using Verse;
|
||||||
@@ -71,8 +72,7 @@ namespace HydroponicsExpanded {
|
|||||||
|
|
||||||
// If the maximum capacity is reached, then we should move to the growing stage.
|
// If the maximum capacity is reached, then we should move to the growing stage.
|
||||||
if (capacityReached) {
|
if (capacityReached) {
|
||||||
SoundStarter.PlayOneShot(SoundDefOf.CryptosleepCasket_Accept,
|
SoundDefOf.CryptosleepCasket_Accept.PlayOneShot(new TargetInfo(Position, Map));
|
||||||
new TargetInfo(Position, Map));
|
|
||||||
Stage = HydroponicsStage.Grow;
|
Stage = HydroponicsStage.Grow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,17 +123,17 @@ namespace HydroponicsExpanded {
|
|||||||
|
|
||||||
int occupiedCells = 0;
|
int occupiedCells = 0;
|
||||||
|
|
||||||
foreach (IntVec3 current in this.OccupiedRect()) {
|
foreach (IntVec3 currentCell in this.OccupiedRect()) {
|
||||||
List<Thing> list = Map.thingGrid.ThingsListAt(current);
|
List<Thing> cellThings = Map.thingGrid.ThingsListAt(currentCell);
|
||||||
|
|
||||||
// Skip this cell if it's occupied by another plant.
|
// Skip this cell if it's occupied by another plant.
|
||||||
if (list.OfType<Plant>().Any()) {
|
if (cellThings.OfType<Plant>().Any()) {
|
||||||
occupiedCells++;
|
occupiedCells++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
nextPlant.Growth = 1f;
|
nextPlant.Growth = 1f;
|
||||||
_innerContainer.TryDrop(nextPlant, current, Map, ThingPlaceMode.Direct, out _);
|
_innerContainer.TryDrop(nextPlant, currentCell, Map, ThingPlaceMode.Direct, out _);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +234,8 @@ namespace HydroponicsExpanded {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inspectString += "\n";
|
inspectString += "\n";
|
||||||
inspectString += "HydroponicsExpanded.OccupiedBays".Translate() + $": {_innerContainer.Count()}";
|
inspectString += "HydroponicsExpanded.OccupiedBays".Translate() +
|
||||||
|
$": {_innerContainer.Count()} / {_capacity}";
|
||||||
|
|
||||||
if (_innerContainer.Count > 0) {
|
if (_innerContainer.Count > 0) {
|
||||||
inspectString += "\n";
|
inspectString += "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user