7 Commits

5 changed files with 18 additions and 14 deletions

View File

@@ -28,16 +28,10 @@ jobs:
- name: Build Mod - name: Build Mod
run: dotnet build ${{ env.SLN_PATH }} --configuration Release --no-restore run: dotnet build ${{ env.SLN_PATH }} --configuration Release --no-restore
- name: Setup Go environment
uses: actions/setup-go@v5.0.1
with:
go-version: stable
cache-dependency-path: .github/workflows/go.sum
- name: Get Version - name: Get Version
id: get_version id: get_version
run: | run: |
go install github.com/sibprogrammer/xq@latest curl -sf https://gobinaries.com/sibprogrammer/xq@latest | sh
VERSION=$(xq ./About/About.xml -x "/ModMetaData/modVersion") VERSION=$(xq ./About/About.xml -x "/ModMetaData/modVersion")
echo "result=$VERSION" >> $GITHUB_OUTPUT echo "result=$VERSION" >> $GITHUB_OUTPUT

View File

@@ -7,6 +7,6 @@
<supportedVersions> <supportedVersions>
<li>1.5</li> <li>1.5</li>
</supportedVersions> </supportedVersions>
<modVersion>0.2.2</modVersion> <modVersion>0.2.3</modVersion>
<url>https://github.com/Xevion/RimWorld-Hydroponics-Expanded</url> <url>https://github.com/Xevion/RimWorld-Hydroponics-Expanded</url>
</ModMetaData> </ModMetaData>

View File

@@ -6,4 +6,5 @@
<HydroponicsExpanded.HarvestStage>Waiting for all plants to be harvested.</HydroponicsExpanded.HarvestStage> <HydroponicsExpanded.HarvestStage>Waiting for all plants to be harvested.</HydroponicsExpanded.HarvestStage>
<HydroponicsExpanded.OccupiedBays>Occupied Plant Bays</HydroponicsExpanded.OccupiedBays> <HydroponicsExpanded.OccupiedBays>Occupied Plant Bays</HydroponicsExpanded.OccupiedBays>
<HydroponicsExpanded.Growth>Growth</HydroponicsExpanded.Growth> <HydroponicsExpanded.Growth>Growth</HydroponicsExpanded.Growth>
<HydroponicsExpanded.Resting>resting</HydroponicsExpanded.Resting>
</LanguageData> </LanguageData>

View File

@@ -114,8 +114,7 @@ namespace HydroponicsExpanded {
} }
// Temperature & time of day check. // Temperature & time of day check.
float temperature = Position.GetTemperature(Map); if (IsResting() == false) {
if (temperature.Between(10f, 42f) && GenLocalDate.DayPercent(this).Between(0.25f, 0.8f)) {
float growthAmount = 1f / (60_000f * growthTrackingPlant.def.plant.growDays) * 250f; float growthAmount = 1f / (60_000f * growthTrackingPlant.def.plant.growDays) * 250f;
// Debug gizmo can set growth to 100%, thus Math.min check here. // Debug gizmo can set growth to 100%, thus Math.min check here.
@@ -129,10 +128,16 @@ namespace HydroponicsExpanded {
Stage = HydroponicsStage.Harvest; Stage = HydroponicsStage.Harvest;
} }
private void HarvestTick() { /// <summary>
// var plantsLeft = _innerContainer.Count; /// Determines whether the hydroponics basin is in a resting state.
// var potentialCellCount = this.OccupiedRect().Area; /// </summary>
/// <returns><c>true</c> if the hydroponics basin is in a resting state; otherwise, <c>false</c>.</returns>
private bool IsResting() {
float temperature = Position.GetTemperature(Map);
return !(temperature.Between(10f, 42f) && GenLocalDate.DayPercent(this).Between(0.25f, 0.8f));
}
private void HarvestTick() {
// Try to place every plant in the container in any cell. // Try to place every plant in the container in any cell.
foreach (Thing nextInnerThing in _innerContainer) { foreach (Thing nextInnerThing in _innerContainer) {
var nextPlant = (Plant)nextInnerThing; var nextPlant = (Plant)nextInnerThing;
@@ -291,6 +296,10 @@ namespace HydroponicsExpanded {
if (_innerContainer.Count > 0) { if (_innerContainer.Count > 0) {
inspectString += "\n"; inspectString += "\n";
inspectString += "HydroponicsExpanded.Growth".Translate() + $": {_highestGrowth * 100f:#0}%"; inspectString += "HydroponicsExpanded.Growth".Translate() + $": {_highestGrowth * 100f:#0}%";
if (IsResting()) {
inspectString += " (" + "HydroponicsExpanded.Resting".Translate() + ")";
}
} }
return inspectString; return inspectString;

View File

@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HydroponicsExpanded")] [assembly: AssemblyProduct("HydroponicsExpanded")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]