17 Commits
v0.2 ... v0.2.1

Author SHA1 Message Date
4a98d6aa83 Fix improper asset moving, move non-essential About/ assets into .assets 2024-05-07 19:08:46 -05:00
a8b7ba4496 Update README badge 2024-05-07 19:02:34 -05:00
acbc440d10 Stable go version, update version to appropriate 2.1 2024-05-07 19:00:49 -05:00
9cbbc0a823 Try workflow command set-output for artifact 2024-05-07 18:58:53 -05:00
c14d9ad840 Install xq via Go, remove cat pipe 2024-05-07 18:53:02 -05:00
ff16bd7a08 Remove yq 2024-05-07 18:51:59 -05:00
6774a121ce Use Go for xq 2024-05-07 18:51:11 -05:00
8cd1ae7caf Get version before moving files 2024-05-07 18:41:14 -05:00
7f97c26916 Remove build script, try incorporate mod version into artifact name 2024-05-07 18:40:23 -05:00
8facf38ab2 Merge pull request #2 from Xevion/1.5
1.5: GitHub Workflow Build Script, Project SDK Modernization
2024-05-07 14:16:54 -05:00
d64e18207e Merge pull request #1 from mrsebseb/1.5
1.5 Support, Draw to DrawAt
2024-05-07 14:16:38 -05:00
275c524a30 Working dotnet CLI build, add Krafs RimWorld ref pkg 2024-05-07 04:33:13 -05:00
bc7308749b Add build script 2024-05-07 04:13:30 -05:00
d53a7f2763 Update supported version, modVersion 2024-05-07 01:42:01 -05:00
85eeec32e3 Add 'build' folder to .gitignore 2024-05-07 01:41:46 -05:00
Sebastian
2486dd2e7c 1.5 Support, Draw to DrawAt 2024-04-12 23:18:24 +02:00
d3321ececb Add dynamic Shield.io repository badges 2023-07-18 14:01:37 -05:00
10 changed files with 82 additions and 101 deletions

View File

Before

Width:  |  Height:  |  Size: 333 KiB

After

Width:  |  Height:  |  Size: 333 KiB

View File

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

52
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Build
env:
SLN_PATH: Source/HydroponicsExpanded/
on:
workflow_dispatch:
push:
paths-ignore:
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Install Mod Dependencies
run: dotnet restore ${{ env.SLN_PATH }}
- name: Build Mod
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
- name: Get Version
id: get_version
run: |
go install github.com/sibprogrammer/xq@latest
VERSION=$(xq ./About/About.xml -x "/ModMetaData/modVersion")
echo "::set-output name=result::$VERSION"
- name: Move files
run: |
mkdir -p output/HydroponicsExpanded
mv About/ Assemblies/ Defs/ Languages/ Textures/ output/HydroponicsExpanded
- name: Upload Mod Artifacts
uses: actions/upload-artifact@v2
with:
name: HydroponicsExpanded-${{ steps.get_version.outputs.result }}
path: output/

5
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.idea
/Assemblies/*.dll
/Assemblies/*.pdb
Assemblies/*.dll
Assemblies/*.pdb
build/

View File

@@ -5,8 +5,8 @@
<author>Xevion</author>
<description>Provides simple but powerful hydroponics that store plants underground at the cost of expensive components, lots of power, and research.</description>
<supportedVersions>
<li>1.4</li>
<li>1.5</li>
</supportedVersions>
<modVersion>0.1</modVersion>
<modVersion>0.2.1</modVersion>
<url>https://github.com/Xevion/RimWorld-Hydroponics-Expanded</url>
</ModMetaData>

View File

@@ -8,6 +8,9 @@
</sub>
</div>
<br>
[![badge-workshop-subscribers]][workshop-link] [![badge-workshop-favorites]][workshop-link] [![badge-version]][workshop-link]
Provides simple but powerful hydroponics that store plants underground at the cost of expensive components, lots of
power, and research.
@@ -24,7 +27,7 @@ expensive both in resources & power usage.
- Compact Hydroponics for growing many plants in a small space.
- Balanced recipes with absurd power/recipe requirements for absurd density.
- Simple usage with relatively no changes compared to traditional Hydroponics.
- Strong compatability with few changes to Vanilla RimWorld.
- Strong compatibility with few changes to Vanilla RimWorld.
## Compatibility
@@ -66,6 +69,12 @@ preventing the crop from being sown in the hydroponics in the first place (there
[workshop-link]: https://steamcommunity.com/sharedfiles/filedetails/?id=3005196131
[badge-version]: https://img.shields.io/badge/built_for-RimWorld_1.5-blue
[badge-workshop-subscribers]: https://img.shields.io/endpoint.svg?url=https://shieldsio-steam-workshop.jross.me/3005196131/subscriptions-text
[badge-workshop-favorites]: https://img.shields.io/endpoint.svg?url=https://shieldsio-steam-workshop.jross.me/3005196131/favourites-text
[hydroponics-basin]: https://rimworldwiki.com/wiki/Hydroponics_basin
[rimworld]: https://store.steampowered.com/app/294100/RimWorld/

View File

@@ -234,13 +234,13 @@ namespace HydroponicsExpanded {
private static readonly Material HydroponicUnfilledMaterial =
SolidColorMaterials.SimpleSolidColorMaterial(new Color(0.3f, 0.3f, 0.3f));
public override void Draw() {
base.Draw();
protected override void DrawAt(Vector3 drawLoc, bool flip=false) {
base.DrawAt(drawLoc, flip);
// Only draw growth percentage bar during Sowing stage
if (_stage == HydroponicsStage.Grow) {
var bar = new GenDraw.FillableBarRequest {
center = DrawPos + Vector3.up * 0.1f,
center = drawLoc + Vector3.up * 0.1f,
size = new Vector2(DrawSize.y - 0.4f, DrawSize.x - 0.4f),
margin = 0.15f,
fillPercent = _highestGrowth,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<!-- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> -->
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HydroponicsExpanded</RootNamespace>
<AssemblyName>HydroponicsExpanded</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFramework>net472</TargetFramework>
<FileAlignment>512</FileAlignment>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -31,7 +32,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- <ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
@@ -45,15 +46,18 @@
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
</ItemGroup> -->
<ItemGroup>
<Compile Include="Buildings\Building_DenseHydroponicsBasin.cs" />
<!-- <Compile Include="Buildings\Building_DenseHydroponicsBasin.cs" />
<Compile Include="Enums\HydroponicsStage.cs" />
<Compile Include="ModExtension\CapacityExtension.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utility\BetweenExtension.cs" />
<Compile Include="Utility\BetweenExtension.cs" /> -->
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.5.4085" />
</ItemGroup>
<!-- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -->
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -1,85 +0,0 @@
import glob
import logging
import shutil
import sys
from pathlib import Path
from shutil import rmtree
from typing import List
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
PROJECT_DIRECTORY: Path = Path(__file__).parent
def main(output_directory: Path) -> None:
# Check that output directory exists properly.
if not output_directory.exists():
# If the parent doesn't exist, we aren't going to create the folder.
if not output_directory.parent.exists():
raise RuntimeError("Cannot create more than one directory. Please check the output")
output_directory.mkdir(parents=False, exist_ok=False)
output_mod_directory: Path = output_directory / "HydroponicsExpanded"
# Folders that we need to be removed from the output directory if they contain any files.
pertinents_folders: List[str] = ["Defs", "Assemblies", "About", "Textures", "Languages"]
if output_mod_directory.exists():
logger.debug('Checking for folders to clear in destination.')
for folder in pertinents_folders:
destination_folder_path: Path = output_mod_directory / folder
# Ignore folders that don't exist.
if not destination_folder_path.exists():
continue
has_children: bool = any(destination_folder_path.iterdir())
logger.debug('Clearing "{}" folder.'.format(folder))
if has_children:
rmtree(destination_folder_path)
# destination_folder_path.rmdir()
else:
output_mod_directory.mkdir(parents=False)
patterns: List[str] = [
"About/",
"About/PublishedFileId.txt",
"About/About.xml",
"About/Preview.png",
"Assemblies/",
"Assemblies/HydroponicsExpanded.dll",
"Defs/**",
"Languages/**",
"Textures/**"
]
for pattern in patterns:
paths: List[Path] = list(map(Path, glob.glob(str(PROJECT_DIRECTORY / pattern), recursive=True)))
for source_path in paths:
relative_path: Path = source_path.relative_to(PROJECT_DIRECTORY)
destination_path: Path = output_mod_directory / relative_path
logger.debug("Copying from {} to {}".format(source_path, destination_path))
if source_path.is_dir():
destination_path.mkdir(exist_ok=True)
elif source_path.is_file():
shutil.copyfile(source_path, destination_path)
if __name__ == "__main__":
try:
output_directory: Path = PROJECT_DIRECTORY / "build"
if len(sys.argv) > 1:
output_directory = Path(sys.argv[1])
else:
logger.warning('Output directory automatically chosen.')
logger.debug('Project Directory: {}'.format(PROJECT_DIRECTORY))
logger.debug('Output Directory: {}'.format(output_directory))
main(output_directory)
except BaseException as e:
logger.error("Build script failed", exc_info=e)