summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/technical/mod-package.md50
-rw-r--r--src/SMAPI.ModBuildConfig/DeployModTask.cs6
-rw-r--r--src/SMAPI.ModBuildConfig/build/smapi.targets3
3 files changed, 35 insertions, 24 deletions
diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md
index 0f3afe9e..5ac22167 100644
--- a/docs/technical/mod-package.md
+++ b/docs/technical/mod-package.md
@@ -115,8 +115,17 @@ These are the options you can set:
<td><code>GamePath</code></td>
<td>
-The absolute path to the Stardew Valley folder. This is auto-detected, so you shouldn't need to
-change it in most cases.
+The absolute path to the Stardew Valley folder. This is auto-detected, so you usually shouldn't
+need to change it.
+
+</td>
+</tr>
+<tr>
+<td><code>GameModsPath</code></td>
+<td>
+
+The absolute path to the folder containing the game's installed mods (defaults to
+`$(GamePath)/Mods`), used when deploying the mod files.
</td>
</tr>
@@ -148,34 +157,34 @@ Whether to add a reference to [Harmony](https://stardewvalleywiki.com/Modding:Mo
</td>
</tr>
<tr>
-<td><code>ModFolderName</code></td>
+<td><code>EnableModDeploy</code></td>
<td>
-The mod name for its folder under `Mods` and its release zip (defaults to the project name).
+Whether to copy the mod files into your game's `Mods` folder (default `true`).
</td>
</tr>
<tr>
-<td><code>EnableModDeploy</code></td>
+<td><code>EnableModZip</code></td>
<td>
-Whether to copy the mod files into your game's `Mods` folder (default `true`).
+Whether to create a release-ready `.zip` file in the mod project's `bin` folder (default `true`).
</td>
</tr>
<tr>
-<td><code>ModZipPath</code></td>
+<td><code>ModFolderName</code></td>
<td>
-The folder path where the release zip is created (defaults to the project's `bin` folder).
+The mod name for its folder under `Mods` and its release zip (defaults to the project name).
</td>
</tr>
<tr>
-<td><code>EnableModZip</code></td>
+<td><code>ModZipPath</code></td>
<td>
-Whether to create a release-ready `.zip` file in the mod project's `bin` folder (default `true`).
+The folder path where the release zip is created (defaults to the project's `bin` folder).
</td>
</tr>
@@ -198,6 +207,16 @@ unit test projects, but not needed for mods that'll be run through SMAPI.
</td>
</tr>
<tr>
+<td><code>EnableGameDebugging</code></td>
+<td>
+
+Whether to configure the project so you can launch or debug the game through the _Debug_ menu in
+Visual Studio (default `true`). There's usually no reason to change this, unless it's a unit test
+project.
+
+</td>
+</tr>
+<tr>
<td><code>IgnoreModFilePatterns</code></td>
<td>
@@ -212,16 +231,6 @@ For example, this excludes all `.txt` and `.pdf` files, as well as the `assets/p
</td>
</tr>
-<tr>
-<td><code>EnableGameDebugging</code></td>
-<td>
-
-Whether to configure the project so you can launch or debug the game through the _Debug_ menu in
-Visual Studio (default `true`). There's usually no reason to change this, unless it's a unit test
-project.
-
-</td>
-</tr>
</table>
</li>
</ul>
@@ -349,6 +358,7 @@ which can be uploaded to NuGet or referenced directly.
## Release notes
### Upcoming release
+* Added option to change `Mods` folder path.
* Rewrote documentation to make it easier to read.
### 3.1
diff --git a/src/SMAPI.ModBuildConfig/DeployModTask.cs b/src/SMAPI.ModBuildConfig/DeployModTask.cs
index ced05a28..c47c8ec4 100644
--- a/src/SMAPI.ModBuildConfig/DeployModTask.cs
+++ b/src/SMAPI.ModBuildConfig/DeployModTask.cs
@@ -32,9 +32,9 @@ namespace StardewModdingAPI.ModBuildConfig
[Required]
public string TargetDir { get; set; }
- /// <summary>The folder containing the game files.</summary>
+ /// <summary>The folder containing the game's mod folders.</summary>
[Required]
- public string GameDir { get; set; }
+ public string GameModsDir { get; set; }
/// <summary>Whether to enable copying the mod files into the game's Mods folder.</summary>
[Required]
@@ -69,7 +69,7 @@ namespace StardewModdingAPI.ModBuildConfig
// deploy mod files
if (this.EnableModDeploy)
{
- string outputPath = Path.Combine(this.GameDir, "Mods", this.EscapeInvalidFilenameCharacters(this.ModFolderName));
+ string outputPath = Path.Combine(this.GameModsDir, this.EscapeInvalidFilenameCharacters(this.ModFolderName));
this.Log.LogMessage(MessageImportance.High, $"The mod build package is copying the mod files to {outputPath}...");
this.CreateModFolder(package.GetFiles(), outputPath);
}
diff --git a/src/SMAPI.ModBuildConfig/build/smapi.targets b/src/SMAPI.ModBuildConfig/build/smapi.targets
index 03db7490..0a0db190 100644
--- a/src/SMAPI.ModBuildConfig/build/smapi.targets
+++ b/src/SMAPI.ModBuildConfig/build/smapi.targets
@@ -18,6 +18,7 @@
<!-- set default package options -->
<ModFolderName Condition="'$(ModFolderName)' == ''">$(MSBuildProjectName)</ModFolderName>
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
+ <GameModsPath Condition="'$(GameModsPath)' == ''">$([System.IO.Path]::Combine($(GamePath), 'Mods')</GameModsPath>
<EnableModDeploy Condition="'$(EnableModDeploy)' == ''">true</EnableModDeploy>
<EnableModZip Condition="'$(EnableModZip)' == ''">true</EnableModZip>
<EnableHarmony Condition="'$(EnableHarmony)' == ''">false</EnableHarmony>
@@ -86,7 +87,7 @@
ProjectDir="$(ProjectDir)"
TargetDir="$(TargetDir)"
- GameDir="$(GamePath)"
+ GameModsDir="$(GameModsPath)"
IgnoreModFilePatterns="$(IgnoreModFilePatterns)"
/>
</Target>