@@ -33,12 +33,14 @@ https://github.com/freude916/sts2-quickRestart/blob/main/README.md
3333
3434## 选择文本编辑器
3535
36- 选择一个文本编辑器。可以使用[ Visual Studio Code] ( https://code.visualstudio.com/ ) 或者[ Rider] ( https://www.jetbrains.com/zh-cn/rider/download/?section=windows ) (推荐新手使用Rider)。另外也可以使用 Visual Studio等其他 IDE。以下只介绍 VS Code 的配置方法。
36+ 选择一个文本编辑器。可以使用[ Visual Studio Code] ( https://code.visualstudio.com/ ) 或者[ Rider] ( https://www.jetbrains.com/zh-cn/rider/download/?section=windows ) (< b >强烈推荐</ b >新手使用Rider)。另外也可以使用Visual Studio等其他 IDE。以下只介绍 VS Code 的配置方法。
3737
38- ## 安装VS Code插件
38+ ## 安装VS Code插件(可选)
3939
4040安装[ C# Dev Kit] ( https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit ) 。你还可以安装[ Godot Tools] ( https://marketplace.visualstudio.com/items?itemName=geequlim.godot-tools ) 等插件。
4141
42+ 记得打开设置把自动保存开了。
43+
4244![ alt text] ( ../../images/image2.png )
4345
4446## 参考官方文档
@@ -84,6 +86,7 @@ https://github.com/freude916/sts2-quickRestart/blob/main/README.md
8486``` xml
8587<Project Sdk =" Godot.NET.Sdk/4.5.1" >
8688 <PropertyGroup >
89+ <!-- 如果你安装了10.0并遇到问题,改下这里 -->
8790 <TargetFramework >net9.0</TargetFramework >
8891 <ImplicitUsings >true</ImplicitUsings >
8992 <LangVersion >12.0</LangVersion >
@@ -181,4 +184,54 @@ public class Entry
181184
182185## 不启动Godot打包(可选)
183186
184- Godot支持命令行导出pck(首先你需要添加一个导出配置),例如使用终端命令:` "{你的godot.exe的路径}" --headless --export-pack "{你的导出配置的名字,例如Windows Desktop}" "{杀戮尖塔根目录}/mods/{你的modid}/{你的modid}.pck" ` ,参考 https://docs.godotengine.org/zh-cn/4.x/tutorials/editor/command_line_tutorial.html#exporting 。你可以把这个命令保存成一个cmd或者csproj里的target,自行搜索相关配置说明。
187+ Godot支持命令行导出pck(首先你需要添加一个导出配置),例如使用终端命令:` "{你的godot.exe的路径}" --headless --export-pack "{你的导出配置的名字,例如Windows Desktop}" "{杀戮尖塔根目录}/mods/{你的modid}/{你的modid}.pck" ` ,参考 https://docs.godotengine.org/zh-cn/4.x/tutorials/editor/command_line_tutorial.html#exporting 。你可以把这个命令保存成一个cmd或者csproj里的target。
188+
189+ 例如在你的` .csproj ` 文件里添加` GodoExe ` 和` ExportPck ` 的内容:
190+
191+ ``` xml
192+ <Project Sdk =" Godot.NET.Sdk/4.5.1" >
193+ <PropertyGroup >
194+ <TargetFramework >net9.0</TargetFramework >
195+ <ImplicitUsings >true</ImplicitUsings >
196+ <LangVersion >12.0</LangVersion >
197+ <Nullable >enable</Nullable >
198+ <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
199+
200+ <Sts2Dir >D:/Files/Softwares/Steam/steamapps/common/Slay the Spire 2</Sts2Dir >
201+ <!-- 新增 -->
202+ <GodotExe >D:/Files/Projects/godot/Godot_v4.5.1-stable_mono_win64/Godot_v4.5.1-stable_mono_win64/Godot_v4.5.1-stable_mono_win64.exe</GodotExe >
203+ <Sts2DataDir >$(Sts2Dir)/data_sts2_windows_x86_64</Sts2DataDir >
204+ </PropertyGroup >
205+
206+ <ItemGroup >
207+ <Reference Include =" sts2" >
208+ <HintPath >$(Sts2DataDir)/sts2.dll</HintPath >
209+ <Private >false</Private >
210+ </Reference >
211+
212+ <Reference Include =" 0Harmony" >
213+ <HintPath >$(Sts2DataDir)/0Harmony.dll</HintPath >
214+ <Private >false</Private >
215+ </Reference >
216+ </ItemGroup >
217+
218+ <Target Name =" Copy Mod" AfterTargets =" PostBuildEvent" >
219+ <Message Text =" Copying mod to Slay the Spire 2 mods folder..." Importance =" high" />
220+ <MakeDir Directories =" $(Sts2Dir)/mods/" />
221+ <Copy SourceFiles =" $(TargetPath)" DestinationFolder =" $(Sts2Dir)/mods/$(MSBuildProjectName)/" />
222+ <Copy SourceFiles =" $(MSBuildProjectName).json" DestinationFolder =" $(Sts2Dir)/mods/$(MSBuildProjectName)/" />
223+ </Target >
224+
225+ <!-- 新增 -->
226+ <Target Name =" ExportPck" >
227+ <Message Text =" Copying PCK to Slay the Spire 2 mods folder..." Importance =" high" />
228+ <Exec Command =" " $(GodotExe)" --headless --export-pack " Windows Desktop" " $(Sts2Dir)/mods/$(MSBuildProjectName)/$(MSBuildProjectName).pck" "
229+ EnvironmentVariables =" IsInnerGodotExport=true;MSBUILDDISABLENODEREUSE=1"
230+ ContinueOnError =" WarnAndContinue" />
231+ </Target >
232+ </Project >
233+ ```
234+
235+ 然后控制台输入` dotnet build -t:ExportPck ` 即可连PCK一起导出。输入` dotnet build ` 仅编译dll。
236+
237+ 方法不限。你也可以使用` tasks.json ` 。
0 commit comments