feat: apply things learned in better autocasting mod
This commit is contained in:
parent
472afff0a2
commit
98ea411011
16 changed files with 143 additions and 52 deletions
12
.config/dotnet-tools.json
Normal file
12
.config/dotnet-tools.json
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"roslynator.dotnet.cli": {
|
||||
"version": "0.8.4",
|
||||
"commands": [
|
||||
"roslynator"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
4
.vscode/build.sh
vendored
4
.vscode/build.sh
vendored
|
@ -4,9 +4,11 @@ script_dir=$(dirname $(readlink -f $0))
|
|||
mod_dir=$(dirname $script_dir)
|
||||
pushd $script_dir
|
||||
|
||||
configuration=${1:-Debug}
|
||||
|
||||
# build dll
|
||||
rm -f ../1.4/Assemblies/*
|
||||
dotnet build mod.csproj
|
||||
dotnet build mod.csproj -c ${configuration}
|
||||
|
||||
# generate About.xml
|
||||
rm -f ../About/About.xml
|
||||
|
|
0
.vscode/fmt.sh
vendored
Normal file → Executable file
0
.vscode/fmt.sh
vendored
Normal file → Executable file
2
.vscode/launch.sh
vendored
2
.vscode/launch.sh
vendored
|
@ -4,6 +4,6 @@ script_dir=$(dirname $(readlink -f $0))
|
|||
mod_dir=$(dirname $script_dir)
|
||||
pushd $script_dir
|
||||
|
||||
LC_ALL=C steam-run ~/.steam/steam/steamapps/common/RimWorld/RimWorldLinux -logfile $mod_dir/log/rimworld.log -popupwindow $@
|
||||
SDL_VIDEODRIVER=X11 LC_ALL=C steam-run ~/.local/share/Steam/steamapps/common/RimWorld/RimWorldLinux -logfile $mod_dir/log/rimworld.log -popupwindow $@
|
||||
|
||||
popd
|
19
.vscode/mod.csproj
vendored
19
.vscode/mod.csproj
vendored
|
@ -13,6 +13,7 @@
|
|||
<DebugType>none</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<Nullable>enable</Nullable>
|
||||
<!-- Contents of About.xml
|
||||
See https://rimworldwiki.com/wiki/Modding_Tutorials/About.xml -->
|
||||
<ModMetaData>
|
||||
|
@ -28,7 +29,7 @@
|
|||
<modVersion IgnoreIfNoMatchingField="True">
|
||||
<!-- Gets automatically populated with VersionPrefix (see above) -->
|
||||
</modVersion>
|
||||
<url />
|
||||
<url>https://git.tobot.dev/toby/rimworld-mod-template</url>
|
||||
<modDependencies />
|
||||
<modDependenciesByVersion>
|
||||
<!-- <v1.4>
|
||||
|
@ -52,12 +53,20 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- Mod -->
|
||||
<Compile Include="../Source/*" />
|
||||
<Compile Include="../Source/**/*" />
|
||||
<PackageReference Include="Krafs.Rimworld.Ref"
|
||||
Version="1.4.3901" />
|
||||
<!-- Set IncludeAssets to 'compile' to enable Harmony -->
|
||||
<PackageReference Include="Lib.Harmony"
|
||||
Version="2.2.2"
|
||||
<PackageReference Include="Lib.Harmony.Thin"
|
||||
Version="2.3.3"
|
||||
IncludeAssets="none" />
|
||||
<PackageReference Include="roslynator.analyzers"
|
||||
Version="4.12.0"
|
||||
IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"
|
||||
PrivateAssets="all" />
|
||||
<PackageReference Include="roslynator.formatting.analyzers"
|
||||
Version="4.12.0"
|
||||
IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive"
|
||||
PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
9
.vscode/roslynator.sh
vendored
Executable file
9
.vscode/roslynator.sh
vendored
Executable file
|
@ -0,0 +1,9 @@
|
|||
set -e
|
||||
|
||||
script_dir=$(dirname $(readlink -f $0))
|
||||
mod_dir=$(dirname $script_dir)
|
||||
pushd $mod_dir
|
||||
|
||||
dotnet roslynator analyze $script_dir/mod.csproj
|
||||
|
||||
popd
|
31
.vscode/settings.json
vendored
31
.vscode/settings.json
vendored
|
@ -3,22 +3,25 @@
|
|||
"files.exclude": {
|
||||
".direnv": true,
|
||||
".vscode/obj": true,
|
||||
"1.4/Assemblies/": true,
|
||||
"About/": true,
|
||||
"*/Assemblies/": true,
|
||||
},
|
||||
"files.readonlyInclude": {
|
||||
"log/rimworld.log": true,
|
||||
"About/About.xml": true,
|
||||
},
|
||||
"csharp.inlayHints.parameters.enabled": true,
|
||||
"csharp.inlayHints.parameters.forIndexerParameters": true,
|
||||
"csharp.inlayHints.parameters.forLiteralParameters": true,
|
||||
"csharp.inlayHints.parameters.forObjectCreationParameters": true,
|
||||
"csharp.inlayHints.parameters.forOtherParameters": true,
|
||||
"csharp.inlayHints.parameters.suppressForParametersThatDifferOnlyBySuffix": true,
|
||||
"csharp.inlayHints.parameters.suppressForParametersThatMatchArgumentName": true,
|
||||
"csharp.inlayHints.parameters.suppressForParametersThatMatchMethodIntent": true,
|
||||
"csharp.inlayHints.types.enabled": true,
|
||||
"csharp.inlayHints.types.forImplicitObjectCreation": true,
|
||||
"csharp.inlayHints.types.forImplicitVariableTypes": true,
|
||||
"csharp.inlayHints.types.forLambdaParameterTypes": true
|
||||
"omnisharp.organizeImportsOnFormat": true,
|
||||
"dotnet.inlayHints.enableInlayHintsForParameters": true,
|
||||
"dotnet.inlayHints.enableInlayHintsForLiteralParameters": true,
|
||||
"dotnet.inlayHints.enableInlayHintsForIndexerParameters": true,
|
||||
"dotnet.inlayHints.enableInlayHintsForObjectCreationParameters": true,
|
||||
"dotnet.inlayHints.enableInlayHintsForOtherParameters": true,
|
||||
"dotnet.inlayHints.suppressInlayHintsForParametersThatDifferOnlyBySuffix": true,
|
||||
"dotnet.inlayHints.suppressInlayHintsForParametersThatMatchMethodIntent": true,
|
||||
"dotnet.inlayHints.suppressInlayHintsForParametersThatMatchArgumentName": true,
|
||||
"csharp.inlayHints.enableInlayHintsForTypes": true,
|
||||
"csharp.inlayHints.enableInlayHintsForImplicitVariableTypes": true,
|
||||
"csharp.inlayHints.enableInlayHintsForLambdaParameterTypes": true,
|
||||
"csharp.inlayHints.enableInlayHintsForImplicitObjectCreation": true,
|
||||
"dotnet.server.useOmnisharp": true,
|
||||
"omnisharp.enableLspDriver": false
|
||||
}
|
14
.vscode/setup.sh
vendored
14
.vscode/setup.sh
vendored
|
@ -1,12 +1,20 @@
|
|||
set -e
|
||||
set -x
|
||||
|
||||
script_dir=$(dirname $(readlink -f $0))
|
||||
mod_dir=$(dirname $script_dir)
|
||||
pushd $script_dir
|
||||
|
||||
mod_name="${mod_dir##*/}"
|
||||
target_dir=$(readlink -f ~/.local/share/Steam/steamapps/common/RimWorld/Mods/)/$mod_name
|
||||
|
||||
# Try to create symlink in RimWorld mod directory
|
||||
ln -s $mod_dir -t "$(readlink -f ~/.steam/steam/steamapps/common/RimWorld/Mods)" -v || echo "Target directory already exists. This is expected on re-runs"
|
||||
dotnet tool restore
|
||||
|
||||
popd
|
||||
if [ "$target_dir" = "$mod_dir" ]; then
|
||||
echo "Target directory is the same as the mod directory. Cloned in RimWorld/Mods. Skipping setup"
|
||||
else
|
||||
mkdir -p $target_dir
|
||||
rsync -av --exclude '$mod_dir/*' --delete $mod_dir/1.4 $mod_dir/About $mod_dir/README $mod_dir/LICENSE $target_dir
|
||||
fi
|
||||
|
||||
popd
|
||||
|
|
56
.vscode/tasks.json
vendored
56
.vscode/tasks.json
vendored
|
@ -1,6 +1,13 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "analyze",
|
||||
"type": "shell",
|
||||
"group": "none",
|
||||
"command": ".vscode/roslynator.sh",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "format",
|
||||
"type": "shell",
|
||||
|
@ -9,7 +16,7 @@
|
|||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "build mod",
|
||||
"label": "build mod (Debug)",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
|
@ -18,10 +25,24 @@
|
|||
"command": ".vscode/build.sh",
|
||||
"problemMatcher": [
|
||||
"$msCompile"
|
||||
]
|
||||
],
|
||||
"dependsOn": []
|
||||
},
|
||||
{
|
||||
"label": "run game",
|
||||
"label": "build mod (Release)",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"command": ".vscode/build.sh Release",
|
||||
"problemMatcher": [
|
||||
"$msCompile"
|
||||
],
|
||||
"dependsOn": []
|
||||
},
|
||||
{
|
||||
"label": "run game (Debug)",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "none",
|
||||
|
@ -29,13 +50,29 @@
|
|||
},
|
||||
"command": ".vscode/launch.sh",
|
||||
"problemMatcher": [],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"link mod directory",
|
||||
"build mod"
|
||||
"build mod (Debug)",
|
||||
"set up mod directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "run game (quicktest)",
|
||||
"label": "run game (Release)",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "none",
|
||||
"isDefault": true
|
||||
},
|
||||
"command": ".vscode/launch.sh",
|
||||
"problemMatcher": [],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"build mod (Release)",
|
||||
"set up mod directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "run game (Debug + quicktest)",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "none",
|
||||
|
@ -43,13 +80,14 @@
|
|||
},
|
||||
"command": ".vscode/launch.sh -quicktest",
|
||||
"problemMatcher": [],
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"link mod directory",
|
||||
"build mod"
|
||||
"build mod (Debug)",
|
||||
"set up mod directory"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "link mod directory",
|
||||
"label": "set up mod directory",
|
||||
"type": "shell",
|
||||
"group": {
|
||||
"kind": "none"
|
||||
|
|
Binary file not shown.
|
@ -10,7 +10,7 @@
|
|||
<li>1.4</li>
|
||||
</supportedVersions>
|
||||
<modVersion IgnoreIfNoMatchingField="True">0.1.0.0</modVersion>
|
||||
<url/>
|
||||
<url>https://git.tobot.dev/toby/rimworld-mod-template</url>
|
||||
<modDependencies/>
|
||||
<modDependenciesByVersion>
|
||||
<!-- <v1.4>
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2024 Tobias Berger
|
||||
Copyright (c) 2024 Toby (Tobias Berger)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
11
README
Normal file
11
README
Normal file
|
@ -0,0 +1,11 @@
|
|||
Template for RimWorld Mods in nix
|
||||
|
||||
Expects the following VSCode extensions
|
||||
- ms-dotnettools.vscode-dotnet-runtime
|
||||
- ms-dotnettools.csharp
|
||||
|
||||
Expects the following VSCode settings:
|
||||
- dotnet.dotnetPath should point at the .NET SDK
|
||||
- omnisharp.monoPath should point at the mono install dir
|
||||
- omnisharp.path should point at the omnisharp binary
|
||||
- dotnet.server.path should point at the omnisharp binary?
|
|
@ -6,7 +6,7 @@ using Verse;
|
|||
namespace Template;
|
||||
|
||||
[DefOf]
|
||||
public class TemplateDefOf
|
||||
public static class TemplateDefOf
|
||||
{
|
||||
public static LetterDef success_letter;
|
||||
}
|
||||
|
|
30
flake.lock
30
flake.lock
|
@ -5,11 +5,11 @@
|
|||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706830856,
|
||||
"narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=",
|
||||
"lastModified": 1712014858,
|
||||
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f",
|
||||
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1707546158,
|
||||
"narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=",
|
||||
"lastModified": 1712163089,
|
||||
"narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0",
|
||||
"rev": "fd281bd6b7d3e32ddfa399853946f782553163b5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -37,11 +37,11 @@
|
|||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1706550542,
|
||||
"narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=",
|
||||
"lastModified": 1711703276,
|
||||
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "97b17f32362e475016f942bbdfda4a4a72a8a652",
|
||||
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -54,11 +54,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1705856552,
|
||||
"narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=",
|
||||
"lastModified": 1708475490,
|
||||
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d",
|
||||
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -96,11 +96,11 @@
|
|||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1707300477,
|
||||
"narHash": "sha256-qQF0fEkHlnxHcrKIMRzOETnRBksUK048MXkX0SOmxvA=",
|
||||
"lastModified": 1711963903,
|
||||
"narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "ac599dab59a66304eb511af07b3883114f061b9d",
|
||||
"rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
nixpkgs-fmt.enable = true;
|
||||
csharpier.enable = true;
|
||||
prettier.enable = true;
|
||||
nixfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue