diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-08 00:08:28 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-08 00:08:28 -0500 |
commit | fc5fc54ab1c375e20b3e4f947bb11f08b4983bd1 (patch) | |
tree | 39d53bcec33d7454829f6c4f24df5a43d9bf4ec4 /src | |
parent | 5399239c2be01396958ed454d6ae56f006d20ca5 (diff) | |
parent | b8309e90173172dd88a50b429b760271b4a150cf (diff) | |
download | SMAPI-fc5fc54ab1c375e20b3e4f947bb11f08b4983bd1.tar.gz SMAPI-fc5fc54ab1c375e20b3e4f947bb11f08b4983bd1.tar.bz2 SMAPI-fc5fc54ab1c375e20b3e4f947bb11f08b4983bd1.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Mods.ErrorHandler/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Mods.SaveBackup/manifest.json | 4 | ||||
-rw-r--r-- | src/SMAPI.Toolkit/Utilities/PathUtilities.cs | 3 | ||||
-rw-r--r-- | src/SMAPI.Web/wwwroot/schemas/content-patcher.json | 94 | ||||
-rw-r--r-- | src/SMAPI/Constants.cs | 2 |
6 files changed, 91 insertions, 20 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 58692de1..2811a11c 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.9.3", + "Version": "3.9.4", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.9.3" + "MinimumApiVersion": "3.9.4" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index 962b27f8..52bf4f6a 100644 --- a/src/SMAPI.Mods.ErrorHandler/manifest.json +++ b/src/SMAPI.Mods.ErrorHandler/manifest.json @@ -1,9 +1,9 @@ { "Name": "Error Handler", "Author": "SMAPI", - "Version": "3.9.3", + "Version": "3.9.4", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.9.3" + "MinimumApiVersion": "3.9.4" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index d51bc5d9..b88582ba 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "3.9.3", + "Version": "3.9.4", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.9.3" + "MinimumApiVersion": "3.9.4" } diff --git a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs index a394edba..babc0981 100644 --- a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs +++ b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs @@ -139,6 +139,9 @@ namespace StardewModdingAPI.Toolkit.Utilities /// <param name="rootPath">The root path to search.</param> internal static IEnumerable<string> GetTooLongPaths(string rootPath) { + if (!Directory.Exists(rootPath)) + return new string[0]; + return Directory .EnumerateFileSystemEntries(rootPath, "*.*", SearchOption.AllDirectories) .Where(PathUtilities.IsPathTooLong); diff --git a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json index 21514979..f5056eb1 100644 --- a/src/SMAPI.Web/wwwroot/schemas/content-patcher.json +++ b/src/SMAPI.Web/wwwroot/schemas/content-patcher.json @@ -11,9 +11,9 @@ "title": "Format version", "description": "The format version. You should always use the latest version to enable the latest features and avoid obsolete behavior.", "type": "string", - "const": "1.20.0", + "const": "1.21.0", "@errorMessages": { - "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.20.0'." + "const": "Incorrect value '@value'. This should be set to the latest format version, currently '1.21.0'." } }, "ConfigSchema": { @@ -69,6 +69,65 @@ } } }, + "CustomLocations": { + "title": "Custom locations", + "description": "The custom in-game locations to make available.", + "type": "array", + "items": { + "type": "object", + "properties": { + "Name": { + "title": "Name", + "description": "The location's unique internal name. This can't contain tokens. The name must begin with 'Custom_' (to avoid conflicting with current or future vanilla locations), can only contain alphanumeric or underscore characters, and must be *globally* unique. Prefixing it with your mod name is strongly recommended.", + "type": "string", + "allOf": [ + { + "pattern": "^ *Custom_" + }, + { + "pattern": "^ *[a-zA-Z0-9_]+ *$" + }, + { + "pattern": "^ *Custom_.+_.+ *$" + } + ], + "@errorMessages": { + "allOf:indexes: 0": "Custom location names must start with the exact text 'Custom_'.", + "allOf:indexes: 1": "Custom location names can only contain alphanumeric or underscore characters.", + "allOf:indexes: 2": "The location name should have three parts separated by underscores: the exact text 'Custom', a short label or acronym for your mod, and a map name (like 'Custom_YourModName_MapName'). Although not strictly required, this is very strongly recommended due to the consequences if two mods accidentally use the same location name." + } + }, + "FromMapFile": { + "title": "From map file", + "description": "The relative path to the location's map file in your content pack folder (file can be .tmx, .tbin, or .xnb). This can't contain tokens, but you can make conditional changes using EditMap.", + "type": "string", + "allOf": [ + { + "not": { + "pattern": "\b\\.\\.[/\\]" + } + }, + { + "pattern": "\\.(tbin|tmx|xnb) *$" + } + ], + "@errorMessages": { + "allOf:indexes: 0": "Invalid value; must not contain directory climbing (like '../').", + "allOf:indexes: 1": "Invalid value; must be a file path ending with .tbin, .tmx, or .xnb." + } + }, + "MigrateLegacyNames": { + "title": "Migrate legacy names", + "description": "An optional list of former location names that may appear in the save file instead of the one given by Name. This can't contain tokens. This is only meant to allow migrating older locations, and shouldn't be used in most cases.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + }, "DynamicTokens": { "title": "Dynamic tokens", "description": "Custom tokens that you can use.", @@ -127,7 +186,7 @@ }, "Enabled": { "title": "Enabled", - "description": "Whether to apply this patch. Default true. This fields supports immutable tokens (e.g. config tokens) if they return true/false.", + "description": "Whether to apply this patch. Default true. This field does not allow tokens.", "anyOf": [ { "type": "boolean" @@ -135,10 +194,6 @@ { "type": "string", "enum": [ "true", "false" ] - }, - { - "type": "string", - "pattern": "\\{\\{[^{}]+\\}\\}" } ], "@errorMessages": { @@ -267,6 +322,18 @@ } } }, + "AddWarps": { + "title": "Add warps", + "description": "The warp values to add to the location, in the format recognized by the game's Warp map property.", + "type": "array", + "items": { + "type": "string", + "pattern": " *-?\\d+ -?\\d+ [A-Za-z0-9_]+ -?\\d+ -?\\d+ *$", + "@errorMessages": { + "pattern": "Each warp must match the exact format recognized by the game's Warp map property (i.e. 'fromX fromY targetMap targetX targetY', like '10 10 Town 0 30'." + } + } + }, "MapProperties": { "title": "Map properties", "description": "The map properties (not tile properties) to add, replace, or delete. To add an property, just specify a key that doesn't exist; to delete an entry, set the value to null (like \"some key\": null). This field supports tokens in property keys and values.", @@ -441,6 +508,7 @@ "Update", "When", + "AddWarps", "FromArea", "MapProperties", "MapTiles", @@ -495,13 +563,13 @@ "title": "X position", "description": "The X position, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 }, "Y": { "title": "Y position", "description": "The Y position, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 } }, @@ -515,25 +583,25 @@ "title": "X position", "description": "The X position of the area's top-left corner, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 }, "Y": { "title": "Y position", "description": "The Y position of the area's top-left corner, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 }, "Width": { "title": "Width", "description": "The width of the area, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 }, "Height": { "title": "Height", "description": "The height of the area, measured in pixels for a texture or tiles for a map. This can contain tokens.", "type": [ "integer", "string" ], - "minimum:": 0 + "minimum": 0 } }, diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index a81a6bc9..0de2b12f 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -54,7 +54,7 @@ namespace StardewModdingAPI ** Public ****/ /// <summary>SMAPI's current semantic version.</summary> - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.9.3"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.9.4"); /// <summary>The minimum supported version of Stardew Valley.</summary> public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.4"); |