-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathExampleMod.csproj
More file actions
82 lines (69 loc) · 2.9 KB
/
ExampleMod.csproj
File metadata and controls
82 lines (69 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import user-specific paths -->
<Import Project="local.props" Condition="Exists('local.props')" />
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- ↓ MOD METADATA - Change these! -->
<ModName>ExampleMod</ModName>
<ModDisplayName>Example Mod</ModDisplayName>
<ModAuthor>lamali</ModAuthor>
<ModVersion>1.0.0</ModVersion>
<AssemblyName>$(ModName)</AssemblyName>
<Version>$(ModVersion)</Version>
<!-- Fallback defaults if local.props missing -->
<STS2GamePath Condition="'$(STS2GamePath)' == ''">C:\Program Files (x86)\Steam\steamapps\common\Slay the Spire 2</STS2GamePath>
<GodotExePath Condition="'$(GodotExePath)' == ''">godot</GodotExePath>
<!-- Derived paths -->
<ModsOutputDir>$(STS2GamePath)\mods\$(ModName)</ModsOutputDir>
<GameDataDir>$(STS2GamePath)\data_sts2_windows_x86_64</GameDataDir>
<PackProject>$(ProjectDir)pack</PackProject>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>$(GameDataDir)\0Harmony.dll</HintPath>
</Reference>
<Reference Include="GodotSharp">
<HintPath>$(GameDataDir)\GodotSharp.dll</HintPath>
</Reference>
<Reference Include="sts2">
<HintPath>$(GameDataDir)\sts2.dll</HintPath>
</Reference>
</ItemGroup>
<!-- Generate project.godot before build -->
<Target Name="GenerateProjectGodot" BeforeTargets="BeforeBuild">
<PropertyGroup>
<ProjectGodotPath>$(PackProject)\project.godot</ProjectGodotPath>
<ProjectGodotContent>config_version=5
[application]
config/name="$(ModName)"
config/features=PackedStringArray("4.5", "Forward Plus")
[dotnet]
project/assembly_name="$(ModName)"
</ProjectGodotContent>
</PropertyGroup>
<WriteLinesToFile File="$(ProjectGodotPath)" Lines="$(ProjectGodotContent)" Overwrite="true" Encoding="UTF-8" />
<Message Text="Generated project.godot" Importance="high" />
</Target>
<!-- Generate mod_manifest.json before build -->
<Target Name="GenerateModManifest" BeforeTargets="BeforeBuild">
<PropertyGroup>
<ModManifestPath>$(PackProject)\mod_manifest.json</ModManifestPath>
<ModManifestContent>{
"pck_name": "$(ModName)",
"name": "$(ModDisplayName)",
"author": "$(ModAuthor)",
"version": "$(ModVersion)"
}</ModManifestContent>
</PropertyGroup>
<WriteLinesToFile File="$(ModManifestPath)" Lines="$(ModManifestContent)" Overwrite="true" Encoding="UTF-8" />
<Message Text="Generated mod_manifest.json" Importance="high" />
</Target>
<Target Name="PostBuild" AfterTargets="Build">
<MakeDir Directories="$(ModsOutputDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ModsOutputDir)" />
<Exec Command=""$(GodotExePath)" --headless --path "$(PackProject)" --export-pack "Windows Desktop" "$(ModsOutputDir)\$(ModName).pck"" />
</Target>
</Project>