From e55295385b592f422d43f0b525cf3bea7be19b52 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 31 Dec 2018 13:54:06 -0500 Subject: add HasFile content pack method --- docs/release-notes.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 5a7d5ef2..aae5cf3a 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,4 +1,10 @@ # Release notes +## 3.0 (upcoming release) +These changes have not been released yet. + +* For modders: + * Added `IContentPack.HasFile` method. + ## 2.11.3 Released 13 September 2019 for Stardew Valley 1.3.36. -- cgit From 31a49b83c2fda9f3990e953aeaefc2b415333f31 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 4 Jan 2019 18:32:12 -0500 Subject: update NuGet packages --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index aae5cf3a..efbd7ddb 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,6 +4,7 @@ These changes have not been released yet. * For modders: * Added `IContentPack.HasFile` method. + * Updated to Json.NET 12.0.1. ## 2.11.3 Released 13 September 2019 for Stardew Valley 1.3.36. -- cgit From 6fdb29d806eddd17f0ac33401781f7df58639075 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 10 Jan 2019 19:30:11 -0500 Subject: drop support for old versions of SMAPI and Visual Studio in mod build package --- docs/mod-build-config.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index a97c3171..329f5faf 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -216,6 +216,9 @@ That error means the package couldn't find your game. You can specify the game p _[Game path](#game-path)_ above. ## Release notes +### Upcoming release +* Dropped support for very old versions of SMAPI and Visual Studio. + ### 2.2 * Added support for SMAPI 2.8+ (still compatible with earlier versions). * Added default game paths for 32-bit Windows. -- cgit From 6b347b83a7c588638224a02840b1d90b4557ea2a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 9 Feb 2019 15:16:14 -0500 Subject: fix Save Backup not pruning old backups if they're uncompressed --- docs/release-notes.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index efbd7ddb..7724904b 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -2,6 +2,9 @@ ## 3.0 (upcoming release) These changes have not been released yet. +* For players: + * Fixed Save Backup not pruning old backups if they're uncompressed. + * For modders: * Added `IContentPack.HasFile` method. * Updated to Json.NET 12.0.1. -- cgit From 4a297e29eb0c97be799ee3939e9747dc1c631427 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 18 Feb 2019 01:33:10 -0500 Subject: better handle player reconnecting before disconnection is registered --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 7724904b..3041dbd3 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,6 +4,7 @@ These changes have not been released yet. * For players: * Fixed Save Backup not pruning old backups if they're uncompressed. + * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * For modders: * Added `IContentPack.HasFile` method. -- cgit From bad2ac2a29b8775be97133e4c4cfb67a4a7406ee Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 24 Feb 2019 19:56:08 -0500 Subject: remove deprecated APIs (#606) --- docs/release-notes.md | 1 + docs/technical-docs.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 3041dbd3..2f01ee93 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ These changes have not been released yet. * For modders: * Added `IContentPack.HasFile` method. + * Dropped support for all deprecated APIs. * Updated to Json.NET 12.0.1. ## 2.11.3 diff --git a/docs/technical-docs.md b/docs/technical-docs.md index 98dd3540..545f4aa3 100644 --- a/docs/technical-docs.md +++ b/docs/technical-docs.md @@ -106,7 +106,6 @@ SMAPI uses a small number of conditional compilation constants, which you can se flag | purpose ---- | ------- `SMAPI_FOR_WINDOWS` | Whether SMAPI is being compiled on Windows for players on Windows. Set automatically in `crossplatform.targets`. -`SMAPI_3_0_STRICT` | Whether to exclude all deprecated APIs from compilation. This is useful for testing mods for SMAPI 3.0 compatibility. # SMAPI web services ## Overview -- cgit From dc0556ff5feead4ced16b82f407b6b271cbb3d30 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 7 Mar 2019 18:19:11 -0500 Subject: fix log level for multiplayer 'received message' logs --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 2f01ee93..c10e663d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,6 +5,7 @@ These changes have not been released yet. * For players: * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. + * Fixed 'received message' logs shown in non-developer mode. * For modders: * Added `IContentPack.HasFile` method. -- cgit From 332bcfa5a19509352aa417a04a677b5701c16986 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 21 Mar 2019 23:12:26 -0400 Subject: add content pack translations --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index c10e663d..afcf0066 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ These changes have not been released yet. * Fixed 'received message' logs shown in non-developer mode. * For modders: + * Added support for content pack translations. * Added `IContentPack.HasFile` method. * Dropped support for all deprecated APIs. * Updated to Json.NET 12.0.1. -- cgit From f78502a3a4a133b93cf9bf01eb426867e7798045 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 21 Mar 2019 23:14:31 -0400 Subject: fix incorrect input check, update release notes --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index afcf0066..4fb7b6c3 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,7 @@ These changes have not been released yet. * For players: + * Improved performance. * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From 34633cfed9efb8a53b148584c1b3909bac69372f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 29 Mar 2019 23:58:06 -0400 Subject: bundle assets folder into mods by default --- docs/mod-build-config.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 329f5faf..14d167f2 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -6,6 +6,7 @@ The package... * detects your game install path; * adds the assembly references you need (with automatic support for Linux/Mac/Windows); * packages the mod into your `Mods` folder when you rebuild the code (configurable); +* creates a release zip (configurable); * configures Visual Studio to enable debugging into the code when the game is running (_Windows only_); * adds C# analyzers to warn for Stardew Valley-specific issues. @@ -17,25 +18,21 @@ The package... * [Release notes](#release-notes) ## Install -**When creating a new mod:** - -1. Create an empty library project. +1. Create an empty library project.
(For an existing project, remove references to `Microsoft.Xna.*`, `MonoGame`, Stardew Valley, + `StardewModdingAPI`, and `xTile` instead.) 2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). 3. [Write your code](https://stardewvalleywiki.com/Modding:Creating_a_SMAPI_mod). 4. Compile on any platform. -**When migrating an existing mod:** - -1. Remove any project references to `Microsoft.Xna.*`, `MonoGame`, Stardew Valley, - `StardewModdingAPI`, and `xTile`. -2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). -3. Compile on any platform. - ## Configure ### Deploy files into the `Mods` folder -By default, your mod will be copied into the game's `Mods` folder (with a subfolder matching your -project name) when you rebuild the code. The package will automatically include your -`manifest.json`, any `i18n` files, and the build output. +Your mod is copied into the game's `Mods` folder (with a subfolder matching your project name) +when you rebuild the code. The package automatically includes... + +* any build output; +* your `manifest.json`; +* any [`i18n` files](https://stardewvalleywiki.com/Modding:Translations); +* the `assets` folder if present. To add custom files to the mod folder, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). (If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) @@ -52,9 +49,9 @@ If you don't want to deploy the mod automatically, you can add this: ``` ### Create release zip -By default, a zip file will be created in the build output when you rebuild the code. This zip file -contains all the files needed to share your mod in the recommended format for uploading to Nexus -Mods or other sites. +A zip file is also created in the build output folder when you rebuild the code. This contains the +same files deployed to the `Mods` folder, in the recommended format for uploading to Nexus Mods or +other sites. You can change the zipped folder name (and zip name) by adding this above the first `` in your `.csproj`: -- cgit From 4689eeb6a3af1aead00347fc2575bfebdee50113 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 30 Mar 2019 01:25:12 -0400 Subject: load mods much earlier so they can intercept all content assets --- docs/release-notes.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 4fb7b6c3..649cd774 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -11,6 +11,8 @@ These changes have not been released yet. * For modders: * Added support for content pack translations. * Added `IContentPack.HasFile` method. + * Added `Context.IsGameLaunched` field. + * Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised). * Dropped support for all deprecated APIs. * Updated to Json.NET 12.0.1. -- cgit From 80741d3d2da39fed43e9208df85318de9bc7e1d2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 30 Mar 2019 01:32:54 -0400 Subject: update NuGet package version & release notes --- docs/mod-build-config.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 14d167f2..5024aec5 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -214,7 +214,9 @@ _[Game path](#game-path)_ above. ## Release notes ### Upcoming release +* If the project contains an `assets` folder, its contents are now included in the mod automatically. * Dropped support for very old versions of SMAPI and Visual Studio. +* Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. ### 2.2 * Added support for SMAPI 2.8+ (still compatible with earlier versions). -- cgit From d10ded0fcc5e92f16d13a34e1d83925a1f99feb1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 4 Apr 2019 00:10:03 -0400 Subject: update compatibility list --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 649cd774..e9819860 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -4,6 +4,7 @@ These changes have not been released yet. * For players: * Improved performance. + * Updated mod compatibility list. * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From 09d1c5a601e77c051dfde8a31f422b2c898086c3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 6 Apr 2019 00:35:53 -0400 Subject: list all detected issues in trace logs for incompatible mods --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index e9819860..6aa3c024 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -14,6 +14,7 @@ These changes have not been released yet. * Added `IContentPack.HasFile` method. * Added `Context.IsGameLaunched` field. * Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised). + * When a mod is incompatible, the trace logs now list all detected issues instead of the first one. * Dropped support for all deprecated APIs. * Updated to Json.NET 12.0.1. -- cgit From 6c220453e16c6cb5ad150b61cf02685a97557b3c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 15 Apr 2019 00:40:45 -0400 Subject: fix translatable assets not updated when switching language (#586) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 6aa3c024..84738ff7 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ These changes have not been released yet. * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. + * Fixed some assets not updated when you switch language to English. * For modders: * Added support for content pack translations. -- cgit From ee132828437c156207ddfc1cbc15339a6852c2fe Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 15 Apr 2019 22:13:10 -0400 Subject: update for new DLL in SDV 1.4 (#638) --- docs/mod-build-config.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 5024aec5..8bd7b79d 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -214,6 +214,7 @@ _[Game path](#game-path)_ above. ## Release notes ### Upcoming release +* Updated for Stardew Valley 1.4. * If the project contains an `assets` folder, its contents are now included in the mod automatically. * Dropped support for very old versions of SMAPI and Visual Studio. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. -- cgit From 78f28357e4f87ed619144229ea65c1e1cb0f9dd3 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 15 Apr 2019 22:36:50 -0400 Subject: update code for SDV 1.4 (#638) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 84738ff7..32f4db37 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,7 @@ These changes have not been released yet. * For players: + * Updated for Stardew Valley 1.4. * Improved performance. * Updated mod compatibility list. * Fixed Save Backup not pruning old backups if they're uncompressed. -- cgit From b887ecb30b4c41d58c6211ea00423f8259eebef5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 18 Apr 2019 22:46:00 -0400 Subject: fix not applied to files matched by convention, update readme --- docs/mod-build-config.md | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 8bd7b79d..4f46100a 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -26,16 +26,9 @@ The package... ## Configure ### Deploy files into the `Mods` folder -Your mod is copied into the game's `Mods` folder (with a subfolder matching your project name) -when you rebuild the code. The package automatically includes... - -* any build output; -* your `manifest.json`; -* any [`i18n` files](https://stardewvalleywiki.com/Modding:Translations); -* the `assets` folder if present. - -To add custom files to the mod folder, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). -(If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) +Your mod is copied into the game's `Mods` folder when you rebuild the code, with a subfolder +matching the mod's project name. This includes the files set via [_Files included in the release_](#files-included-in-release) +below. You can change the mod's folder name by adding this above the first `` in your `.csproj`: @@ -49,9 +42,9 @@ If you don't want to deploy the mod automatically, you can add this: ``` ### Create release zip -A zip file is also created in the build output folder when you rebuild the code. This contains the -same files deployed to the `Mods` folder, in the recommended format for uploading to Nexus Mods or -other sites. +A zip file is also created in the build output folder when you rebuild the code. This includes the +files set via [_Files included in the release_](#files-included-in-release) below, in the format +recommended for uploading to Nexus Mods or other sites. You can change the zipped folder name (and zip name) by adding this above the first `` in your `.csproj`: @@ -118,15 +111,30 @@ or you have multiple installs, you can specify the path yourself. There's two wa The configuration will check your custom path first, then fall back to the default paths (so it'll still compile on a different computer). -### Ignore files -If you don't want to include a file in the mod folder or release zip: -* Make sure it's not copied to the build output. For a DLL, make sure the reference is [not marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx). +You access the game path via `$(GamePath)` in MSBuild properties, if you need to reference another +file in the game folder. + +### Files included in release +The package automatically considers these files to be part of your mod: + +* the `manifest.json` in your project; +* the [`i18n` files](https://stardewvalleywiki.com/Modding:Translations) in your project (if any); +* the `assets` folder in your project (if present); +* and any files in the build output folder. + +To add custom files to the release, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). +(If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) + +To exclude a file from the release: +* Make sure it's not copied to the build output. (For a DLL, make sure the reference is [not marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) This doesn't apply to `manifest.json`, + `assets`, or `i18n` which are copied regardless.) * Or add this to your `.csproj` file under the `\.txt$, \.pdf$ ``` This is a comma-delimited list of regular expression patterns. If any pattern matches a file's - relative path in your mod folder, that file won't be included. + relative path in your mod folder, that file won't be included. (This also works for `assets` and + `i18n`.) ### Non-mod projects You can use the package in non-mod projects too (e.g. unit tests or framework DLLs). You'll need to @@ -216,8 +224,9 @@ _[Game path](#game-path)_ above. ### Upcoming release * Updated for Stardew Valley 1.4. * If the project contains an `assets` folder, its contents are now included in the mod automatically. -* Dropped support for very old versions of SMAPI and Visual Studio. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. +* Fixed `` not working for `i18n` files. +* Dropped support for very old versions of SMAPI and Visual Studio. ### 2.2 * Added support for SMAPI 2.8+ (still compatible with earlier versions). -- cgit From 3080c4fff4c70cc9672a4e3d0abbdc9ed49dab6c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 21 Apr 2019 14:20:41 -0400 Subject: clarify path formatting in --- docs/mod-build-config.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 4f46100a..fc63a5a2 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -136,6 +136,12 @@ To exclude a file from the release: relative path in your mod folder, that file won't be included. (This also works for `assets` and `i18n`.) + Note that path delimiters are _not_ normalised in ``. For crossplatform + compatibility, format those like this: + ```xml + assets[/\\]paths.png + ``` + ### Non-mod projects You can use the package in non-mod projects too (e.g. unit tests or framework DLLs). You'll need to disable deploying the mod and creating a release zip: -- cgit From f8e32f4433647b7bd69590b937927808168649df Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 24 Apr 2019 01:26:15 -0400 Subject: update release notes, tweak launch script comments (#640) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 32f4db37..12fd5a3d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -6,6 +6,7 @@ These changes have not been released yet. * Updated for Stardew Valley 1.4. * Improved performance. * Updated mod compatibility list. + * Rewrote launch script on Linux to improve compatibility (thanks to kurumushi and toastal!). * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From c15785a68d3e99959cdcca5bfb51e8686316a33b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 24 Apr 2019 23:46:52 -0400 Subject: simplify config.json and metadata.json names --- docs/technical-docs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/technical-docs.md b/docs/technical-docs.md index 545f4aa3..5598b7a8 100644 --- a/docs/technical-docs.md +++ b/docs/technical-docs.md @@ -70,8 +70,8 @@ on the wiki for the first-time setup. ## Customisation ### Configuration file -You can customise the SMAPI behaviour by editing the `smapi-internal/StardewModdingAPI.config.json` -file in your game folder. +You can customise the SMAPI behaviour by editing the `smapi-internal/config.json` file in your game +folder. Basic fields: -- cgit From e18ffc009d4fd56b200b0bb13b671940c9fadbc7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 25 Apr 2019 00:50:26 -0400 Subject: update mods + mod build package for smapi-internal changes --- docs/mod-build-config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index fc63a5a2..aee81113 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -228,11 +228,11 @@ _[Game path](#game-path)_ above. ## Release notes ### Upcoming release -* Updated for Stardew Valley 1.4. +* Updated for SMAPI 3.0 and Stardew Valley 1.4. * If the project contains an `assets` folder, its contents are now included in the mod automatically. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. * Fixed `` not working for `i18n` files. -* Dropped support for very old versions of SMAPI and Visual Studio. +* Dropped support for older versions of SMAPI and Visual Studio. ### 2.2 * Added support for SMAPI 2.8+ (still compatible with earlier versions). -- cgit From a450b0ebefbf7eb4ca5fa41947eef36fe18ca19a Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 1 May 2019 19:40:47 -0400 Subject: drop monitor.ExitGameImmediately method This is bad practice in most cases, and was only used by two mods which didn't legitimately need to exit immediately. --- docs/release-notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 12fd5a3d..05fccd74 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,7 +18,8 @@ These changes have not been released yet. * Added `Context.IsGameLaunched` field. * Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised). * When a mod is incompatible, the trace logs now list all detected issues instead of the first one. - * Dropped support for all deprecated APIs. + * Removed all deprecated APIs. + * Removed the `Monitor.ExitGameImmediately` method. * Updated to Json.NET 12.0.1. ## 2.11.3 -- cgit From 30cc7ac9161e4cea91c3b566a7edb5e438af98cb Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 1 May 2019 23:45:50 -0400 Subject: consolidate XNB mods when scanning mods --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 05fccd74..68763598 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,7 @@ These changes have not been released yet. * Improved performance. * Updated mod compatibility list. * Rewrote launch script on Linux to improve compatibility (thanks to kurumushi and toastal!). + * Improved handling for XNB mods unzipped into `Mods` (improved detection over generic invalid mods, and multi-folder XNB mods are now counted as one mod). * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From 83ae036e09aab6830fcf83ae3065628d4ab91143 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 4 May 2019 13:53:34 -0400 Subject: improve XNB mod and ignore file matching --- docs/release-notes.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 68763598..14d1a8fa 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,9 +5,12 @@ These changes have not been released yet. * For players: * Updated for Stardew Valley 1.4. * Improved performance. - * Updated mod compatibility list. * Rewrote launch script on Linux to improve compatibility (thanks to kurumushi and toastal!). - * Improved handling for XNB mods unzipped into `Mods` (improved detection over generic invalid mods, and multi-folder XNB mods are now counted as one mod). + * Improved mod scanning: + * Now ignores metadata files/folders like `__MACOSX` and `__folder_managed_by_vortex`. + * Now ignores content files like `.txt` or `.png`, which avoids missing-manifest errors in some common cases. + * Now detects XNB mods more accurately, and consolidates multi-folder XNB mods. + * Updated mod compatibility list. * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From f2dd11fe3fbe8b31665ad25e6e58b0026c00098e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 10 May 2019 23:49:08 -0400 Subject: fix inconsistent LoadStage behavior when creating a new save --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 14d1a8fa..e4024d07 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -25,6 +25,7 @@ These changes have not been released yet. * Removed all deprecated APIs. * Removed the `Monitor.ExitGameImmediately` method. * Updated to Json.NET 12.0.1. + * Fixed `LoadStageChanged` event not raising correct flags in some cases when creating a new save. ## 2.11.3 Released 13 September 2019 for Stardew Valley 1.3.36. -- cgit From 5cd5e2416dfe6eab1a36be1646890d57f3f4a191 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 16 May 2019 19:16:08 -0400 Subject: fix cache misses for non-English players --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index e4024d07..3718ac38 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -15,6 +15,7 @@ These changes have not been released yet. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. * Fixed some assets not updated when you switch language to English. + * Fixed lag in some cases due to incorrect asset caching when playing in non-English. * For modders: * Added support for content pack translations. -- cgit From 2b12bb32f67422a7d25eb7e2d8ea8e1c3e335708 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 17 May 2019 19:41:26 -0400 Subject: batch reload assets in some cases --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 3718ac38..2b03579b 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -16,6 +16,7 @@ These changes have not been released yet. * Fixed 'received message' logs shown in non-developer mode. * Fixed some assets not updated when you switch language to English. * Fixed lag in some cases due to incorrect asset caching when playing in non-English. + * Fixed lag when a mod invalidates many NPC portraits/sprites at once. * For modders: * Added support for content pack translations. -- cgit From 24160cacdce0b2e31a3f7dc130fe84cb164bcf19 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 23 May 2019 14:56:44 -0400 Subject: fix tilesheets not seasonalised when a map is reloaded (#642) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 2b03579b..513423ca 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -17,6 +17,7 @@ These changes have not been released yet. * Fixed some assets not updated when you switch language to English. * Fixed lag in some cases due to incorrect asset caching when playing in non-English. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. + * Fixed seasonal tilesheet issues when a mod reloads a map. * For modders: * Added support for content pack translations. -- cgit From d4e09c5a8524fad43e2ecf94ade86673a94b85a5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 25 May 2019 01:59:32 -0400 Subject: fix tilesheets seasonalised when loading an indoor map --- docs/release-notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 513423ca..6b552395 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -17,7 +17,8 @@ These changes have not been released yet. * Fixed some assets not updated when you switch language to English. * Fixed lag in some cases due to incorrect asset caching when playing in non-English. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. - * Fixed seasonal tilesheet issues when a mod reloads a map. + * Fixed map reloads resetting tilesheet seasons. + * Fixed outdoor tilesheets being seasonalised when added to an indoor location. * For modders: * Added support for content pack translations. -- cgit From bf3738eacb192492113fd968b50ff57fac26557c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 29 May 2019 21:26:57 -0400 Subject: add separate LogNetworkTraffic option --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 6b552395..cfd33fbc 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -25,6 +25,7 @@ These changes have not been released yet. * Added `IContentPack.HasFile` method. * Added `Context.IsGameLaunched` field. * Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised). + * Added separate `LogNetworkTraffic` option to make verbose logging less overwhelmingly verbose. * When a mod is incompatible, the trace logs now list all detected issues instead of the first one. * Removed all deprecated APIs. * Removed the `Monitor.ExitGameImmediately` method. -- cgit From fff5e8c93921449afcfd1cebf7fd5616abc15d45 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 29 May 2019 22:32:52 -0400 Subject: move most mod asset loading logic into content managers (#644) This fixes mods needing to load Map assets manually before the game could load them via internal key. --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index cfd33fbc..f8d4cbbf 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -11,6 +11,7 @@ These changes have not been released yet. * Now ignores content files like `.txt` or `.png`, which avoids missing-manifest errors in some common cases. * Now detects XNB mods more accurately, and consolidates multi-folder XNB mods. * Updated mod compatibility list. + * Fixed mods needing to load custom `Map` assets before the game accesses them (SMAPI will now do so automatically). * Fixed Save Backup not pruning old backups if they're uncompressed. * Fixed issues when a farmhand reconnects before the game notices they're disconnected. * Fixed 'received message' logs shown in non-developer mode. -- cgit From c37fe62ca2ea8a072a16acd28bb38bc69911fd5b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 29 May 2019 23:17:13 -0400 Subject: no longer forward managed asset keys loaded through a mod content manager (#644) That isn't needed for any documented functionality, and allowed mods to load (and in some cases edit) a different mod's local assets. --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index f8d4cbbf..d478bfa2 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -20,6 +20,7 @@ These changes have not been released yet. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. * Fixed map reloads resetting tilesheet seasons. * Fixed outdoor tilesheets being seasonalised when added to an indoor location. + * Fixed mods able to directly load (and in some cases edit) a different mod's local assets using internal asset key forwarding. * For modders: * Added support for content pack translations. -- cgit From b9dec734693f50b3b32977cd505f091a2c8b8382 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 30 May 2019 17:40:21 -0400 Subject: disable mod-level asset caching (#644) This fixes an issue where some asset references could be shared between content managers, causing changes to propagate unintentionally. --- docs/release-notes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index d478bfa2..3edfec44 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -20,7 +20,6 @@ These changes have not been released yet. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. * Fixed map reloads resetting tilesheet seasons. * Fixed outdoor tilesheets being seasonalised when added to an indoor location. - * Fixed mods able to directly load (and in some cases edit) a different mod's local assets using internal asset key forwarding. * For modders: * Added support for content pack translations. @@ -52,6 +51,8 @@ Released 13 September 2019 for Stardew Valley 1.3.36. * For modders: * `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`. The change will only take effect when you recompile the mod. * Fixed 'location list changed' verbose log not correctly listing changes. + * Fixed mods able to directly load (and in some cases edit) a different mod's local assets using internal asset key forwarding. + * Fixed changes to a map loaded by a mod being persisted across content managers. ## 2.11.2 Released 23 April 2019 for Stardew Valley 1.3.36. -- cgit From b47329d5b83db3b5ec2338af1f17d628610b05f2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 9 Jun 2019 16:26:01 -0400 Subject: fix year edge case in date calculations --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 3edfec44..2cb477fd 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -53,6 +53,7 @@ Released 13 September 2019 for Stardew Valley 1.3.36. * Fixed 'location list changed' verbose log not correctly listing changes. * Fixed mods able to directly load (and in some cases edit) a different mod's local assets using internal asset key forwarding. * Fixed changes to a map loaded by a mod being persisted across content managers. + * Fixed `SDate.AddDays` incorrectly changing year when the result is exactly winter 28. ## 2.11.2 Released 23 April 2019 for Stardew Valley 1.3.36. -- cgit From d5a7465b0219c3d736b1ac5aff1758ba41887fcc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 11 Jun 2019 20:23:20 -0400 Subject: add mod build features for new csproj format --- docs/mod-build-config.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index aee81113..22b5f4ea 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -230,8 +230,11 @@ _[Game path](#game-path)_ above. ### Upcoming release * Updated for SMAPI 3.0 and Stardew Valley 1.4. * If the project contains an `assets` folder, its contents are now included in the mod automatically. +* For projects using the new `.csproj` format: + * platform target is now set to x86 automatically to avoid mismatching platform target warnings; + * added GAC to assembly search paths to fix references to XNA Framework. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. -* Fixed `` not working for `i18n` files. +* Fixed `<IgnoreModFilePatterns>` not working for `i18n` files. * Dropped support for older versions of SMAPI and Visual Studio. ### 2.2 -- cgit From 93551c094139d4446ef5c4fc69bcda26e49e62bd Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 13 Jun 2019 18:19:27 -0400 Subject: add temporary backwards compatibility for SDV 1.3.36 in mod build package --- docs/mod-build-config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 22b5f4ea..4ffc34a9 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -228,13 +228,13 @@ _[Game path](#game-path)_ above. ## Release notes ### Upcoming release -* Updated for SMAPI 3.0 and Stardew Valley 1.4. +* Updated for SMAPI 3.0 and Stardew Valley 1.4. (The beta is backwards-compatible with previous versions.) * If the project contains an `assets` folder, its contents are now included in the mod automatically. * For projects using the new `.csproj` format: * platform target is now set to x86 automatically to avoid mismatching platform target warnings; * added GAC to assembly search paths to fix references to XNA Framework. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. -* Fixed `<IgnoreModFilePatterns>` not working for `i18n` files. +* Fixed `` not working for `i18n` files. * Dropped support for older versions of SMAPI and Visual Studio. ### 2.2 -- cgit From 31c882c8cea66bbd2805cc5aab11abbce248782c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 13 Jun 2019 19:35:51 -0400 Subject: fix map reloads not updating door warps (#643) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 2cb477fd..b7cd61c6 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -19,6 +19,7 @@ These changes have not been released yet. * Fixed lag in some cases due to incorrect asset caching when playing in non-English. * Fixed lag when a mod invalidates many NPC portraits/sprites at once. * Fixed map reloads resetting tilesheet seasons. + * Fixed map reloads not updating door warps. * Fixed outdoor tilesheets being seasonalised when added to an indoor location. * For modders: -- cgit From d3209b17de4e46ee1d604aac24642af80ce855cc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 14 Jun 2019 01:16:50 -0400 Subject: decouple updating watchers & raising event to fix some mod changes not being tracked correctly (#648) --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index b7cd61c6..6d883baf 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -32,6 +32,7 @@ These changes have not been released yet. * Removed all deprecated APIs. * Removed the `Monitor.ExitGameImmediately` method. * Updated to Json.NET 12.0.1. + * Fixed issue where mod changes weren't tracked correctly for raising events in some cases. Events now reflect a frozen snapshot of the game state, and any mod changes are reflected in the next event tick. * Fixed `LoadStageChanged` event not raising correct flags in some cases when creating a new save. ## 2.11.3 -- cgit From 480b307e6220e5a503f02ed857873ec8a0720e91 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 16 Jun 2019 14:18:30 -0400 Subject: include PDB files in mod builds by default --- docs/mod-build-config.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 4ffc34a9..22180059 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -8,7 +8,8 @@ The package... * packages the mod into your `Mods` folder when you rebuild the code (configurable); * creates a release zip (configurable); * configures Visual Studio to enable debugging into the code when the game is running (_Windows only_); -* adds C# analyzers to warn for Stardew Valley-specific issues. +* adds C# analyzers to warn for Stardew Valley-specific issues; +* preconfigures common settings (e.g. enable line numbers in stack traces). ## Contents * [Install](#install) @@ -233,6 +234,7 @@ _[Game path](#game-path)_ above. * For projects using the new `.csproj` format: * platform target is now set to x86 automatically to avoid mismatching platform target warnings; * added GAC to assembly search paths to fix references to XNA Framework. +* Builds now include `.pdb` files by default, to enable line numbers in error stack traces. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. * Fixed `` not working for `i18n` files. * Dropped support for older versions of SMAPI and Visual Studio. -- cgit From 1a8c7345c3986acd172f91716bbf04fc7192317b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 17 Jun 2019 18:51:31 -0400 Subject: add stardewvalley.targets support to toolkit --- docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/release-notes.md b/docs/release-notes.md index 6d883baf..efac8f41 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -28,6 +28,7 @@ These changes have not been released yet. * Added `Context.IsGameLaunched` field. * Mods are now loaded much earlier in the game launch. This lets mods intercept any content asset, but the game is not fully initialised when `Entry` is called (use the `GameLaunched` event if you need to run code when the game is initialised). * Added separate `LogNetworkTraffic` option to make verbose logging less overwhelmingly verbose. + * The installer now recognises custom game paths stored in `stardewvalley.targets`, if any. * When a mod is incompatible, the trace logs now list all detected issues instead of the first one. * Removed all deprecated APIs. * Removed the `Monitor.ExitGameImmediately` method. -- cgit From 2cf2b6706f9e31775b1afe05980cfaed96ab1690 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 17 Jun 2019 18:52:03 -0400 Subject: move game detection into toolkit for reuse --- docs/mod-build-config.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 22180059..a2b121f4 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -68,6 +68,14 @@ Or only create it in release builds with this: False ``` +### Debug game +The package automatically configures Visual Studio to launch/debug the game when you launch/debug +the project. To disable that, add this above the first `` in your `.csproj`: + +```xml +False +``` + ### Game path The package usually detects where your game is installed automatically. If it can't find your game or you have multiple installs, you can specify the path yourself. There's two ways to do that: @@ -148,6 +156,7 @@ You can use the package in non-mod projects too (e.g. unit tests or framework DL disable deploying the mod and creating a release zip: ```xml +False False False ``` @@ -235,6 +244,7 @@ _[Game path](#game-path)_ above. * platform target is now set to x86 automatically to avoid mismatching platform target warnings; * added GAC to assembly search paths to fix references to XNA Framework. * Builds now include `.pdb` files by default, to enable line numbers in error stack traces. +* You can now optionally disable game debugging config. * Fixed `Newtonsoft.Json.pdb` included in release zips when Json.NET is referenced directly. * Fixed `` not working for `i18n` files. * Dropped support for older versions of SMAPI and Visual Studio. -- cgit From ffe5bc1d4d6ba797a76856b3c98dd853d8f90086 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 17 Jun 2019 18:52:19 -0400 Subject: remove temporary backwards-compat in mod build package --- docs/mod-build-config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index a2b121f4..22c37397 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -238,7 +238,7 @@ _[Game path](#game-path)_ above. ## Release notes ### Upcoming release -* Updated for SMAPI 3.0 and Stardew Valley 1.4. (The beta is backwards-compatible with previous versions.) +* Updated for SMAPI 3.0 and Stardew Valley 1.4. * If the project contains an `assets` folder, its contents are now included in the mod automatically. * For projects using the new `.csproj` format: * platform target is now set to x86 automatically to avoid mismatching platform target warnings; -- cgit From 4eab734c81295b3fedcd47f6a778eba4b22a30e9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 18 Jun 2019 20:06:09 -0400 Subject: reorganise and partly rewrite mod build config readme --- docs/mod-build-config.md | 153 +++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 85 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 22c37397..6f32c156 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -1,82 +1,113 @@ The **mod build package** is an open-source NuGet package which automates the MSBuild configuration -for SMAPI mods. - -The package... - -* detects your game install path; -* adds the assembly references you need (with automatic support for Linux/Mac/Windows); -* packages the mod into your `Mods` folder when you rebuild the code (configurable); -* creates a release zip (configurable); -* configures Visual Studio to enable debugging into the code when the game is running (_Windows only_); -* adds C# analyzers to warn for Stardew Valley-specific issues; -* preconfigures common settings (e.g. enable line numbers in stack traces). +for SMAPI mods and related tools. ## Contents * [Install](#install) +* [Use](#use) * [Configure](#configure) -* [Code analysis warnings](#code-analysis-warnings) * [Troubleshoot](#troubleshoot) +* [Code analysis warnings](#code-analysis-warnings) * [Release notes](#release-notes) ## Install -1. Create an empty library project.
(For an existing project, remove references to `Microsoft.Xna.*`, `MonoGame`, Stardew Valley, - `StardewModdingAPI`, and `xTile` instead.) +1. Create an empty library project. 2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). 3. [Write your code](https://stardewvalleywiki.com/Modding:Creating_a_SMAPI_mod). 4. Compile on any platform. +## Use +Once you reference it, the package automatically... + +* detects your game install path (and creates a `$(GamePath)` variable if you need to use it in your `.csproj` file); +* adds the assembly references needed (with automatic support for Linux/Mac/Windows); +* packages the mod into your `Mods` folder when you rebuild the code; +* creates a release zip; +* configures Visual Studio to enable debugging into the code when the game is running (_Windows only_); +* adds C# analyzers to warn for Stardew Valley-specific issues; +* preconfigures common settings (e.g. enable line numbers in stack traces). + ## Configure -### Deploy files into the `Mods` folder -Your mod is copied into the game's `Mods` folder when you rebuild the code, with a subfolder -matching the mod's project name. This includes the files set via [_Files included in the release_](#files-included-in-release) -below. +Most mods use the package as-is, but you can configure its functionality by editing your mod's +`.csproj` file to add the properties shown below between the first `` and +`` tags. -You can change the mod's folder name by adding this above the first `` in your -`.csproj`: +### Copy files into the `Mods` folder +The mod files are copied into your game's `Mods` folder when you rebuild the code, with a subfolder +matching the mod's project name (see [included files](#which-files-are-part-of-your-mod)). + +You can change the folder name: ```xml YourModName ``` -If you don't want to deploy the mod automatically, you can add this: +Or disable deploying the files: ```xml False ``` ### Create release zip -A zip file is also created in the build output folder when you rebuild the code. This includes the -files set via [_Files included in the release_](#files-included-in-release) below, in the format -recommended for uploading to Nexus Mods or other sites. +A zip file is created in your project's `bin` folder when you rebuild the code, in the format +recommended for sites like Nexus Mods (see [included files](#which-files-are-part-of-your-mod)). +The zip filename is set by `ModFolderName` (see previous). -You can change the zipped folder name (and zip name) by adding this above the first -`` in your `.csproj`: +You can change the folder path where the zip is created: ```xml -YourModName +$(SolutionDir)\_releases ``` -You can change the folder path where the zip is created like this: +Or disable zip creation (or only enable it for release-mode builds): ```xml -$(SolutionDir)\_releases +False +False ``` -Finally, you can disable the zip creation with this: +### Which files are part of your mod? +These files are part of your mod by default: `manifest.json`, +[`i18n` files](https://stardewvalleywiki.com/Modding:Translations) (if any), the `assets` folder +(if any), and all files in the build output. For example, compiling the mod will copy those files +into your game's `Mods` folder and add them to the release zip (see previous sections). + +Add custom files by [adding them to the build output](https://stackoverflow.com/a/10828462/262123). +(If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) + +To remove a file, either remove it from the build output _or_ set this property to a +comma-delimited list of regular expression patterns. If any pattern matches a file's +relative path in your mod folder, that file won't be included (this works with default files like +`assets` too.) + ```xml -False +\.txt$, \.pdf$ ``` -Or only create it in release builds with this: +Note that path delimiters are _not_ normalised in ``. For crossplatform +compatibility, you should format slashes like `assets[/\\]paths.png`. + +### Launch or debug game +The package configures Visual Studio to launch/debug the game when you launch/debug the project. + +You can disable that: + ```xml -False +False ``` -### Debug game -The package automatically configures Visual Studio to launch/debug the game when you launch/debug -the project. To disable that, add this above the first `` in your `.csproj`: +### Non-mod projects +You can use the package in non-mod projects too (e.g. unit tests or framework DLLs). Just disable +the mod-related package features: ```xml False +False +False ``` -### Game path +If you need to copy the referenced DLLs into your build output, add this too: +```xml +True +``` + +## Troubleshoot +### Set the game path The package usually detects where your game is installed automatically. If it can't find your game or you have multiple installs, you can specify the path yourself. There's two ways to do that: @@ -123,49 +154,6 @@ still compile on a different computer). You access the game path via `$(GamePath)` in MSBuild properties, if you need to reference another file in the game folder. -### Files included in release -The package automatically considers these files to be part of your mod: - -* the `manifest.json` in your project; -* the [`i18n` files](https://stardewvalleywiki.com/Modding:Translations) in your project (if any); -* the `assets` folder in your project (if present); -* and any files in the build output folder. - -To add custom files to the release, just [add them to the build output](https://stackoverflow.com/a/10828462/262123). -(If your project references another mod, make sure the reference is [_not_ marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) - -To exclude a file from the release: -* Make sure it's not copied to the build output. (For a DLL, make sure the reference is [not marked 'copy local'](https://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.100).aspx).) This doesn't apply to `manifest.json`, - `assets`, or `i18n` which are copied regardless.) -* Or add this to your `.csproj` file under the `\.txt$, \.pdf$
- ``` - This is a comma-delimited list of regular expression patterns. If any pattern matches a file's - relative path in your mod folder, that file won't be included. (This also works for `assets` and - `i18n`.) - - Note that path delimiters are _not_ normalised in ``. For crossplatform - compatibility, format those like this: - ```xml - assets[/\\]paths.png - ``` - -### Non-mod projects -You can use the package in non-mod projects too (e.g. unit tests or framework DLLs). You'll need to -disable deploying the mod and creating a release zip: - -```xml -False -False -False -``` - -If this is for unit tests, you may need to copy the referenced DLLs into your build output too: -```xml -True -``` - ## Code warnings ### Overview The NuGet package adds code warnings in Visual Studio specific to Stardew Valley. For example: @@ -231,11 +219,6 @@ Warning text: Your code accesses a field which is obsolete or no longer works. Use the suggested field instead. -## Troubleshoot -### "Failed to find the game install path" -That error means the package couldn't find your game. You can specify the game path yourself; see -_[Game path](#game-path)_ above. - ## Release notes ### Upcoming release * Updated for SMAPI 3.0 and Stardew Valley 1.4. -- cgit From 601f22b296f2eac945b63275a2e80c1841f94083 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 18 Jun 2019 22:22:09 -0400 Subject: overhaul mod build package readme --- docs/mod-build-config.md | 254 +++++++++++++++++++++++++++-------------------- 1 file changed, 144 insertions(+), 110 deletions(-) (limited to 'docs') diff --git a/docs/mod-build-config.md b/docs/mod-build-config.md index 6f32c156..0150c65d 100644 --- a/docs/mod-build-config.md +++ b/docs/mod-build-config.md @@ -1,39 +1,73 @@ -The **mod build package** is an open-source NuGet package which automates the MSBuild configuration -for SMAPI mods and related tools. +The **mod build package** is an open-source NuGet package which automates the MSBuild configuration +for SMAPI mods and related tools. The package is fully compatible with Linux, Mac, and Windows. ## Contents -* [Install](#install) * [Use](#use) -* [Configure](#configure) -* [Troubleshoot](#troubleshoot) -* [Code analysis warnings](#code-analysis-warnings) +* [Features](#features) + * [Detect game path](#detect-game-path) + * [Add assembly references](#add-assembly-references) + * [Copy files into the `Mods` folder and create release zip](#copy-files-into-the-mods-folder-and-create-release-zip) + * [Launch or debug game](#launch-or-debug-game) + * [Preconfigure common settings](#preconfigure-common-settings) + * [Add code warnings](#add-code-warnings) +* [Code warnings](#code-warnings) +* [Special cases](#special-cases) + * [Custom game path](#custom-game-path) + * [Non-mod projects](#non-mod-projects) * [Release notes](#release-notes) -## Install +## Use 1. Create an empty library project. 2. Reference the [`Pathoschild.Stardew.ModBuildConfig` NuGet package](https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig). 3. [Write your code](https://stardewvalleywiki.com/Modding:Creating_a_SMAPI_mod). 4. Compile on any platform. +5. Run the game to play with your mod. -## Use -Once you reference it, the package automatically... +## Features +The package automatically makes the changes listed below. In some cases you can configure how it +works by editing your mod's `.csproj` file, and adding the given properties between the first +`` and `` tags. + +### Detect game path +The package finds your game folder by scanning the default install paths and Windows registry. It +adds a `$(GamePath)` variable with the detected path for use in `.csproj` file (e.g. to load a +custom game DLL). If this doesn't work automatically, see [_set the game path_](#set-the-game-path). + +### Add assembly references +The package adds assembly references to SMAPI, Stardew Valley, xTile, and MonoGame (Linux/Mac) or XNA +Framework (Windows). It automatically adjusts depending on which OS you're compiling it on. + +The assemblies aren't copied to the build output, since mods loaded by SMAPI won't need them. For +non-mod projects like unit tests, you can set this property: +```xml +