Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyvion committed Apr 30, 2024
0 parents commit db633cf
Show file tree
Hide file tree
Showing 64 changed files with 3,920 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
push:
branches:
- main
paths-ignore:
- "README.md"
- "CHANGELOG.md"
- ".gitignore"
tags-ignore:
# This will ignore release versions tagged with a version identifier. We'll
# use a separate workflow for them.
- "v*"
pull_request:
paths-ignore:
- README.md
- "CHANGELOG.md"
- ".gitignore"

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Build Mod for 1.5
env:
RimWorldVersion: 1.5
run: dotnet build .vscode --configuration Release

- name: Upload Mod Artifacts
uses: actions/upload-artifact@v3
with:
name: RealisticOrbitalTrade-${{ github.sha }}
path: |
About/
1.5/
Common/
Defs/
Patches/
LICENSE
LICENSE.Apache-2.0
LICENSE.MIT
README.md
CHANGELOG.md
!**/.*
!About/*.pdn
!About/*.svg
!About/*.ttf
103 changes: 103 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Release

on:
push:
tags:
# This will only run the release workflow when it's tagged with a version
# tag.
- "v*"

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Build Mod for 1.5
env:
RimWorldVersion: 1.5
run: dotnet build .vscode --configuration Release

- name: Upload Mod Artifacts
uses: actions/upload-artifact@v3
with:
name: RealisticOrbitalTrade-Release
path: |
About/
1.5/
Common/
Defs/
Patches/
LICENSE
LICENSE.Apache-2.0
LICENSE.MIT
README.md
CHANGELOG.md
!**/.*
!About/*.pdn
!About/*.svg
!About/*.ttf
package:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Set Environment Variables
run: |
echo "MOD_PATH=$HOME/RealisticOrbitalTrade" >> $GITHUB_ENV
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "NO_PREFIX_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create Mod Folder
run: mkdir -p ${{ env.MOD_PATH }}

- name: Download Mod Artifacts from Build Step
uses: actions/download-artifact@v3
with:
name: RealisticOrbitalTrade-Release
path: ${{ env.MOD_PATH }}

- name: Zip Mod
run: |
cd $HOME
zip -r ./RealisticOrbitalTrade.zip ./RealisticOrbitalTrade/*
- name: Checkout Repository
uses: actions/checkout@v3

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.NO_PREFIX_VERSION }}
path: ./CHANGELOG.md

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.MOD_PATH }}.zip
asset_name: RealisticOrbitalTrade-${{ env.VERSION }}.zip
asset_content_type: application/zip
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.vscode/obj

/*/Assemblies
33 changes: 33 additions & 0 deletions .vscode/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$ErrorActionPreference = 'Stop'

$Target = "C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RealisticOrbitalTrade"

# build dlls
$env:RimWorldVersion = "1.5"
dotnet build --configuration Release .vscode
if ($LASTEXITCODE -gt 0) {
throw "Build failed"
}

# remove mod folder
Remove-Item -Path $Target -Recurse -ErrorAction SilentlyContinue

# copy mod files
Copy-Item -Path 1.5 $Target\1.5 -Recurse

Copy-Item -Path Common $Target\Common -Recurse
Copy-Item -Path Defs $Target\Defs -Recurse
Copy-Item -Path Patches $Target\Patches -Recurse

New-Item -Path $Target -ItemType Directory -Name About
Copy-Item -Path About\About.xml $Target\About
Copy-Item -Path About\Manifest.xml $Target\About
Copy-Item -Path About\Preview.png $Target\About
Copy-Item -Path About\ModIcon.png $Target\About
Copy-Item -Path About\PublishedFileId.txt $Target\About

Copy-Item -Path CHANGELOG.md $Target
Copy-Item -Path LICENSE $Target
Copy-Item -Path LICENSE.Apache-2.0 $Target
Copy-Item -Path LICENSE.MIT $Target
Copy-Item -Path README.md $Target
33 changes: 33 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Rimworld Mod Project",
"type": "clr",
"request": "launch",
"preLaunchTask": "build dll",
"args": [],
"program": "C:/Program Files (x86)/Steam/steamapps/common/RimWorld/RimWorldWin64.exe",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"internalConsoleOptions": "neverOpen",
"stopAtEntry": true
},
{ // ignore
"name": ".NET Framework Attach",
"type": "clr",
"request": "attach",
"processId": "${command:pickProcess}",
"symbolOptions": {
"searchPaths": [
".vscode/obj/Debug/*"
],
"searchMicrosoftSymbolServer": false,
"searchNuGetOrgSymbolServer": false
}
}
]
}
55 changes: 55 additions & 0 deletions .vscode/mod.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net472</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>

<RootNamespace>RealisticOrbitalTrade</RootNamespace>
<AssemblyName>RealisticOrbitalTrade</AssemblyName>
<VersionPrefix>0.1.0</VersionPrefix>

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

<!-- Intellisense doesn't work without specifying this -->
<RimWorldVersion>1.5</RimWorldVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<!-- Mod -->
<Compile Include="../Source/RealisticOrbitalTrade/**" />
</ItemGroup>

<Choose>
<When Condition="'$(RimWorldVersion)' == '1.5'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);v1_5</DefineConstants>
<OutputPath>../1.5/Assemblies</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.5.*-*">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>

<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.2">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"xml.format.maxLineWidth": 0
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build dll",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"command": ".vscode/build.ps1",
"problemMatcher": []
}
]
}
37 changes: 37 additions & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<packageId>ilyvion.RealisticOrbitalTrade</packageId>
<name>Realistic Orbital Trade</name>
<author>ilyvion</author>
<description>Has it ever bothered you how the orbital traders can just magically teleport items right out of your stockpiles? This mod puts an end to that. With &lt;b&gt;Realistic Orbital Trade&lt;/b&gt;, your pawns will now have to load up a shuttle with the goods you sold before the orbital trader gets their hands on them AND before you get your hands on the goods you bought.

The mod will guide you through all the required steps using the RimWorld quest and letter systems once you've made a trade with an orbital trader.

The mod can be added to a game at any time. Removing the mod should be fine as long as there is no active trading quest at the time. There will be a fairly large list of once-off errors when first loading such a save, however.

Mod compatibility is probably generally good, but there might be issues with mods that modify how orbital traders work or how vanilla shuttles work.

&lt;size=24&gt;Version&lt;/size&gt;

This is version 0.1.0 for RimWorld 1.5
</description>
<supportedVersions>
<li>1.5</li>
</supportedVersions>
<modDependencies>
<li>
<packageId>brrainz.harmony</packageId>
<displayName>Harmony</displayName>
<downloadUrl>https://steamcommunity.com/workshop/filedetails/?id=2009463077</downloadUrl>
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
</li>
<li>
<packageId>Ludeon.RimWorld.Royalty</packageId>
<displayName>Royalty</displayName>
</li>
</modDependencies>
<loadAfter>
<li>brrainz.harmony</li>
<li>Ludeon.RimWorld.Royalty</li>
</loadAfter>
</ModMetaData>
Binary file added About/LogoText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit db633cf

Please sign in to comment.