add user settings that override defaults (#693)
This commit is contained in:
parent
7a6dab7548
commit
fc0b98be45
|
@ -6,6 +6,7 @@
|
|||
* For players:
|
||||
* SMAPI now prevents mods from crashing the game with invalid schedule data.
|
||||
* SMAPI now prevents load crashes due to invalid building types.
|
||||
* Added support for persistent `smapi-internal/config.json` overrides (see info in the file).
|
||||
* Updated minimum game version (1.4 → 1.4.1).
|
||||
* Fixed 'collection was modified' error when returning to title in rare cases.
|
||||
* Fixed update-check error if a mod's Chucklefish page has no version.
|
||||
|
|
|
@ -19,17 +19,8 @@ This document is about SMAPI itself; see also [mod build package](mod-package.md
|
|||
|
||||
## Customisation
|
||||
### Configuration file
|
||||
You can customise the SMAPI behaviour by editing the `smapi-internal/config.json` file in your game
|
||||
folder.
|
||||
|
||||
Basic fields:
|
||||
|
||||
field | purpose
|
||||
----------------- | -------
|
||||
`DeveloperMode` | Default `false` (except in _SMAPI for developers_ releases). Whether to enable features intended for mod developers (mainly more detailed console logging).
|
||||
`CheckForUpdates` | Default `true`. Whether SMAPI should check for a newer version when you load the game. If a new version is available, a small message will appear in the console. This doesn't affect the load time even if your connection is offline or slow, because it happens in the background.
|
||||
`VerboseLogging` | Default `false`. Whether SMAPI should log more information about the game context.
|
||||
`ModData` | Internal metadata about SMAPI mods. Changing this isn't recommended and may destabilise your game. See documentation in the file.
|
||||
You can customise some SMAPI behaviour by editing the `smapi-internal/config.json` file in your
|
||||
game folder. See documentation in the file for more info.
|
||||
|
||||
### Command-line arguments
|
||||
The SMAPI installer recognises three command-line arguments:
|
||||
|
|
|
@ -61,6 +61,9 @@ namespace StardewModdingAPI
|
|||
/// <summary>The file path for the SMAPI configuration file.</summary>
|
||||
internal static string ApiConfigPath => Path.Combine(Constants.InternalFilesPath, "config.json");
|
||||
|
||||
/// <summary>The file path for the overrides file for <see cref="ApiConfigPath"/>, which is applied over it.</summary>
|
||||
internal static string ApiUserConfigPath => Path.Combine(Constants.InternalFilesPath, "config.user.json");
|
||||
|
||||
/// <summary>The file path for the SMAPI metadata file.</summary>
|
||||
internal static string ApiMetadataPath => Path.Combine(Constants.InternalFilesPath, "metadata.json");
|
||||
|
||||
|
|
|
@ -153,6 +153,9 @@ namespace StardewModdingAPI.Framework
|
|||
|
||||
// init basics
|
||||
this.Settings = JsonConvert.DeserializeObject<SConfig>(File.ReadAllText(Constants.ApiConfigPath));
|
||||
if (File.Exists(Constants.ApiUserConfigPath))
|
||||
JsonConvert.PopulateObject(File.ReadAllText(Constants.ApiUserConfigPath), this.Settings);
|
||||
|
||||
this.LogFile = new LogFileManager(logPath);
|
||||
this.Monitor = new Monitor("SMAPI", this.ConsoleManager, this.LogFile, this.Settings.ConsoleColors, this.Settings.VerboseLogging)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,12 @@ This file contains advanced configuration for SMAPI. You generally shouldn't cha
|
|||
The default values are mirrored in StardewModdingAPI.Framework.Models.SConfig to log custom changes.
|
||||
|
||||
|
||||
This file is overwritten each time you update or reinstall SMAPI. To avoid losing custom settings,
|
||||
create a 'config.user.json' file in the same folder with *only* the settings you want to change.
|
||||
That file won't be overwritten, and any settings in it will override the default options. Don't
|
||||
copy all the settings, or you may cause bugs due to overridden changes in future SMAPI versions.
|
||||
|
||||
|
||||
|
||||
*/
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue