diff --git a/docs/release-notes.md b/docs/release-notes.md index bb30f31a..9fc0d432 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -20,7 +20,6 @@ * Added `data-*` attributes to the log parser page for external tools. * Fixed JSON validator showing incorrect error for update keys without a subkey. - ### For mod authors This is a big release that includes the new APIs planned for SMAPI 4.0.0, alongside the old ones. @@ -40,6 +39,7 @@ the C# mod that loads them is updated. _This adds support for many previously unsupported cases: proxied interfaces in return values or input arguments, proxied enums if their values match, generic methods, and more. Existing mod APIs should work fine as-is._ * Mod files loaded through SMAPI APIs (including `helper.Content.Load`) are now case-insensitive, even on Linux. * Other improvements: + * Added [command-line arguments](technical/smapi.md#command-line-arguments) to toggle developer mode (thanks to Tondorian!). * Added `IContentPack.ModContent` property. * Added `Constants.ContentPath`. * Added `IAssetName` fields to the info received by `IAssetEditor` and `IAssetLoader` methods. diff --git a/docs/technical/smapi.md b/docs/technical/smapi.md index 7da1e0f1..e117db2f 100644 --- a/docs/technical/smapi.md +++ b/docs/technical/smapi.md @@ -33,11 +33,12 @@ argument | purpose `--uninstall` | Preselects the uninstall action, skipping the prompt asking what the user wants to do. `--game-path "path"` | Specifies the full path to the folder containing the Stardew Valley executable, skipping automatic detection and any prompt to choose a path. If the path is not valid, the installer displays an error. -SMAPI itself recognises two arguments **on Windows only**, but these are intended for internal use +SMAPI itself recognises five arguments **on Windows only**, but these are intended for internal use or testing and may change without warning. On Linux/macOS, see _environment variables_ below. argument | purpose -------- | ------- +`--developer-mode`
`--developer-mode-off` | Enable or disable features intended for mod developers. Currently this only makes `TRACE`-level messages appear in the console. `--no-terminal` | The SMAPI launcher won't try to open a terminal window, and SMAPI won't log anything to the console. (Messages will still be written to the log file.) `--use-current-shell` | The SMAPI launcher won't try to open a terminal window, but SMAPI will still log to the console. (Messages will still be written to the log file.) `--mods-path` | The path to search for mods, if not the standard `Mods` folder. This can be a path relative to the game folder (like `--mods-path "Mods (test)"`) or an absolute path. @@ -49,6 +50,7 @@ can set temporary environment variables instead. For example: environment variable | purpose -------------------- | ------- +`SMAPI_DEVELOPER_MODE` | Equivalent to `--developer-mode` and `--developer-mode-off` above. The value must be `true` or `false`. `SMAPI_MODS_PATH` | Equivalent to `--mods-path` above. `SMAPI_NO_TERMINAL` | Equivalent to `--no-terminal` above. `SMAPI_USE_CURRENT_SHELL` | Equivalent to `--use-current-shell` above. diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 0c9c2d87..b2e213fe 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -200,6 +200,12 @@ namespace StardewModdingAPI // get from environment variables if (string.IsNullOrWhiteSpace(rawModsPath)) rawModsPath = Environment.GetEnvironmentVariable("SMAPI_MODS_PATH"); + if (developerMode is null) + { + string rawDeveloperMode = Environment.GetEnvironmentVariable("SMAPI_DEVELOPER_MODE"); + if (rawDeveloperMode != null) + developerMode = bool.Parse(rawDeveloperMode); + } // normalize modsPath = !string.IsNullOrWhiteSpace(rawModsPath)